From 22a59b3912ff5e7bb1516faa06f1841545a8117c Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 3 Nov 2013 17:28:16 +0100 Subject: Fix win32/msvc i18n (quite UGLY version, blame Microsoft) --- src/main.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 455138d5b..ea66f1334 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -750,20 +750,6 @@ int main(int argc, char *argv[]) log_add_output_all_levs(&main_dstream_no_stderr_log_out); log_register_thread("main"); - - // This enables internatonal characters input - if( setlocale(LC_ALL, "") == NULL ) - { - fprintf( stderr, "%s: warning: could not set default locale\n", argv[0] ); - } - - // Set locale. This is for forcing '.' as the decimal point. - try { - std::locale::global(std::locale(std::locale(""), "C", std::locale::numeric)); - setlocale(LC_NUMERIC, "C"); - } catch (const std::exception& ex) { - errorstream<<"Could not set numeric locale to C"<get("language"),argc,argv); #else - char *lang_str = (char*)calloc(10 + language.length(), sizeof(char)); - strcat(lang_str, "LANGUAGE="); - strcat(lang_str, language.c_str()); - putenv(lang_str); + init_gettext((porting::path_share + DIR_DELIM + "locale").c_str(),g_settings->get("language")); #endif - } /* Game parameters -- cgit v1.2.3