Re: Doc Translations



danilo gnome org (Danilo Åegan) writes:

>> <!ENTITY appversion "2.1.6">
>> <!ENTITY manversion "2.1.0">
>> <!ENTITY app "Bug Buddy">

> Eg. "With &app; ..." should be translated differently from "&app;
> is..." in Serbian.  With &app; being "Bug Buddy", corresponding
> translations would be "Sa *Bratom buba* ..." and "*Brat buba* je..."

I'd vote to add some more language specific entities (as long as it
makes sense):

<!ENTITY app "Bug Buddy">
<!ENTITY app-sr1 "Bratom buba">
<!ENTITY app-sr2 "Brat buba">

Using entities those name would be consistent all over the document,
hopefully.

> It would be even easier for me (in terms of code) not to have to cope
> with this (I even had to do some terrible hacks to achieve this
> behaviour),

I thought the parser can replace the entities automatically (xmllint's
--noent option).

> but it wouldn't solve all the problems like the one above.
> The alternative is to keep entities here, and let translators
> omit them if they feel like it, but that means I'd need to provide
> more messages which will be entity translations, along with a
> translators' comment indicating what entity this message is about.

Yes.

> When we get to that, we should probably allow translators to define
> their own entities, and so forth.  But PO format is simply not that
> well suited to encapsulate entire XML format.

Yes, own entities are necessary.  There is always some meta stuff
involved ;)  As long as the PO format is wanted, you can make use of the
usual tricks: either add some comments or deal with it inside the
messages (texts).

Adding an option to stop expanding entities would be nice.

> FWIW, there's also a simple way to solve system-entities problem I
> described earlier: simply parse entire XML while *expanding* external 
> entities (this is a one-line change to the code, to turn this
> behaviour of libxml2 on).  It means you won't be able to merge
> translations back into multiple files, but only one.

Splitting the big PO file into chunks matching smaller .pot files (which
are corresponding to .xml files) is possible by using tools coming with
gettext.


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