django makemessages 问题

django makemessages issue

我是 运行宁 python 2.7 和 Windows 7.

上的 django 1.8.11

添加必要的翻译字符串文字后,我正在尝试翻译我的网站。我已按照 docs. This includes installing the GNU gettext utilities for windows 7 的说明和正确语言代码的必要语言环境 folders/directories 进行操作。

在我项目根目录的虚拟环境&命令提示符下,我运行:

django-admin makemessages -l de

我在命令提示符下收到以下错误:

CommandError: Unable to find a locale path to store translations for file fabfile.py

在我的项目的根目录中,我有以下文件,这是 fabfile.py 所在的位置:

我已经尝试(暂时)从目录中删除 fabfile.py。当我尝试这样做时,我在 运行ning django-admin makemessages -l de 时收到的错误消息是:

CommandError: Unable to find a locale path to store translations for file manage.py

看来 makemessages 命令包含根目录中的所有 .py.txt 文件。我不确定这是不是正确的程序。

当我 运行 makemessages 命令时,如何不在项目的根目录中包含 .py 和 .txt 文件?

我不确定如何或为什么,但当我昨天尝试时,它没有用,但现在可以用了。很郁闷。

我必须 运行 makemessages 命令 我的项目根目录中的一个额外目录。

我希望这对那里的人有所帮助。

您必须在 fabfile.py 和 manage.py 的文件夹中 mkdir locale。