How to install GNU gettext on windows 7?

2019-02-03 09:38发布

问题:

I need to install version 0.15 or higher of GNU's gettext so that I can use some i18n feateres with django.

I've downloaded :

http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz

from https://www.gnu.org/software/gettext/

However I have no idea how to install it and there's no installation guide on their website. How can I install it ?

回答1:

I'm maintaining a GitHub repository with Windows binaries of gettext and iconv (I just updated it to the latest gettext version: 0.19.3)

You can find it here: http://mlocati.github.io/gettext-iconv-windows/

To see how I compiled them (if you want to do it yourself) take a look at https://github.com/mlocati/gettext-iconv-windows



回答2:

For windows, you may:

  1. download gettext from http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/;
  2. unzip both gettext-runtime and gettext-tools
  3. add the bin folder to to PATH

Django docs - https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#gettext-on-windows



回答3:

There are a lot of versions, this is what I've downloaded:

http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip

And: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-tools-dev_0.18.1.1-2_win32.zip

And added both bin folders to the Windows PATH.



回答4:

This is the actual link pointing to the Windows installation: http://mlocati.github.io/gettext-iconv-windows/ (v. 0.19.4)

I spent quite a while before found that there is the link pointing their from the github project mentioned by mlokati.

P.S. Here is the official instruction on this from the Django docs: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#gettext-on-windows



回答5:

You can use tools from that NuGet package https://www.nuget.org/packages/Gettext.Tools/