Skip to content

Translations

Juan Gallostra edited this page May 20, 2020 · 1 revision

Translations

Documentation: https://pythonhosted.org/Flask-Babel/

Add new language

  1. Open config.py and add the desired language locale to the LANGUAGES list.
  2. Create the language catalog: $ pybabel init -i messages.pot -d translations -l [LOCALE], where [LOCALE] should be replaced by the new locale.

Extracting/Updating translations

To extract all the texts that are to be translated to the .pot file use the following command: $ pybabel extract -F babel.cfg -k _l -o messages.pot .

To update all catalogs with the latest set of messages: $ pybabel update -i messages.pot -d translations

Compile translations

After all translations have been added or updated in the respective .po files (found under translations/[LOCALE]/LC_MESSAGES/messages.po), to make the changes effective the translations have to be recompiled. This is achieved with the following command: $ pybabel compile -d translations

Development

Environment Setup

Adding Areas and Sectors

New Zone

New Sector

Extras

Translations

Clone this wiki locally