acevery / ibus-table

The tables engines for IBus
GNU Lesser General Public License v2.1
44 stars 39 forks source link

Default Locale-Based Chinese Mode Setting is Inconvenient for Hong Kong GNU/Linux Users #9

Open mahiuchun opened 12 years ago

mahiuchun commented 12 years ago

BACKGROUND en_HK is popular among Hong Kong GNU/Linux users. However, according to current practice of IBUS, Simplified Chinese mode would be used by default. This is quite annoying for these users. This issue even makes FOSS promotion harder in Hong Kong.

PINYIN CANGJIE DIFFERENCE Pinyin for Simplified and Traditional Chinese characters are the same. If a Traditional Chinese user meets Simplified Chinese mode, she can still express her meaning in most cases. However, Simplified and Traditional Chinese characters generally do not have same Cangjie code. A Traditional Chinese user would meet a very hard time in Simplified Chinese mode because she cannot get expected character by typing her familiar Cangjie code. BTW, Cangjie and related Quick is still very popular in Hong Kong.

SUGGESTION Add en_HK as a special case that would return Traditional Chinese mode as other non zh_CN Chinese locales. This shouldn't be a ugly hack because virtually only Hong Kong users would choose en_HK.

RELATED CODE https://github.com/acevery/ibus-table/blob/master/engine/table.py -- Line 108 -- get_chinese_mode()

acevery commented 12 years ago

Hi, I add a elif to support en_HK, please test it.

mozbugbox commented 12 years ago

Actaully, there are a few less popular locales for _HK and _TW: nan_TW@latin 闽南 nan_TW.utf8@latin en_HK en_HK.iso88591 en_HK.utf8 yue_HK 粤 yue_HK.utf8

Therefore it's better to check for existence of _HK and _TW instead of special case just en_HK.

mahiuchun commented 12 years ago

@acevery I'm sorry. I cannot find the modified code :(

@mozbugbox I mean en_HK prefix actually. I didn't know Cantonese and Minnan locales before.

acevery commented 12 years ago

sorry, merged to master branch now

acevery commented 12 years ago

maybe I should test HK, TW instead.

voidoo commented 12 years ago

@maxiaojun Thanks for submitting the bug. @acevery I agree that you should test _HK and _TW instead of only en_HK as both Taiwan and Hong Kong use traditional chinese instead of simplified Chinese.

mozbugbox commented 12 years ago

I thought that the additional test should be put below if self.db.is_chinese:

The en_HK meant that the language is english. the region is HK. Therefore the default language should be english unless the IM said itself was Chinese.

something like:

else:
    if self.db.is_chinese:
        if '_tw' in __lc or '_hk' in __lc:
            return 1
        else
            return 0

Also the test under if __lc.find("zh_") != -1:, it should just test for "_tw", "_hk", maybe also "_mo"[1] to return traditional chinese, because only taiwan, hongkong and macau use traditional chinese. anywhere else are using simplified chinese, like singapore. Who knows if there will be additional chinese language locales added to places like malaysia, etc.

[1]: It seems that locale -a on my box doesn't show any macau locale.

voidoo commented 12 years ago

@acevery Thanks very much for fast response, we are pushing more people to test it currently and submit the same bug report in Ubuntu and Debian. (https://bugs.launchpad.net/ubuntu/+source/ibus-table/+bug/947908) Wish that the fix may included in the coming releases although the schedule is very tight.

It is correct that _mo (macau) is another locale that you may need to check. I haven't reach the macau F/OSS community (I heard that some previous macau Linux user group people already move back to windoze, sadlly), but I think while macau is a small place. They might sharing the same locale with HK and TW people as HK people usually use zh_TW in past.

Back to the issue. Indeed, I think the default value should based on the input method instead of locale. (but current fix should already make the life of HK people easier). For Hong Kong, we usually need to input many different language at the same time. We usually use engish and traditional chinese but we may switch to simplified chinese when we communicate with mainland china people and sometime we may need to input some Japanese han characters.

For CangJie3, Quick3 and Classic Quick, it is designed target for inputting traditional Chinese and it only support traditional Chinese, it is meaningless to switch to simplified Chinese mode no matter in any locale. CangJie5 and CangJie bit is an extend of Cangjie to support the all han character including both traditional Chinese and simplified Chinese, japan/korean han characters, Big charset mode (4) or Big charset mode but traditional first (3) is more suitable for these input methods. Or better, the user should have a way to configure their own default Chinese mode.

acevery commented 12 years ago

thanks, I would add _mo into the test.

Actually, user can set the mode as they like and ibus-table favour the last user setting stored in gconf.