Project

General

Profile

User interface translations

This page provides details for developers, instructions for contributors can be found here.

The user interface was designed with internationalization and localization in mind. Translation are mostly done with gettext but there are exceptions:
  • Translations for CIDOC classes and properties are taken from their specification which is stored in i18n tables in the model schema of the database
  • JavaScript translations either:
    • from their own libraries, e.g. openatlas/static/vendor/jquery_validation_plugin
    • or also via gettext, see e.g. openatlas/templates/util/translations.html

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.

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.

Translating a language the first time

For adding new languages the workflow is slightly different.
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

Also available in: PDF HTML TXT