Django MakeMessages missing xgettext in Windows

元气小坏坏 提交于 2019-12-03 12:00:43

问题


Running Django on Windows 7.

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:

Error: errors happened while running xgettext on init.py 'xgettext' is not recognized as an internal or external command, operable program or batch file.

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.

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.


回答1:


please see http://code.djangoproject.com/ticket/1157. you do not need cygwin. try these files: http://sourceforge.net/projects/gettext/files/

EDIT:

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

the above links are from this thread: http://groups.google.com/group/django-i18n/browse_thread/thread/577afdaef1392958?pli=1



来源:https://stackoverflow.com/questions/7612259/django-makemessages-missing-xgettext-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!