From 1cad731f069c2fb5abba69a1e912b4e2ad145e4d Mon Sep 17 00:00:00 2001 From: flowtron Date: Mon, 17 Oct 2011 21:38:04 +0000 Subject: [PATCH] avoid mucking up locale - C allows only one! git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6668 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/i18n.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/src/i18n.cpp b/source/src/i18n.cpp index 16324c30..d9a49e89 100644 --- a/source/src/i18n.cpp +++ b/source/src/i18n.cpp @@ -6,7 +6,13 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(domain), basepath(basepath) { locale = setlocale(LC_ALL, ""); // use current default locale - setlocale(LC_NUMERIC, "C"); // make sure numeric is consistent (very important for float usage in scripts) + // 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 @@ -17,7 +23,6 @@ i18nmanager::i18nmanager(const char *domain, const char *basepath) : domain(doma #else copystring(lang, locale, 3); #endif - filterlang(lang, lang); alias("LANG", lang);