wiki:ThibloTranslation

We use Django's built-in i18n framework. Message files (.po) are stored in the PROJECT_ROOT/locale (views and templates) and PROJECT_ROOT/apps/webmore/locale/ (javascripts) folders.

GWT localization

We're using "dynamic string translation" as it called in GWT manual. If you want to write something localized in Java code, use Messages.get("English text").

If you have modified strings in GWT code, you should run ./rungwt.py localize before performing general steps described below. This script scans Java sources for uses of Messages.get and collects strings to be localized into special Django template /templates/account/gwt_locale.html, which is then included by GWT host page. This file is handled by Django i18n system, and all strings from there will appear in .po files.

Editing and commiting

If you have added (or edited) a new string in a view or a template, run PATH_TO_THE_DJANGO_FOLDER/bin/make-messages.py -a from the project's root folder. If you have added (or edited) a new string in a javascript file, run PATH_TO_THE_DJANGO_FOLDER/bin/make-messages.py -d djangojs -l hu from the apps/webmore folder.

After you finish editing your files, run a PATH_TO_THE_DJANGO_FOLDER/bin/compile-messages.py script from the folders described above (project root for views and templates and webmore app folder for javascripts).

References