From e818792895df79895340dd32ed4dafaa8a6d2c96 Mon Sep 17 00:00:00 2001 From: sireus Date: Mon, 24 Oct 2011 15:27:52 +0000 Subject: [PATCH] the problem is not the second setlocale, but rather where I put it git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6672 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/i18n.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source/src/i18n.cpp b/source/src/i18n.cpp index d9a49e89..b22a5257 100644 --- a/source/src/i18n.cpp +++ b/source/src/i18n.cpp @@ -6,13 +6,6 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(domain), basepath(basepath) { locale = setlocale(LC_ALL, ""); // use current default locale - // C forbids multiple locales, sireus - the line you put it messed up the locale var completely - flowtron got this output: - // current locale: packages/locale (pa) - // see this mail: http://www.sourceware.org/ml/binutils/2000-06/msg00024.html - // I noticed that problem with e.g. zoom-factor - my workaround was to put it into a division-call, instead of as a constant; works regardless of seperator - // but this won't necessarily work in all cases, the mail I linked talks about implementing replacement functions that mimick the C-locale. - // so .. this gets marked: FIXME - //setlocale(LC_NUMERIC, "C"); // make sure numeric is consistent (very important for float usage in scripts) bindtextdomain(domain, basepath); // set base path textdomain(domain); bind_textdomain_codeset(domain, "UTF-8"); // we use the utf-8 charset only @@ -25,8 +18,11 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(doma #endif filterlang(lang, lang); alias("LANG", lang); - printf("current locale: %s (%s)\n", locale, lang); + + setlocale(LC_NUMERIC, "C"); // make sure numeric is consistent (very important for float usage in scripts) + // Note to self: only do this _after_ using the return value from the previous + // setlocale call - this one will overwrite it } // export gettext to cubescript