makemessages for an app installed in virtualenv

女生的网名这么多〃 提交于 2019-11-29 12:55:51

问题


I've installed a Django App to my virtualenv, and I would like to add extra translations to that App.

Is it possible to import the messages from an app installed in a virtualenv to my django.po in my project's locale/pt/LC_MESSAGES folder?

Alternatively, should I translate the 3rd party app? If so, how can I use makemessages to generate the messages in the app installed in the virtualenv?


回答1:


Within my project directory I make a (temporary) symlink to the app in my virtualenv and then I run the makemessages command like:

../manage.py makemessages -l nl --symlinks

After the *.po files is created I remove the symlink..




回答2:


You should probably add translations to the 3rd party app, provided they're general enough for others to re-use.

You'll want to pip install a fork of the 3rd party app's repository, with something like this (assuming git and GitHub):

pip install -e git://github.com/{{ username }}/{{ reponame }}.git

Commit and push your changes, then submit a pull request to the original repository.



来源:https://stackoverflow.com/questions/17837149/makemessages-for-an-app-installed-in-virtualenv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!