Project

General

Profile

Actions

Translations

The user interface was designed with internationalization and localization in mind. 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 we, the OpenAtlas team, can only provide English and German translations, offers to add other translations are always welcome.

Workflow

  • Because of possible merge conflicts, translations should only be done in the develop branch and not in feature branches.
  • For adding new languages the workflow is slightly different and will be done with new branches.

Update translations

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

Additional information

  • Most source texts in the translations files are already 1:1 strings in English but sometimes, e.g. for a longer text it may differ, like for "warning no js".
  • In doubt you can always compare it to existing translations, e.g. for English in the translation folder or at GitHub

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.

Updated by Alexander Watzinger 7 days ago · 9 revisions

Also available in: PDF HTML TXT