• Internationalization

last modified October 15, 2007 by r0ver

Participants 

  • r0ver
  • Dimitris
  • Lennart
  • Finn

Status

product / language | greek | es       | no     |   pt   |  pt_br
p4a.video               | 80%   | 80%   | *80% |         |
p4a.calendar          |           | 100% | 100% |         |
p4a.audio               |          |  100% |          |  50% |  50%

* to be commited

Mini HowTo translate p4a.smt

Be sure to meet all dependencies:
  • msgfmt provided by gettext package (at least on ubuntu)
  • i18ndude

Case a: the product doesn't support i18n yet

0. Create the basic directoty and files structure, to do:
  • Go to $BUILDOUT_PATH/p4a.buildout/src/p4a.video/p4a/video/
  • mkdir locales/LC_MESSAGES/es ; mkdir locales/LC_MESSAGES/en ; mkdir locales/LC_MESSAGES/el ; mkdir locales/LC_MESSAGES/no ;
  • create locales/LC_MESSAGES/es/p4a.video.po and copy the skel from any other .po file

1. convert po to mo using msgfmt (the current path is smt like $BUILDOUT_PATH/p4a.buildout/src/p4a.video/p4a/video/locales ):

$ msgfmt --use-fuzzy -o es/LC_MESSAGES/p4a.video.mo es/LC_MESSAGES/p4a.video.po


2. generate pot
$ i18ndude rebuild-pot --pot p4a.video.pot --create p4a.video `ls ../browser/*.pt`

3. generate po files
$ i18ndude sync --pot p4a.video.pot */LC_MESSAGES/p4a.video.po

Case b: adding the translation to my language

1. create the files for your language:

$ mkdir -p es/LC_MESSAGES
$ touch es/LC_MESSAGES/p4a.video.po
$ i18ndude sync --pot p4a.video.pot */LC_MESSAGES/p4a.video.po

2. edit the product's file in your language and translate all the entries:

$ vim es/LC_MESSAGES/p4a.video.po

3.  generate the mo

$ msgfmt --use-fuzzy -o es/LC_MESSAGES/p4a.video.mo es/LC_MESSAGES/p4a.video.po

4. restart zope, test!, fix and start again.