Author: ilor
Date: Sat Mar 28 14:40:06 2009
New Revision: 34210

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34210&view=rev
Log:
Do not call setlocale with LC_ALL on windows when trying to set the unavailable 
on win32 LC_MESSAGES, instead just return. Also only set LANG env var when 
setting LC_MESSAGES and never set the LC_ALL var. This fixes the units not 
submerging bug and possibly more issues as floats will now load correctly 
regardless of locale.

Modified:
    trunk/src/language.cpp

Modified: trunk/src/language.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/language.cpp?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- trunk/src/language.cpp (original)
+++ trunk/src/language.cpp Sat Mar 28 14:40:06 2009
@@ -210,17 +210,15 @@
 #endif
 
 #ifdef _WIN32
-       std::string env = "LANG=" + slocale;
-       _putenv(env.c_str());
-       env = "LC_ALL=" + slocale;
-       _putenv(env.c_str());
        std::string win_locale = locale;
        win_locale = win_locale.substr(0,2);
        #include "language_win32.ii"
-       SetEnvironmentVariable("LANG", win_locale.c_str());
-       SetEnvironmentVariable("LC_ALL", win_locale.c_str());
-       if(category == LC_MESSAGES)
-           category = LC_ALL;
+       if(category == LC_MESSAGES) {
+               std::string env = "LANG=" + slocale;
+               _putenv(env.c_str());
+               SetEnvironmentVariable("LANG", win_locale.c_str());
+               return;
+       }
        locale = win_locale.c_str();
 #endif
 
@@ -296,6 +294,10 @@
                          << locale << "'.\n";
        else
                LOG_GENERAL << "set locale to '" << (try_loc.get()) << "' 
result: '" << res <<"'\n";
+
+       DBG_GENERAL << "Numeric locale: " << std::setlocale(LC_NUMERIC, NULL) 
<< '\n';
+       DBG_GENERAL << "Full locale: " << std::setlocale(LC_ALL, NULL) << '\n';
+
 }
 
 bool set_language(const language_def& locale)


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to