[Po4a-devel] Introduction, and a polite request for help

Denis Barbier bouzim at gmail.com
Mon Sep 20 20:45:53 UTC 2010


On 2010/9/20 daniel cabrera:
> Greetings po4a people.
> My name is Daniel Cabrera, and I'm one of the members of the Fedora
> Spanish translation team. We've decided to start updating our man pages,
> and for that, we've found that po4a is the perfect tool. Since we are
> very few in our team, and since we're more accustomed to use graphical
> programs, I'm having a couple of troubles that maybe you could help me
> solve.
> Our working plan is to first convert all of our outdated database (v.
> 1.55) into .po files, and then update them to 3.25... if that's the last
> version. So, my first problem is that when I try to convert a man page
> into a .po file, the translated strings are placed as msgid strings. I'm
> using as a source file a man page already in Spanish (accept.2, for this
> example), and the command I'm running is:
>
> $ po4a-gettextize -f man -m accept.2 -M UTF-8 -p accept.2-es-ES.po

Hi Daniel,

(I do not know whether you subscribed, thus Cc: you)

In order to produce meaningful PO files, you have to run
po4a-gettextize with an English file and its translation.  I
downloaded man-pages-es 1.55 from
http://www.ditec.um.es/~piernas/manpages-es/.
I did not find man-pages 1.55 (do you have a copy?), but found 1.56 here:
  http://rpmfind.net//linux/RPM/PLD/dists/ra/updates/general/SRPMS/man-pages-1.56-1.src.html
After extracting those tarballs, my directory contains:
    man-pages-1.56  man-pages-es-1.55
Then
  $ po4a-gettextize -f man -m man-pages-1.56/man2/accept.2 \
    -l man-pages-es-1.55/man2/accept.2 -L UTF-8 -p accept.2-es-ES.po
works just fine.  Some English manual pages contain accented letters,
you will then have to specify its encoding with the -M flag.

One more point: some manual pages have been removed (for instance most
pages under section 1), do not lose time converting them to PO files.
(But beware that some pages have been moved into another section)

> My second problem is to be able to convert more than a file at once, but
> that can wait :-)

Here we go: WARNING: These commands remove files after converting them
to PO files!!!
Make sure to use a VCS or work on a copy.

  $ for f in man-pages-es-1.55/man*/*.?; do
      echo Processing $f;
      po4a-gettextize -f man \
            -m man-pages-1.56${f#man-pages-es-1.55} \
            -l $f -L UTF-8 -p $f.po 2>/dev/null && rm -f $f;
      done

   $ git ls-files --deleted | wc -l
   1114
   $ git ls-files man-pages-es-1.55/man? | wc -l
   1303

Thus po4a-gettextize did successfully convert 1114 files from 1303.
You will have to manually check failing pages; this is pretty boring,
but you have to do that task only once.

Denis



More information about the Po4a-devel mailing list