wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth src/language.cpp ./changelog


From: ott
Subject: [Wesnoth-cvs-commits] wesnoth src/language.cpp ./changelog
Date: Mon, 18 Jul 2005 15:22:16 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     ott <address@hidden>    05/07/18 19:22:16

Modified files:
        src            : language.cpp 
        .              : changelog 

Log message:
        fix LANGUAGE environment variable blocking translations working

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/language.cpp.diff?tr1=1.97&tr2=1.98&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/changelog.diff?tr1=1.794&tr2=1.795&r1=text&r2=text

Patches:
Index: wesnoth/changelog
diff -u wesnoth/changelog:1.794 wesnoth/changelog:1.795
--- wesnoth/changelog:1.794     Mon Jul 18 18:59:08 2005
+++ wesnoth/changelog   Mon Jul 18 19:22:16 2005
@@ -11,6 +11,7 @@
    * fixed some typos (#13714,#13715,#13716,#13717,#13718)
    * added terrain descriptions to in-game help
    * fixed blank terrain entries in unit help
+   * explicitly ignore environment variable LANGUAGE (forum thread 6614)
  * unit balancing and modifications:
    * max level units given After-Max-Level-Advancement (AMLA) of 3 HP/100XP
      added to max HP, with no auto-heal; Necrophage has healing AMLA
Index: wesnoth/src/language.cpp
diff -u wesnoth/src/language.cpp:1.97 wesnoth/src/language.cpp:1.98
--- wesnoth/src/language.cpp:1.97       Sat Jul  2 21:37:19 2005
+++ wesnoth/src/language.cpp    Mon Jul 18 19:22:16 2005
@@ -1,4 +1,4 @@
-/* $Id: language.cpp,v 1.97 2005/07/02 21:37:19 ott Exp $ */
+/* $Id: language.cpp,v 1.98 2005/07/18 19:22:16 ott Exp $ */
 /* vim:set encoding=utf-8: */
 /*
    Copyright (C) 2003 by David White <address@hidden>
@@ -124,6 +124,15 @@
 static void wesnoth_setlocale(int category, std::string const &slocale)
 {
        char const *locale = slocale.c_str();
+       // FIXME: ideally we should check LANGUAGE and on first invocation
+       // use that value, so someone with es would get the game in Spanish
+       // instead of en_US the first time round
+       // LANGUAGE overrides other settings, so for now just get rid of it
+       // does Windows have unsetenv? if so, can make this unconditional
+#ifndef _WIN32
+       unsetenv ("LANGUAGE"); // void so no return value to check
+#endif
+
 #ifdef __BEOS__
        if(setenv ("LANG", locale, 1) == -1)
                std::cerr << "setenv LANG failed: " << strerror(errno);
@@ -167,6 +176,8 @@
        if (res == NULL)
                std::cerr << "WARNING: setlocale() failed for "
                          << locale << ".\n";
+       else
+               std::cerr << "set locale to " << locale << "\n";
 }
 
 bool set_language(const language_def& locale)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]