Skip to content

Internationalisation

Ismail Sunni edited this page Mar 18, 2018 · 3 revisions

Internationalisation

Requirements

  • Account in transifex.com
  • transifex-client installed in development machine (perhaps put it in docker 😄 also)
  • Set up you transifex client properly (see: ~/.transifexrc)

Internationalisation Workflow

  1. Mark string to be translated:
    1. In Python code: _('string')
    2. Simple text in a template: {% trans 'simple string' %}
    3. Complex text in a template: {% blocktrans with title=module.title %}Complex {{ title }} {% endblocktrans %}
  2. Run make update-translation-strings to retrieve all string in the project to .po file. For some reason, this takes a long time 😢.
  3. Run push-translation-source to push the string and the translation to transifex.
  4. Translate in transifex.
  5. Run pull-translation-source to pull the string and the translation from transifex.
  6. Run make compile-translation-strings to compile the string to .mo file. This will make Django able to find the translation.

Notes:

  1. Pull and push needs transifex account that has access to Projecta Transifex Project
  2. We don't put the .po files in the repository. We will need to run it everytime we deploy on the server.

Clone this wiki locally