在Django中翻译文件时的Git命令 [英] Git command when translating files in Django

查看:52
本文介绍了在Django中翻译文件时的Git命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Django中已有一个应用程序.我想在页面上添加翻译.在页面上,我有:

I have an existing application in Django. I want to add a translation on the page. On page I have:

{% trans 'Projects'%}

在.po文件中我添加了:

In .po file I added:

#: templates/staff/site.html: 200
msgid "Projects"
msgid "Projekty"

然后执行命令:

django-admin.py compilemessages -l pl

执行此命令后,出现错误:

After this command, I get an error:

CommandError: This Should Be Run script from the Django Git checkout or your project or app tree, or with the settings Specified module.

推荐答案

该错误包含答案,您可能在任何地方运行脚本,因此它不知道要编译哪个文件.从项目目录运行命令或指定设置,就可以了.

The error holds the answer, you could be running the script from anywhere so it cannot know which files to compile. Run the command from the project directory or specify the settings and you should be fine.

这篇关于在Django中翻译文件时的Git命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆