commit-gnue
[Top][All Lists]
Advanced

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

[gnue] r10137 - trunk/gnue-common/src/base


From: reinhard
Subject: [gnue] r10137 - trunk/gnue-common/src/base
Date: Sat, 19 Dec 2009 14:20:48 -0600 (CST)

Author: reinhard
Date: 2009-12-19 14:20:48 -0600 (Sat, 19 Dec 2009)
New Revision: 10137

Modified:
   trunk/gnue-common/src/base/i18n.py
Log:
Fix for loading translations under Windows


Modified: trunk/gnue-common/src/base/i18n.py
===================================================================
--- trunk/gnue-common/src/base/i18n.py  2009-12-19 20:18:28 UTC (rev 10136)
+++ trunk/gnue-common/src/base/i18n.py  2009-12-19 20:20:48 UTC (rev 10137)
@@ -183,7 +183,14 @@
 
     # TODO: with 0.8, deprecate non-unicode input, with 0.9 throw an error on
     # non-unicode input.
-    language = locale.getlocale()[0]
+
+    if sys.platform == 'win32':
+        # On Windows, locale.getlocale() returns a non-ISO code like
+        # "German_Austria" instead of "de_AT". However,
+        # locale.getdefaultlocale() returns the correct code.
+        language = locale.getdefaultlocale()[0]
+    else:
+        language = locale.getlocale()[0]
     if language is None:
         return message
 





reply via email to

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