Django makemessages does not create new languages ​​added

I had 12 languages ​​in my Django application if I ran the command:

python manage.py makemessages --all 

It would create all 12.po files for languages, now I added 3 more languages:

 LANGUAGES = ( ... ('th', gettext('Thai')), ('tl', gettext('Tagalog')), ('vi', gettext('Vietnamese')), ) 

when I run the makemessages --all command, it just skips three new languages. Did I miss something?

Edit: Perhaps the documentation is hard to understand:

makemessages

django-admin makemessages

Starts the entire source tree of the current directory and pulls out all lines marked for translation. It creates (or updates) the message file in conf / locale (in the Django tree) or locale (for the project and application). After making changes to the message files needed to compile them using compilation for use with the built-in gettext support. See i18n Documentation for details.

+5
source share
1 answer

You need to specify the languages ​​that interest you for the first time on the command line.

 python manage.py makemessages -l th -l tl -l vi 

After that, subsequent calls with the --all flag will generate PO files for all languages.

+9
source

Source: https://habr.com/ru/post/1200234/


All Articles