On Sun, Oct 08, 2006 at 05:07:11PM +0200, Heiner wrote:
On Sunday 08 October 2006 14:24, Nicolas François wrote:
> > The second, more
> > important is, why this ends with a double "larger than". The source
code
> > was:
> >
> > <mediaobject><imageobject><imagedata
fileref="apicture.png"
> > format="PNG"/> </imageobject></mediaobject>
>
> Not in the source you sent:
> <mediaobject>
> <imageobject>
> <imagedata fileref="apicture.png" format="png">>
> </imageobject>
> </mediaobject>
Definitely not. If I download
http://lists.alioth.debian.org/pipermail/po4a-devel/attachments/20061008/...
[...]
There was definiately an /> converted into a >> !
Sorry, my bad. I checked the generated file;(
I think nsgmls is troubled by the XML file it receives.
<imagedata fileref="apicture.png" format="png"/>
is, according to the output of nsgmls, equivalent to
<imagedata fileref="apicture.png" format="png">>
(i.e. '/' closes the tag, and the remaining '>' is just an additionnal
character)
This is of course not the case in a XML file (but here, it is interpreted
as an SGML file).
I will try to support it anyway since I would like this module to be able
to deal with XML also (but I've not been successful in doing this this
afternoon). Maybe I could support it with an option.
> When I run po4a with the file you sent, the line references I
get are:
>
> #: testproj.xml:45 test_chapter.xml:4
>
> (So it needs a little fix, the string is really on line 6).
> Can you check again. Maybe it's a difference in the dependencies of po4a
> (I'm thinking about nsgmls), which behaves in a different way on FreeBSD.
Not sure what to check here. I did run
/usr/local/bin/po4a-gettextize -f sgml -m ./testproj.xml -p ./testproj.pot
again but with the same result. Most entries from test_chapter.xml were listed
as
#: ./testproj.xml:41
Some from the end of test_chapter.xml as
#: ./testproj.xml:45 ./test_chapter.xml:11
OK.
The line references are not perfect, but it seems they are better now.
I can't tell you wether it due to my version of nsgmls (1.3.4-1.2.1-47)
or po4a (0.28)
I'm joining the POT file generated on my system.
The line references are just helpers.
There could be some improvements: here testproj.xml:45 could be removed
(it is the reference of the line where the test_chapter.xml file is
included). Also the line numbers are not always exact.
> However, note that doing this with po4a is quite difficult in
the sgml
> module. (due to sgml conditionnals, po4a is used to deal with invalid
> files (tags closed twice, etc.)).
> I would prefer to have an option to run an external program to check the
> generated files.
Whatever you plan to do here, it should work on the .po file entry level! In
other words it should say: "your translation of ....
in ./testproj.xml:45 ./test_chapter.xml:30 is wrong, as it breaks the xml
syntax or semantic rules". It does not help if it states during
po4a-translate, that the result xml files has an unterminated <whatever> tag.
Finding the wrong translation in the .po will probably last forever!
Another option could be to use some of the tools from the
translate-toolkit (or pootle, I don't remember), which perform some of
these checks, if I recall correctly.
Kind Regards,
--
Nekral