Title: [commits] (bkirsch) [16120] fixes bug 11577 wx stock labels in English when starting on non-English system.
Revision
16120
Author
bkirsch
Date
2007-12-12 18:13:02 -0800 (Wed, 12 Dec 2007)

Log Message

fixes bug 11577 wx stock labels in English when starting on non-English system. The locale is
noe only set to 'C' in Python on Panther and Tiger Power PC machines. r=heikki

Modified Paths

Diff

Modified: trunk/chandler/i18n/i18nmanager.py (16119 => 16120)

--- trunk/chandler/i18n/i18nmanager.py	2007-12-13 02:08:20 UTC (rev 16119)
+++ trunk/chandler/i18n/i18nmanager.py	2007-12-13 02:13:02 UTC (rev 16120)
@@ -489,8 +489,21 @@
 
         setPyICULocale(primaryLocale)
         setEnvironmentLocale(primaryLocale)
-        setPythonLocale()
 
+        from application import Utility
+
+        if Utility.getPlatformID() == "osx-ppc" and \
+           Utility.getOSName() in ('10.3-Panther', '10.4-Tiger'):
+            # On OS X PPC the LC_NUMERIC values will
+            # localize unless the Python locale is
+            # set to 'C'. Localized numeric values ie.
+            # 1234,23 for a float in the 'FR' locale
+            # create data exchange issues and needs to
+            # be avoided at all costs.
+            setPythonLocale('C')
+        else:
+            setPythonLocale(primaryLocale)
+
     def getText(self, project, name, msgid, *args):
         """
         Returns a c{unicode} string containing the localized
@@ -1079,15 +1092,12 @@
 
     return langCode
 
-def setPythonLocale():
+def setPythonLocale(lc):
     """
-       Set the Python locale to 'C'.
-       This ensures that the Python
-       env is portable across platforms
-       and locales.
+       Set the Python locale to lc variable.
     """
     try:
-        locale.setlocale(locale.LC_ALL, 'C')
+        locale.setlocale(locale.LC_ALL, lc)
     except locale.Error:
        pass
 




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to