-
Notifications
You must be signed in to change notification settings - Fork 18
Translations
We have a few different management commands to create, compile, push and pull translations. Most of the commands are in the tenant-extras repo. The makepo command has been extended (makepo_ext) in the reef repo to also include themes, countries, skills etc in generated po file.
We are using the transifex service to push our po files for translating. After translating the po files are pulled during deployment and compiled for use by Django.
No po/mo files should be stored in the repo. The authoritative source for translations is the transifex website. When we need to push new translatable strings to transifex then we run this from the latest reef branch (NOTE: always merge the latest production code into the branch before running):
./manage.py txtranslate -d makepo_ext -p
makepo_ext is the extended makepo command which also includes database fields, eg country, skills etc. As it is accessing the database the command should only be run after running the loaddata commands to populate the database with fixtures.
The -p argument tells the command to push the generated po files to transifex. This will only work if transifex has been setup: http://docs.transifex.com/developer/client/config.
To pull the latest translations for all tenants use:
./manage.py txpull --all
or, for a single tenant:
./manage.py txpull --tenant=TENANT
The Django "trans" or "_" helpers use translations from the "django" gettext domain. When the translations are generated or pulled there will be a django.po file generated per tenant per language.
To compile the translations to test them locally, or when deploying to a server then the following commands need to be run:
./manage.py compilepo