[sldev] Translations

Daniel Nylander po at danielnylander.se
Fri Jul 27 11:44:24 PDT 2007


Guys (and gals), I think I'm on to something here.

I'm using the xml2po from the gnome-doc-utils package to convert all
translatable XML data to GNU gettext strings. GNU gettext is also required.


cd indra/newview/skins/xui

(I'm using the 1.18.0.6 release source code on Linux)


1. Create the POT file (POT = untranslated PO Template)

xml2po -o secondlife.pot en-us/*.xml

2. Copy the template (secondlife.pot) to xx.po (where xx is your country
code) with a PO editor (such as poedit, kbabel etc.). The file contains
1609 different text strings.

I have generated a template which you can see over at
http://home.danielnylander.se/translations/secondlife/secondlife.pot

3. Convert the translated PO file back to localized XML files

xml2po -p xx.po en-us/alerts.xml > xx/alerts.xml

This can also be automated for all 137 English XML files (Unix shell script)

cd en-us; for a in *.xml; do xml2po -p ../xx.po $a > ../xx/$a; echo "$a
done"; done

4. Voila! Now you should have a complete translation.


If you need to update an existing translation, create the POT file but
use the 'msgmerge' command to merge is new structure with the old  PO
file. This will add/change the strings in the existing PO file and the
translator will directly see the changed/new strings.


This process means:

- Translators should not touch the XML files at all. One string can be
used at hundreds of places but will only be translated once.

- No faulty XML files(?). Translators will only touch translatable
strings and nothing else.

- Developers can update the translations and send the incomplete PO file
to the translators for a quick update. Developers will then generate the
XML files.

- Proofreading will be so easy. Everything is in one file. Creating a
diff between versions is even more simple.

- There are web based translation tools which can be offered to
translators and translator teams. One free tool is Pootle.
http://www.wordforge.org/drupal/projects/wordforge/tools/pootle


Please test this process and see if it works out for you!

-- 
Daniel Nylander (CISSP, GCUX, GCFA)
Stockholm, Sweden
http://www.DanielNylander.se
info at danielnylander.se  yeager at ubuntu.com  dnylande at gnome.org



More information about the SLDev mailing list