mail[Wesnoth-commits] r34228 - in /branches/1.6: changelog src/language.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on March 29, 2009 - 10:45:
Author: silene
Date: Sun Mar 29 10:45:38 2009
New Revision: 34228

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34228&view=rev
Log:
Ported revisions 34210 34211 34227 to branch 1.6.

Modified:
    branches/1.6/changelog
    branches/1.6/src/language.cpp

Modified: branches/1.6/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/changelog?rev=34228&r1=34227&r2=34228&view=diff
==============================================================================
--- branches/1.6/changelog (original)
+++ branches/1.6/changelog Sun Mar 29 10:45:38 2009
@@ -10,6 +10,8 @@
      German, Finnish, Hebrew, Italian, Russian, Slovak, Turkish
  * General:
    * Fixed compilation with -D_GLIBCXX_PARALLEL
+   * Fixed handling of floating-point WML constants on localized Windows
+     (impacts "submerge" animations and AI settings)
  * AI:
    * Fixed incorrect handling of poisoning attacks when suggesting best 
attack 
      in user interface

Modified: branches/1.6/src/language.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/language.cpp?rev=34228&r1=34227&r2=34228&view=diff
==============================================================================
--- branches/1.6/src/language.cpp (original)
+++ branches/1.6/src/language.cpp Sun Mar 29 10:45:38 2009
@@ -197,30 +197,24 @@
 #endif
 
 #ifdef __BEOS__
-       if(setenv ("LANG", locale, 1) == -1)
+       if (category == LC_MESSAGES && setenv ("LANG", locale, 1) == -1)
                std::cerr << "setenv LANG failed: " << strerror(errno);
-       if(setenv ("LC_ALL", locale, 1) == -1)
-               std::cerr << "setenv LC_ALL failed: " << strerror(errno);
 #endif
 #ifdef __APPLE__
-       if(setenv ("LANGUAGE", locale, 1) == -1)
+       if (category == LC_MESSAGES && setenv ("LANGUAGE", locale, 1) == -1)
                std::cerr << "setenv LANGUAGE failed: " << strerror(errno);
-       if(setenv ("LC_ALL", locale, 1) == -1)
-               std::cerr << "setenv LC_ALL failed: " << strerror(errno);
 #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 +290,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)




Related Messages


Powered by MHonArc, Updated Sun Mar 29 11:00:46 2009