Hello,
Here is the patch to the freeduc-doc cvs that permits to handle the TeX
documentation.
It is quite small.
The modification in xfig.tex is needed because a an \item is followed by:
{\small ...}
This is probably perfectly correct, but the parser take it for an
argument, whereas I specified the \item command as only having an optional
argument.
The patch specifies temporarily that the \item command can have any number
of mandatory arguments which are all translated.
This could probably be safely specified with the other commands, but I
wanted to play and test if the command definitions could be used to
define temporary behavior.
After applying this patch, po4a deals like a charm with this LaTeX
documentation. (with the exception of the % in the xml command)
Regarding the xml command, I will try to add the ability to specify
commands with the same behavior as the verbatim environment (no rewrap,
and no comments). At this time, a workaround could be to specify the new
HlxTopPanel command in a separate file, excluded from the po4a inclusion
(or excluding the macro.tex file, and translating it manualy).
The translation, once the PO file is translated is obtained by:
TEXINPUTS=/usr/share/texmf/tex/latex/base \
PERLLIB=/home/fzt/sources/po4a/cvs/lib \
/home/fzt/sources/po4a/cvs/po4a-translate -f latex -m book.tex \
-p freeduc.pot -o exclude_include=content-fr:application-fr \
-M ISO-8859-1 \
-l book-po4a.tex -L ISO-8859-1
The -l switch specifies where the translated document is output,
and the -L switch, its encoding.
Note: A patch for the Transtractor is available on the CVS
an additional -k 0 switch can be added to test the translation when only a
small part of the PO is translated.
I had a look at the PO file, it seems quite nice to me (strings are not
too much split, not too much grouped).
You will find itemize paragraphs very ugly. I have locally a patch that
permits to translate separately each items. It also permits to split cells
in tabular environments or commands like authors where \\ permits to
separate different fields.
A last concern:
It seems the freeduc-doc project has multiple master languages.
This may be more difficult to handle than translation from a single
language. The po4a command provided previously permits to translate
the French document into another language, and generates a single
book-<lang>.tex document. In order to translate granules (the LaTeX
chapters found in different files) from different languages, it could be
better to translate each granule separately. This could be done by adding
this line in every granules:
\input{po4a-definitions}
and having all the po4a definitions ("% po4a: " line) in this
po4a-definitions.tex file.
A po4a config file could then be used to ease translator's life (less
commands, more reuse of translations)
Best Regards,
--
Nekral