Skip to content

The translation process

Antonio Monje edited this page Mar 2, 2016 · 1 revision

http://exelearning.org/wiki/TranslatingExe is outdated but a good read to begin with. We at exelearning.net don't use pootle or Pierre Rouleau's mki18n.py.

Infrastructure

Our main tool is tools/mki18n.sh, created by Pedro Peña, for the cycle from python .py files and javascript .js to PO and back.

mki18n.sh calls python-babel. As the older versions didn't comply with the new header fields (Language, see bug https://forja.cenatic.es/tracker/?func=detail&atid=883&aid=1905&group_id=197), we use a patched version of python-babel 1.3, available at https://www.dropbox.com/s/k1i7ph2m2g4s7kx/Babel-1.3.tar.gz.

To install the patched version:

-Uninstall previous pybabel if packaged in Linux distro (sudo apt-get purge python-babel)

-Install the patched version with

$ sudo pip install https://dl.dropboxusercontent.com/s/k1i7ph2m2g4s7kx/Babel-1.3.tar.gz

Pybabel needs locale .dat files for each supported language (check http://babel.pocoo.org/ - http://babel.edgewall.org/ is old now). Two steps here:

1.- create .dat files from CLDR .xml files for pybabel to use

$ cd dir_of_pybabel_sources

$ make

If your language is not supported you'll have to create the different .xml files, studying the ones for similar languages.

2.- tell pybabel to create the language subdirectories using the .dat files for eXeLearning to use, like this (Arab PO file being created in the example)

$ pybabel init -i exe/locale/messages.pot -o exe/locale/ar/LC_MESSAGES/exe.po -l ar

We have had to compile .dat files for those languages that weren't supported by babel or CLDR yet, and we also had to add some languages to eXelearning, for example ca_VALENCIA (the Catalan variant spoken in the region of Valencia), ast (Asturian), an (Aragonese) and ar (Arab).