-
-
Notifications
You must be signed in to change notification settings - Fork 28
Internationalisation
Ismail Sunni edited this page Mar 18, 2018
·
3 revisions
- Account in transifex.com
-
transifex-clientinstalled in development machine (perhaps put it in docker 😄 also) - Set up you transifex client properly (see:
~/.transifexrc)
- Mark string to be translated:
- In Python code:
_('string') - Simple text in a template:
{% trans 'simple string' %} - Complex text in a template:
{% blocktrans with title=module.title %}Complex {{ title }} {% endblocktrans %}
- In Python code:
- Run
make update-translation-stringsto retrieve all string in the project to .po file. For some reason, this takes a long time 😢. - Run
push-translation-sourceto push the string and the translation to transifex. - Translate in transifex.
- Run
pull-translation-sourceto pull the string and the translation from transifex. - Run
make compile-translation-stringsto compile the string to .mo file. This will make Django able to find the translation.
Notes:
- Pull and push needs transifex account that has access to Projecta Transifex Project
- We don't put the .po files in the repository. We will need to run it everytime we deploy on the server.