简体   繁体   English

django的makemessages在哪里保留--all选项的语言环境列表

[英]Where does django's makemessages keep the list of locales for --all option

Django's manage.py makemessages function can be used with the option --all (or -a), which makes po files for all the locales that have been previously given to makemessages as -l options. Django的manage.py makemessages函数可以与--all(或-a)选项一起使用,该选项为先前作为-l选项提供给makemessages的所有语言环境生成po文件。 Does anyone know where does makemessages get this list? 有谁知道makemessages在哪里获得此列表? I know it's not from the LANGUAGES tuple in the project settings module because locale folders for languages in there only show up after I explicitly add them at least once with makemessages -l <locale> . 我知道它不是来自项目设置模块中的LANGUAGES元组,因为其中的语言环境文件夹仅在我使用makemessages -l <locale>显式添加至少一次之后才会显示。

it does take the locales from LANGUAGES in settings.py 它确实从settings.py中的LANGUAGES获取LANGUAGES环境

if you makemessages -all or makemessages -a , it creates locale folders for ALL languages which are given in LANGUAGES 如果您makemessages -allmakemessages -a ,它将为LANGUAGES中给出的所有语言创建语言环境文件夹

Quote from docs: 来自文档的报价:

Use the --all or -a option to update the message files for all available languages.

in Django, as far as I know, all available languages can be only given thru LANGUAGES in settings.py 据我所知,在Django中,只能通过settings.py中的LANGUAGES来指定all available languages

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM