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
This commit is contained in:
flowtron
2011-10-17 21:38:04 +00:00
parent df32d72c54
commit 1cad731f06
+7 -2
View File
@@ -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);