[英]Unable to generate django javascript i18n catalog
I am trying to generate the JS catalog for translating my JS strings. 我正在尝试生成用于翻译我的JS字符串的JS目录。
Folowing the docs, I am trying 关注文档,我正在尝试
$ django-admin.py makemessages -d djangojs -l de
processing locale de
CommandError: errors happened while running msguniq
msguniq: error while opening "[project_root]/locale/djangojs.pot" for reading: No such file or directory
$ man msguniq
$ django-admin.py makemessages -d django -l de
processing locale de
$
Which fails, but makemessages works for django domain. 失败,但makemessages适用于Django域。
The problem was that there was no string to be translated (the error message could be better!). 问题是没有要翻译的字符串(错误消息可能会更好!)。 Adding a translatable string (eg
{% trans 'dummy' %}
) fixed it. 添加可翻译的字符串(例如
{% trans 'dummy' %}
)将其固定。
Another problem could be outdated gettext version, try upgrading it: 另一个问题可能是gettext版本过时,请尝试升级它:
apt-get install gettext
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.