Gettext on windows

I just thought it might be worth to keep my experience with trying to get gettext to work with windows somewhere. I tried to find a ready-to-go binary package that can be used, instead of compiling gettext from scratch ... hoping that it would save me some time.

Contents

http://gnuwin32.sourceforge.net/packages/gettext.htm

With this version I can't get fprintf to work, every fprintf just crashes. Reason is that gettext supplies its own version of *printf (see gettext documentation for details). Using #undef fprintf after including libintl.h works, but I am too scared of other hidden problems.

http://freenet-homepage.de/franco.bez/gettext/gettext_win32.html

This version does not supply any LC_ constants, and I couldn't get the included examples to work - some complain about missing gettext_putenv, and I couldn't get the one example that would link to do any actual translations (though that might be a setup problem, it came with makefiles for windows, i.e. a lot of \\ and REM for comments :(

Compiling from sources

Not too much luck here either. gettext is compiled with mingw, and needs libiconv. In libiconv-1.12 some files are missing (woe32_dll), libiconv-1.11 compiles, but "make install" failed because of an undefined reference to ___cpu_features_int. I tried then to use the cygwin iconv.h file for mingw, and it compiled a bit further before failing with ".../.libs/libcroco_rpl.a" is missing - strangely enough, that file actually exists, and if I try executing link line manuall, I am back to the ___cpu_features_int - bug. I am giving up at this stage, and trying more precompiled versions.

http://sourceforge.net/project/showfiles.php?group_id=7382

Tried first compiling gettext from source after installing libiconv from here, same results as above. So am now trying libiconv and gettext from this repository.

Outlook

Work in progress - http://www.gimp.org/win32/, http://sourceforge.net/projects/mingwrep/, compilation from source ...

--Hiker 15:34, 27 February 2008 (PST)

Result

We used the official windows binary from gettext ('woe32') for a while, and they worked (we had to #undef fprintf, since it would keep on crashing). But it all fell apart once we tried to change the language inside of the game (on windows, it worked fine on Mac and Linux). While there is an gettext FAQ item explaining this, the solutions outlined there didn't work for us. After trying various things (including self compiling gettext with mingw, contacting the gettext email list, which tried to help but couldn't solve our problems), we completely gave up on gettext and decided to use tinygettext (https://code.google.com/p/tinygettext/) instead, which only needed some minor changes to work in our environment. We now also don't need the 'compiled' mo files anymore, since tinygettext works directly on the plain text po files.

Quiet annoying that an open source project such as gettext completely drops support for Windows imho.

Retrieved from "http://supertuxkart.sourceforge.net/Gettext_on_windows"

User Tools