[Xfce-i18n] Translatable XML files (Was: Japanese translation updated)

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu Feb 17 13:22:56 CET 2005


Jasper Huijsmans wrote:
>>>Well, as far as .desktop files are concerned, I'd like to translate
>>>it in PO file (with intltool), in this case of course, translation
>>>so far is discarded, but it'll reduce where translation needs, also
>>>it can be said XML file. To keep XML file sync'd, I think it's better
>>>each languages'll be treated one file with tag e.g.
>>>
>>><tag xml:lang="en">Hello world!</tag>
>>>
>>>is it bad idea? it also needs .xml.in files tough.
>>
>>great idea as beeny pointed out and if you've some work done submit a
>>patch to benny, he is our autotools guru ;)
> 
> It's a good idea, but it requires not only autotools cahnges, but also
> changes to the xml parsing, please correct me if I'm wrong. If someone wants
> to have a look at it for 4.4, I'll gladly take patches for the panel ;-)

Thats exactly the point (the autotools changes are more or less 
trivial). Instead of having one .xml file per language, you'd have all 
languages in one .xml file (using the standardized xml:lang attribute), e.g.

<?xml version="1.0"?>
<Xfce>
   <Panel orientation="0" size="1" popupposition="1">
   </Panel>
   <Groups>
     <Group>
       <Popup/>
       <Control id="-2" popup="0">
         <Command term="0" sn="0">Terminal</Command>
         <Tooltip>Terminal</Tooltip>
         <Tooltip xml:lang="de">Befehlszeile</Tooltip>
         <Icon id="12"/>
       </Control>
     </Group>
   </Groups>
</Xfce>

This is pretty trivial for the panel, as there's only the <Tooltip> and 
the <Caption> tags that need translations, but for the menu.xml file, 
this won't work, because it has translatable strings as attribute 
values, rather than TEXT elements. On the other hand, this won't matter 
if we implement the XDG menu-spec for 4.4 (the .menu files don't contain 
translatable strings, but the translatable strings are located in 
standard .desktop and .directory files).

So, the menu.xml and xfce-registered-categories.xml files will go away, 
and will be replaced with a single xfce4.menu w/o translatable strings 
and a bunch of .directory files, that can be handled by intltool just 
like .desktop files.

So, afterall, we only have the panel's contents.xml file left for 4.4 
then. As said above, this is pretty easy; all you need to do is to check 
for translated <Tooltip>'s and <Caption>'s, and then find the best match 
using xfce_locale_match(). A sample GLib-based parser for the MIME info 
files, which includes translatable <comment> tags, is available at

  http://thunar.xfce.org/wiki/implementation:mime-info-parser

that should give you a basic idea.

> 	Jasper

Benedikt

PS: Discuss this on xfce4-dev rather than xfce-i18n?



More information about the Xfce-i18n mailing list