pot
file not for translations, it just list of all strings for translation without specific language.
For real translations used po
- text file and mo
- binary file with translations. This files will created for any languages that you need. See my files structure:
translations/
translations/ru/
translations/ru/LC_MESSAGES/
translations/ru/LC_MESSAGES/messages.mo
translations/ru/LC_MESSAGES/messages.po
translations/messages.pot
To get all strings for translation:
pybabel extract -F babel.cfg -o messages.pot .
To init po
file (first time):
pybabel init -i messages.pot -d . -l ru
To update exist po
file:
pybabel update -i messages.pot -d .
To compile po
file to mo
:
pybabel compile -f -d .
See more in documentation.