The FDP has been troubling lately over our translation tools, and we thought we lately had our problems licked by using xml2po from the gnome-doc-utils package, which purports to take care of the whole translation process. We’d use it to create POT template files, and the translators could use their favorite tool to generate PO files. Then xml2po is supposed to grab the template and the PO and build the translated XML, which we can then convert to HTML, etc.
Unfortunately, it doesn’t work as advertised, since this US English DocBook XML DTD:
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"//www.docbook.org/xml/4.4/docbookx.dtd" [
<!ENTITY % MY-ENTITIES SYSTEM "../my-entities.ent">
%MY-ENTITIES;
]>
…becomes this for a translation:
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"//www.docbook.org/xml/4.4/docbookx.dtd" [
<!ENTITY % MY-ENTITIES SYSTEM "../my-entities.ent">
]>
Which I’m sure most people would agree is, er, flawed. Obviously the builds break for any document using entities from my-entities.ent, which is just about all of them.
We can use po2xml from the kdesdk package to do the job correctly, but not only is that package huge (17 MB), it also drags in a ponderous load of dependencies including kdepim (48 MB). So now we’re looking at intltool to handle this segment of our build infrastructure.
I’ve tried the gnome-doc-utils in Rawhide and it still doesn’t work, in much the same way, but I’m not sure we’re not abusing the tool.
You’re probably interested in the “-k” option for xml2po, but it is documented not to work when merging translations back. Feel free to report it in bugzilla on
//bugzilla.gnome.org/enter_bug.cgi?product=xml2po
and I’ll try to get to it as soon as I can. Remember, problems we need solving are best solved if we poke responsible guys from time to time 😉
Thanks,
Danilo
Btw, this seems to be the “problem” of libxml2, since simply running xmllint on this:
../my-entities.ent:
ents.xml:
%MY-ENTITIES;
]>
Test &testentity;
results in:
]>
Test &testentity;
But, this is still valid XML with the same meaning, it just inserts all entities from my-entities.ent directly into the same file. And I’ve tried it, and xml2po behaves the same.
Output above is messed up due to processing, but you can see what I mean simply with trying using xmllint.