Django MakeMessages在Windows中缺少xgettext [英] Django MakeMessages missing xgettext in Windows
问题描述
在Windows 7上运行Django。
Running Django on Windows 7.
我正在尝试使用django第19章中的说明翻译几个Django模板。向模板添加了一个翻译标签,加载了I18N和修改的django设置。然后我运行django-admin.py makemessages -l zh创建po文件。所有文件夹都被创建,但是django终止并出现以下错误:
I'm currently trying to translate a couple of Django templates using the instructions found in the django book chapter 19. I've added a translation tag to the template, loaded I18N, and modified django settings. Then I run django-admin.py makemessages -l en to create the po files. All folders are created but then django terminates with the following error:
错误:在 init 上运行xgettext时发生错误.py
'xgettext'不被识别为内部或外部命令,
可操作的程序或批处理文件。
Error: errors happened while running xgettext on init.py 'xgettext' is not recognized as an internal or external command, operable program or batch file.
阅读问题,我发现django使用gnu gettext库为基于unix的系统。为了解决这个问题,我安装了cygwin,它下载并安装了我添加到我的PATH中的gettext包版本0.18.1.0。可悲的是,没有解决任何问题。 Cygwin没有添加任何xgettext文件。
Reading up on the problem, I've discovered that django uses the gnu gettext library for unix based systems. To remedy this I installed cygwin which downloaded and installed the gettext package version 0.18.1.0 which I then added to my PATH. Sadly that did not solve anything. Cygwin did not add any xgettext files whatsoever.
我的问题现在是这样。有没有一个简单的方法(或教程)来安装xgettext,其他功能django的国际化将需要Windows 7 ,而不必下载大量的各种gnu软件包。 Django迄今一直非常出色,尽量减少不必要的困难,这些突然的困难根本不是django的特征。
My question is now this. Is there an easy way (or a tutorial) to install xgettext and the other functionality django's internationalization will require on Windows 7 without having to download a ton of assorted gnu packages. Django has been excellent so far in minimizing unnecessary hardships and these sudden difficulties are not characteristic of django at all.
推荐答案
请参阅< a href =http://code.djangoproject.com/ticket/1157 =noreferrer> http://code.djangoproject.com/ticket/1157 。你不需要cygwin。尝试这些文件: http://sourceforge.net/projects/gettext/files/
please see http://code.djangoproject.com/ticket/1157. you do not need cygwin. try these files: http://sourceforge.net/projects/gettext/files/
编辑:
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-tools-0.17.zip
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-0.17-1.zip
以上链接来自此线程: http ://groups.google.com/group/django-i18n/browse_thread/thread/577afdaef1392958?pli = 1
the above links are from this thread: http://groups.google.com/group/django-i18n/browse_thread/thread/577afdaef1392958?pli=1
这篇关于Django MakeMessages在Windows中缺少xgettext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!