Translations » History » Revision 6
Revision 5 (Alexander Watzinger, 2023-01-05 14:36) → Revision 6/9 (Alexander Watzinger, 2023-01-23 17:34)
h1. Translations
The user interface was designed with internationalization and localization in mind. Labels and texts are stored in language specific "gettext":https://en.wikipedia.org/wiki/Gettext files located in openatlas/translations.
These files can be created or edited with e.g. "Poedit":https://en.wikipedia.org/wiki/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.
h2. 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.
h2. Update translations
<pre>
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
</pre>
h2. 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":https://github.com/craws/OpenAtlas/tree/main/openatlas/translations/en/LC_MESSAGES
h2. 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:
<pre>
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
</pre>
h2. 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.
<pre>
_('actor')
</pre>
The Python/JavaScript "switch" for translation needed for JavaScript components are located at *openatlas/templates/util/translations.html*.
Only exception being (non English) jQuery validation messages which are located at *openatlas/static/js/* and named e.g. *messages_de.js*.
More of these can be found at "jquery-validation ":https://github.com/jquery-validation/jquery-validation/tree/master/src/localization at GitHub.
The user interface was designed with internationalization and localization in mind. Labels and texts are stored in language specific "gettext":https://en.wikipedia.org/wiki/Gettext files located in openatlas/translations.
These files can be created or edited with e.g. "Poedit":https://en.wikipedia.org/wiki/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.
h2. 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.
h2. Update translations
<pre>
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
</pre>
h2. 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":https://github.com/craws/OpenAtlas/tree/main/openatlas/translations/en/LC_MESSAGES
h2. 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:
<pre>
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
</pre>
h2. 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.
<pre>
_('actor')
</pre>
The Python/JavaScript "switch" for translation needed for JavaScript components are located at *openatlas/templates/util/translations.html*.
Only exception being (non English) jQuery validation messages which are located at *openatlas/static/js/* and named e.g. *messages_de.js*.
More of these can be found at "jquery-validation ":https://github.com/jquery-validation/jquery-validation/tree/master/src/localization at GitHub.