The Tasking Manager is localised using our Transifex repository.
This is super easy. If you are interested, make yourself an account and apply to join the hotosm-translator
team.
Everybody is welcome to support translations through the Transifex website.
For developers, Transifex offers a CLI client and the Tasking
Manager offers commands to interact with it. The client is already included in requirements.txt
so you should have the Transifex commands installed once you have set up your backend side code.
The Tasking Manager is using Angular Translate to display the translated strings. It works with key/value pairs in .json format, which is also the format used to store the translations in Transifex.
To set up the Transifex client, you'll need a Transifex account and API key.
In the project's top level directory, initialize Transifex service: tx init
. The init process will ask for service URL
(leave the default suggestion by hitting enter) and your Transifex username/password.
The .tx folder contains the Transifex config file. This is where you can find the mappings to local translation files.
python manage.py build_locales
- Collects translatable strings and moves them intofrontend/src/locales/en.json
, and updates the new keys on the other languages supported by TM.- Push to the
develop
branch and it will be automatically picked up by Transifex (twice a day).
- Before a release new translations need to be pulled in:
tx pull -af --mode translator
- Gets all translations from Transifex and puts them intofrontend/locale
.
In this example we are adding support for German.
- Add a new .json file with the appropriate language code as the name of the file, so in this case
de.json
. - Configure local mapping by using Transifex's set command:
tx set -r tasking-manager.master -l de frontend/src/locales/de.json
- Add the new language and language code to the config file so it shows up in dropdowns etc. in backend/config.py
You can also translate locally and push the
Use Transifex's tx push -s
to push local changes to Transifex.
- Argument
-s
pushes source files (English in our case) - Argument
-t
pushes all translation files