我正在尝试生成用于翻译我的 JS 字符串的 JS 目录。
按照文档,我正在尝试
$ 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
$
失败了,但是 makemessages 适用于 django 域。
最佳答案
问题是没有要翻译的字符串(错误消息可能会更好!)。添加一个可翻译的字符串(例如 {% trans 'dummy' %}
)修复了它。
另一个问题可能是过时的 gettext 版本,尝试升级它:
apt-get install gettext
关于javascript - 无法生成 django javascript i18n 目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20802624/