Re: xml2po



Hi Matthew,

Today at 11:52, Matthew East wrote:

> The relevant xml file can be found here:
> https://docteam.ubuntu.com/repos/branches/breezy/generic/faqguide/C/installing-applications.xml

This file is not even well-formed XML.  xml2po really can't work with
such files, even though it tries sometimes.  However, you are
referencing entities which are not defined, so xml2po is pretty much
lost.

A good test if xml2po will be able to handle a file is to pass it
through "xmllint": if there are no errors, you're pretty safe.

Also, it's suggested that you use "-e" option (replace all entities,
this is really essential for any translation, since a single entity
might take a number of forms in translations, and only translator
knows when they need which), and to use "xinclude" mechanism for
multi-file documents.  Gnome release notes are a good example of all
this, and they live in Gnome CVS under 

  gnomeweb-wml/www.gnome.org/start/2.12/notes/


Also, I have some plans to support this kind of documents, but it
involves a couple of ugly hacks which I am not really looking forward
to implementing (such as extracting DTD node from another document,
inserting it in the current document tree, then trying to parse that 
combination, and stripping the DTD node on output).

> As you can see, a number of paragraphs are put on the same line of
> the .pot file, and loads of the entities (e.g. &ubuntu;) have been
> missed out.

Exactly—entities are undefined, so xml2po does best it can: it ignores
them.

Really, I think you should restructure your document to be more suited
for translation, and that would also make it a lot easier for
maintenance as well.

If you need a quick solution, you can simply use "xml2po -e" on your
top-level document (faqguide.xml), which will include all the files
correctly, but you'll be able to get only a single merged .xml file
that way. 

I can also suggest that you make use of gnome-doc-utils build system,
and migrating is described at:

  http://live.gnome.org/GnomeDocUtilsMigrationHowTo


Cheers,
Danilo



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]