Comment #13 on issue 787 by [email protected]: [ibus-table]基于 ibus-table的输入法无法记忆繁简模式
http://code.google.com/p/ibus/issues/detail?id=787

I think the root of the problem is the default Chinese detection only return simplified Chinese, it can be corrected by the following code:

you need to modify the "table.py" file in the folder /usr/share/ibus-table/engine/
(mostly time root permission is required to edit the file )
near line 125:
--------------------------------------------------------------------------
            if __lc.find('zh_') == 0:
                # this is a zh_XX
                __place =__lc.split('_')[1]
                if __place == 'cn':
                    return 0
                else:
                    return 1
            else:
                if self.db._is_chinese:
                    # if IME declare as Chinese IME
                    # FIX HERE !!
                    #   0 is simplify Chinese
                    #   1 is traditional Chinese
                    __lang = self.db.get_ime_property ('languages')
                    if __lang:
                        __langs = __lang.split(',')
                        for _l in __langs:
if _l.lower().find('tw') != -1 or _l.lower().find('hk') != -1:
                                return 1
                    return 0
                else:
                    return -1
--------------------------------------------------------------------------


--
You received this message because you are subscribed to the Google
Groups "ibus-devel" group.
iBus project web page: http://code.google.com/p/ibus/
iBus dev group: http://groups.google.com/group/ibus-devel?hl=en

回复