django makemessages问题

use*_*774 0 python django translation

我在Windows 7上运行python 2.7和django 1.8.11。

添加必要的翻译字符串文字后,我正在尝试翻译我的网站。我已按照docs的指示进行操作。这包括以正确的语言代码安装适用于Windows 7的GNU gettext实用程序和必要的语言环境文件夹/目录。

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

django-admin makemessages -l de
Run Code Online (Sandbox Code Playgroud)

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

CommandError: Unable to find a locale path to store translations for file fabfile.py
Run Code Online (Sandbox Code Playgroud)

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

在此处输入图片说明

我尝试(暂时)fabfile.py从目录中删除。尝试此操作时,运行时收到的错误消息django-admin makemessages -l de是:

CommandError: Unable to find a locale path to store translations for file manage.py
Run Code Online (Sandbox Code Playgroud)

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

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

use*_*774 5

我不确定如何或为什么,但是当我昨天尝试此操作时,它不起作用,但现在起作用了。非常沮丧。

我必须在项目根目录中再运行一个makemessages命令目录。

我希望这可以帮助某个人。