Skip to content

Translation of the TQ website

Renato Bellotti edited this page Apr 27, 2018 · 11 revisions

Related documentation

Use the trans tag in HTML sites for django: https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#trans-template-tag

What to do

Essentially, you have to run two scripts:

scripts/makemessages.sh
scripts/compilemessages.sh

Manual way (deprecated for our project)

Run django-admin makemessages -a to create the .po files.

Works only with gettext installed, see below for installation

then after you've updated the German text in the .po file you can run

django-admin compilemessages

to compile the language files.

Check in the language files as well, we don't compile a second time on the live server

Please use English as the default language and then add German translations.

Mac install gettext

  1. brew install gettext in Terminal and then
  2. brew link gettext --force to make it work ;)

Generate new binary files (.mo) after changing ASCII file (.po)

docker-compose run --rm django python3 manage.py compilemessages