Nested LaTeX commands
by Tobias Germer
Hi all,
I am currently evaluating po4a to see if it is suitable for translating
our documentation written in LaTeX. I found the problem that po4a
doesn't seem to parse commands recursively. For example, if I define
these two commands:
% po4a: command -doTranslate {_}
% po4a: command -doNotTranslate {}
and translate the following tex source:
\doTranslate{
test string
\doNotTranslate{test2}
}
Then po4a produces:
msgid "test string \\doNotTranslate{test2}"
msgstr ""
I think \\doNotTranslate{test2} should not show up there. Indeed, when
you change the tex source to:
\doTranslate{
test string
}
\doNotTranslate{test2}
The output changes to the correct format:
msgid "test string"
msgstr ""
I think this is a severe limitation of po4a, since you can always define
nested commands in LaTeX, like "\textbf{This \emph{is} an {\huge
example} text.}"
Does the LaTeX module ignore this case or is it just bug? If yes, could
it be fixed easily?
Regards,
Tobias
13 years, 8 months
po4a #518218: [DocBook] Add support for translator credits
by Osamu Aoki
Hi,
I wanted to add translator credits and it looked to me that, instead of
waiting bug #518218 to be implemented, it is better to use existing
feature --- addendum.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518218
My conclusion: It is not so simple for DocBook module. It does not
work as it used to work under DebianDoc SGML .
Here is why.
This addendum feature is serious headache to be honest. It seems to be run on
section-by-section of XML source instead of actual lines.
When I have french version of maint-guide without addendum but just
translated from base English version after DocBook conversion.
| <title>Guide du nouveau responsable Debian</title>
| <bookinfo>
| <authorgroup>
| <author> <personname> <firstname>Josip</firstname> <surname>Rodin</surname> </personname> <email>joy-mg(a)debian.org</email> <contrib>(original contents)</contrib> </author>
| <author> <personname> <firstname>Osamu</firstname> <surname>Aoki</surname> </personname> <email>osamu(a)debian.org</email> <contrib>(updated contents)</contrib> </author>
|
| <!-- Add othercredit role="translator" via po4a/translator.*.addendum -->
| </authorgroup>
| ...
| <legalnotice>
| <para>
| Ce document peut être utilisé selon les termes de la Licence publique
| générale de GNU version 2 ou suivante.
| ...
| </para>
| </legalnotice>
| </bookinfo>
| ...
I naturally want to do following using stable comment text:
| PO4A-HEADER:mode=after;position=othercredit;beginboundary=^
| <othercredit role="translation">Traduction par <personname><firstname>Frédéric<firstname> <lastname>Dumont</lasname></personname><email>frederic.dumont(a)easynet.be</email></othercredit>
Then this whole thing is added after "</bookinfo>". Oh, no. As I
experimented, the whole "<bookinfo>...</bookinfo>" section seems to be
treated as a single unit for addendum. I have no way to insert text
here where addendum is required.
For now, I decided to add comment lines where changes are needed and use
unified diff and patch to make required changes available.
Isn't this patch approach simpler and more generic? All we need to do
is to add
| PO4A-HEADER:mode=patch
... place patch file
Hmm... since current addendum is done within Perl, it may be cleaner
doing this after normal po4a-translate by applying series of patches:
01_foo.fr.patch, 02_bar.fr.patch, ... I guess I add this feature to my
makefile for now.
Osamu
13 years, 8 months