Cheetah Internationalization

For the Cheetah release, we plan to have i18n support built in from the start. In particular:

  • All content pages will be rendered in UTF-8
  • Dates and times will display in locale specific format
  • Numbers will display in locale specific format (decimal and grouping separators)

We hope to make available some more advanced translation tools for adding new translations to Mifos. In particular, we are evaluating Pootle http://translate.sourceforge.net/wiki/pootle/index to use for managing online distributed translation work.

In order to better manage translation text and make use of more advanced tools like Pootle, we currently plan to use the PO file format for storing, updating and maintaining translation work. For translators and the community in general the use of PO files should be transparent. For developers, it will imply some additional workflow. The workflow explored in the initial Cheetah spike is outlined below:

This workflow makes use of the "Translation Toolkit" which can be downloaded and installed from here: http://sourceforge.net/project/showfiles.php?group_id=91920&package_id=144807/&abmode=1

  • There will be one or more properties files which contain English text key value pairs (we'll call it messages.properties here). When developers add text to a web page or a java file, they will create new key value pairs in messages.properties for each string added.
  • When an updated translation is needed, a new PO template file (or POT) file will be generated:
    prop2po.py message.properties --pot message.properties.pot
    
  • To generate a PO file for a new locale, (here the Icelandic IS locale is used) the following command would be run:
    pot2po.py messages.properties.pot messages_is.properties.po
    
  • If a PO file with existing translations already exists, then it would be updated using the exiting PO file as a template (and then replacing the template with the updated file):
    pot2po.py -t messages_is.properties.po messages.properties.pot messages_is2.properties.po
    cp messages_is2.properties.po messages_is.properties.po
    
  • At this point, PO files could be uploaded to a tool like Pootle, additional translations added and then the modified versions could be downloaded. There are also other standalone tools like poedit available for working on PO files.
  • After adding additional translations to the PO file, a localized properties file is then generated (using the original English properties file as a template for generating the updated IS locale properties file):
    po2prop.py -t message.properties message_is.properties.po message_is.properties
    

In this workflow the files messages.properties and messages_is.properties.po would be stored and the messags.properties.pot and messages_is.properteis files could be generated when needed. In the cheetah spike, all of these files have been committed rather than relying on generating them.

The Cheetah spike web app illustrates how PO files could be used and includes the Icelandic (IS) locale. To see the IS locale using Firefox, go to Tools->Options->Advanced and click the "Choose..." button under "Languages". Add the Icelandic locale, and move it to the top of the list of languages in order of preference. Accept the setting by "okaying" out of the Languages dialog and Options dialog, then refresh the web page in the browser. The "languages" link in the footer takes you to a page which shows Chinese, Arabic, Hindi and French text.