开发者

Django internationalization files in apps folders

开发者 https://www.devze.com 2023-03-15 17:06 出处:网络
Is it possible to create separate *.mo and *.po files for every application? Lets say that I add new external app to my project and I dont want to localize it but use some translations开发者_运维技巧

Is it possible to create separate *.mo and *.po files for every application? Lets say that I add new external app to my project and I dont want to localize it but use some translations开发者_运维技巧 which, are contained in it.


In short - yes, it's possible and recommended (it helps keeping order in the translations). Simply:

  1. Execute manage.py makemessages in the root directory of your Django app to create .po/.mo files for that particular app.
  2. Store the translation files will be in stored in $APPPATH/locale/<language>/LC_MESSAGES/django.(po|mo) directory (so inside the app directory).
0

精彩评论

暂无评论...
验证码 换一张
取 消