简体   繁体   English

django-admin makemessages =>用我的翻译所有django包

[英]django-admin makemessages => translate all django package with mine

i am currently trying to start translation on a website. 我目前正在尝试在网站上开始翻译。 the isue is that django makemessages utilitie nicely generate le PO file but he include ALL the django package to translate. 问题是django makemessages utilitie很好地生成le PO文件,但他包含所有django包来翻译。 with 10 sentance in my website, i have 5370 lines in my po file. 在我的网站上有10个发送,我的po文件中有5370行。

i am working with virtualenv,django 1.3, python 2.6 我正在使用virtualenv,django 1.3,python 2.6

trace of my actions : 追踪我的行为:

mkdir locale
django-admin.py makemessages -l en

the po file start with po文件以。开头

  20 #: env_website/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django  /conf/global_settings.py:44
  21 msgid "Arabic"
  22 msgstr ""

my question is : what have i done wrong and how to exclude the django package ? 我的问题是:我做错了什么以及如何排除django包?

makemessages should be run from either the project root or application root. makemessages应该从项目根目录或应用程序根目录运行。 It will walk through the source tree to find strings marked for translation. 它将遍历源树以查找标记为要翻译的字符串。 If you have directories you want to avoid use the --ignore option. 如果您有目录,则要避免使用--ignore选项。

Example from the docs: 来自文档的示例:

django-admin.py makemessages --locale=en_US --ignore=apps/* --ignore=secret/*.html

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

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