Django MakeMessages missing xgettext in Windows
Asked Answered
U

1

12

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.

Uvula answered 30/9, 2011 at 14:57 Comment(0)
P
16

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

Padriac answered 30/9, 2011 at 15:36 Comment(3)
The gettext for win32 project is out of date. Their latest version is 0.13.xxx and django requires at least 0.15.xUvula
Downloaded and set it to Path, set all programs to win xp compatiblity mode and to run as admin. Ran makemessages and it worked like a charm. I had almost given up after spending nearly 8 hours on this today. Thanks and /hug!Uvula
On Win7x64 I have to put xgettext.exe and gettext.exe to win xp compatiblity mode.Smallman

© 2022 - 2024 — McMap. All rights reserved.