感謝 ubuntu-tw 論壇的 peterho Ident 在此文 10.10 中文輸入問題
提到的解決方法

修改 /usr/share/ibus-table/engine/table.py
在 96-106 行可以看到透過 get_chinese_mode() 決定預設語系
做法是從 LC_CTYPE 或 LANG 來判斷

 96         # self._chinese_mode: the candidate filter mode,
 97         #   0 is simplify Chinese
 98         #   1 is traditional Chinese
 99         #   2 is Big charset mode, but simplify Chinese first
100         #   3 is Big charset mode, but traditional Chinese first
101         #   4 is Big charset mode.
102         # we use LC_CTYPE or LANG to determine which one to use
103         self._chinese_mode = self._config.get_value (
104                 self._config_section,
105                 "ChineseMode",
106                 self.get_chinese_mode())

108     def get_chinese_mode (self):
109         '''Use LC_CTYPE in your box to determine the _chinese_mode'''
110         try:
111             if os.environ.has_key('LC_CTYPE'):
112                 __lc = os.environ['LC_CTYPE'].split('.')[0].lower()
113             else:
114                 __lc = os.environ['LANG'].split('.')[0].lower()
115
116             if __lc.find('zh_') == 0:
117                 # this is a zh_XX
118                 __place =__lc.split('_')[1]
119                 if __place == 'cn':
120                     return 0
121                 else:
122                     return 1
123             else:
124                 if self.db._is_chinese:
125                     # if IME declare as Chinese IME
126                    
# return 0
127                     # change for traditional chinese
128                     return 1
129                 else:
130                     return -1
131         except:
132             return -1

get_chinese_mode() 定義可看出當 __lc 不是 zh_ 開頭時,
會執行第 126 行 return 0
在第 97 行寫到 0 代表是簡體,故預設語系就會是簡體
要改成繁體就把 0 改成 1,如第 128 行是小弟修改後的程式
接著重開輸入法就 OK
若覺得輸入法怪怪的,像小弟會有輸入法工具列不見的問題就只好重開機

arrow
arrow
    全站熱搜

    smalldd 發表在 痞客邦 留言(1) 人氣()