From d57bf8dbc6b035b2c0306fbc113a2880d9c50984 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Mon, 13 Aug 2007 10:20:01 +0000 Subject: Fixed internationalization support on Windows. --- ChangeLog | 4 ++++ src/main.cpp | 5 +++++ tmw.cbp | 35 +++++++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c966db60..b28cec0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-13 Eugenio Favalli + + * src/main.cpp, tmw.cbp: Fixed internationalization support on Windows. + 2007-08-10 Guillaume Melquiond * src/gui/npclistdialog.cpp, src/gui/npclistdialog.h, diff --git a/src/main.cpp b/src/main.cpp index 9a51f2e4..67086f9f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -650,6 +650,8 @@ void initXML() xmlSetGenericErrorFunc(NULL, xmlNullLogger); } +extern "C" char const *_nl_locale_name_default(void); + /** Main */ int main(int argc, char *argv[]) { @@ -668,6 +670,9 @@ int main(int argc, char *argv[]) } #if ENABLE_NLS +#ifdef WIN32 + putenv(("LANG=" + std::string(_nl_locale_name_default())).c_str()); +#endif setlocale(LC_MESSAGES, ""); bindtextdomain("tmw", LOCALEDIR); bind_textdomain_codeset("tmw", "UTF-8"); diff --git a/tmw.cbp b/tmw.cbp index 9557d506..12e92c78 100644 --- a/tmw.cbp +++ b/tmw.cbp @@ -20,6 +20,8 @@ + + @@ -39,6 +41,7 @@ + @@ -1020,16 +1023,6 @@