Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
927 views
in Technique[技术] by (71.8m points)

python - How to install gnu gettext (>0.15) on windows? So I can produce .po/.mo files in Django

When runing django make messages:

./manage.py makemessages -l pt

I get:

CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.

I tried to install but the last version I find with an Instalation Setup is 0.14. Where may I find a recent version and how do I install it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Django removed this explanation from the recent docs and it took me some time to found it so i pasted it here before this old documentation goes offline:

Source: Django Docs 1.7

Download the following zip files from the GNOME servers

  • gettext-runtime-X.zip
  • gettext-tools-X.zip

X is the version number (It needs to be 0.15 or higher)

Extract the contents of the bin directories in both files to the same folder on your system (i.e. C:Program Filesgettext-utils)

Update the system PATH:

Control Panel > System > Advanced > Environment Variables

In the System variables list, click Path, click Edit and then New. Add C:Program Filesgettext-utilsin value.

You may also use gettext binaries you have obtained elsewhere, so long as the xgettext --version command works properly. Do not attempt to use Django translation utilities with a gettext package if the command xgettext --version entered at a Windows command prompt causes a popup window saying “xgettext.exe has generated errors and will be closed by Windows”.

After doing this I tested and ./manage.py makemessages -l pt works


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...