[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems using gettext on Windows
From: |
Joerg Henrichs |
Subject: |
Problems using gettext on Windows |
Date: |
Tue, 08 Mar 2011 22:07:01 +1100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 |
Hi,
I've been using gettext for a while in the game 'SuperTuxKart', and so
far it has been working fine.
It was only when I tried to give the user the option to change the
language from within the application, that I got problem on Windows:
setting LANGUAGE inside of supertuxkart and then re-initialising (or
even initialising for the first time) gettext does not work, I am still
getting the original language (for the record, it works fine on Linux
and Mac, and I can change the language before starting supertuxkart on
Windows by setting LANGUAGE as expected).
I am using libiconv-1.9.1.bin.woe32.zip and
gettext-runtime-0.13.1.bin.woe32.zip.
Reading your FAQ this is apparently a known issue, and I have tried to
follow your recommendations there:
All components I compile from scratch are compiled and linked with /MD
(multithreaded dll) - but supertuxkart depends on several other
libraries (irrlicht, alut, ogg, vorbis, libcurl, ...) which are outside
of my control. Not sure if they might interfere with anything.
To set LANGUAGE I tried using:
bool r1=SetEnvironmentVariableA("LANGUAGE", "de");
bool r2=SetEnvironmentVariableW(L"LANGUAGE", L"de");
bool r3=SetEnvironmentVariable ("LANGUAGE", "de");
int r4=putenv("LANGUAGE=de");
int r5=_putenv("LANGUAGE=de");
(I tried everything I could think of ;) ) before initialising gettext.
But still the language in the game doesn't change.
I can confirm that apparently gettext is not calling the right getenv
function (I set a breakpoint in getenv, and I can see that it gets
called from supertuxkart and libcurl - but not from gettext). So I think
your reason in the FAQ is still correct, but I don't know why a gettext
should be using a different library to resolve getenv.
Any recommendations what I could do to fix this issue?
Thanks a lot for your time!
Joerg
PS: Not sure if this is related: I have also problems using fprintf with
gettext - it just crashes with
Access violation writing location 0x00000010.
the first time a fprintf is done. I worked around this by adding a
#undef fprintf
after including libintl.h (which re-defines fprintf). Perhaps this might
be somehow related to the above issue?
- Problems using gettext on Windows,
Joerg Henrichs <=