mfabian / rpms / ibus-table

Forked from rpms/ibus-table 4 years ago
Clone
Blob Blame History Raw
diff -up ibus-table-1.1.0.20090316/engine/table.py.2-candidate_order ibus-table-1.1.0.20090316/engine/table.py
--- ibus-table-1.1.0.20090316/engine/table.py.2-candidate_order	2009-06-15 09:47:54.000000000 +1000
+++ ibus-table-1.1.0.20090316/engine/table.py	2009-06-15 09:49:39.000000000 +1000
@@ -26,6 +26,7 @@ __all__ = (
 )
 
 import os
+import locale
 import ibus
 from ibus import Property
 from ibus import keysyms
@@ -102,7 +103,8 @@ class editor(object):
     def get_chinese_mode (self):
         '''Use LC_CTYPE in your box to determine the _chinese_mode'''
         try:
-            __lc = os.environ['LC_CTYPE'].split('.')[0].lower()
+	    if locale.setlocale(locale.LC_ALL, ''):
+                __lc = locale.getlocale()[0].lower()
             if __lc.find('zh_') == 0:
                 # this is a zh_XX
                 __place =__lc.split('_')[1]