Bug 19240

Summary: man page of msec is not translatable, available translations are years older than the English version
Product: Mageia Reporter: papoteur <yvesbrungard>
Component: RPM PackagesAssignee: papoteur <yvesbrungard>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: filip.komar, marja11, pablo, thierry.vignaud, yurchor
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: msec CVE:
Status comment:

Description papoteur 2016-08-23 08:11:09 CEST
Description of problem:
The man page is provided for one part by a text in man.py, and for a second part by a collection of docstrings in programs.
I don't know if man page can be included in a pot file.
I saw a project where the source is in docbook format, translated, then the man page is generated from docbook format.
https://github.com/mbunkus/mkvtoolnix/blob/master/doc/development.md
Thierry Vignaud 2016-08-23 15:49:39 CEST

Priority: Normal => Low
Source RPM: (none) => msec
Severity: normal => enhancement

Comment 1 Marja Van Waes 2016-08-25 06:36:22 CEST
@ Thierry

The English man page has 209 lines
The Dutch man page has 65 lines
The French one is less old than the Dutch one, but also way too old.

So increasing piority and severity back to normal. Maybe dropping the existing translations would be better, after which this can become an enhancement again.

(In reply to papoteur from comment #0)
> Description of problem:
> The man page is provided for one part by a text in man.py, and for a second
> part by a collection of docstrings in programs.
> I don't know if man page can be included in a pot file.
> I saw a project where the source is in docbook format, translated, then the
> man page is generated from docbook format.
> https://github.com/mbunkus/mkvtoolnix/blob/master/doc/development.md

@ Yuri, Pablo, Filip

Can you help papoteur?

Priority: Low => Normal
CC: (none) => filip.komar, marja11, pablo, thierry.vignaud, yurchor
Assignee: bugsquad => yves.brungard_mageia
Summary: man page of msec is not translatable => man page of msec is not translatable, available translations are years older than the English version
Severity: enhancement => normal

Comment 2 Yuri Chornoivan 2016-08-25 10:15:06 CEST
(In reply to Marja van Waes from comment #1)
> @ Yuri, Pablo, Filip
> 
> Can you help papoteur?

Unfortunately, it is hard to parse Python code files to construct POT file translated man files without msec.8 itself.

It would be good to have more or less up-to-date msec.8 in the source tree (it would be rewritten during make process anyway) then work with PO files and convert them back into the translated man pages.

As soon as we have msec.8, it is easily scriptable like this:

1. Extract messages:

#!/bin/bash

  po4a-gettextize --format man \
   --master-charset UTF-8 --po man.pot \
   --msgid-bugs-address "i18n-discuss@ml.mageia.org" --copyright-holder "Mageia" \
   --package-name "MSEC man" --package-version "1.0" \
   $(
for doc in C/*.8; do
  echo --master $doc
done
  )

2. Merge with existing translations:

#!/bin/bash
POFILE=$1

if [[ $POFILE == "" ]]; then
  for i in *.po
  do
    echo -n $i": "
    msgmerge --backup=none --update $i man.pot && \
    msgfmt -o /dev/null --statistics --check $i
  done
else
  echo -n $1".po: "
  msgmerge --backup=none --update $1.po man.pot && \
  msgfmt -o /dev/null --statistics --check $1.po
fi

3. Update man pages:

#!/bin/bash -e
LANG=$1

for doci in C/*.8; do
  docfilename=${doci#*/}
  doc=${docfilename%.*}
  if [[ $LANG == "" ]]; then
    for i in *.po
    do
       ILANG=${i%.*}
       echo "Producing man "$doc" for locale "$ILANG
       po4a-translate -k 0 --format man --master-charset utf-8 --localized-charset utf-8 \
         --master C/${doc}.8 --po $ILANG.po --localized $ILANG/${doc}.8
    done
  else
    echo "Producing man of "$doc" for locale "$LANG
    po4a-translate -k 0 --format man --master-charset utf-8 --localized-charset utf-8 \
      --master C/${doc}.8 --po $LANG.po --localized $LANG/${doc}.8
  fi
done
Comment 3 papoteur 2020-05-24 21:33:18 CEST
Hello,
I have modified the code to divide man text in pieces included in the gettext. Then, it is translatable.
The build of translated man pages is still to do.