User interface translations

The user interface was designed with internationalization and localization in mind. Translation are mostly done with gettext but there are exceptions:

Translations via gettext

Labels and texts are stored in language specific gettext files located in openatlas/translations. These files can be created or edited with e.g. Poedit even by "non programmers".
Because the OpenAtlas team can only provide English and German translations, offers to add other translations are always welcome.

Current translations

Workflow

Update translations

These commands scan the code base and update the language files.

pybabel extract -F openatlas/translations/babel.cfg -k lazy_gettext -o openatlas/translations/messages.pot .
pybabel update -i openatlas/translations/messages.pot -d openatlas/translations

Once updated the language files can be used with Poedit to add/update translations.

Via GitHub pull request

Only the first time When updating

Additional information

Translating the first time

WARNING existing translations will be deleted! In this example with the de parameter for German at the end of the second command:

pybabel extract -F openatlas/translations/babel.cfg -k lazy_gettext -o openatlas/translations/messages.pot .
pybabel init -i openatlas/translations/messages.pot -d openatlas/translations -l de

Location of strings to be translated

Most of the strings to be translated are in the Python and HTML source code marked with an underline function, like e.g.

_('actor')

The Python/JavaScript "switch" for translation needed for JavaScript components is located at openatlas/templates/util/translations.html.

Exception being JavaScript translations for 3rd party code located in openatlas/static/vendor, see README in sub folders there for more details.