Open mahiuchun opened 12 years ago
Hi, I add a elif to support en_HK, please test it.
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.
@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.
sorry, merged to master branch now
maybe I should test HK, TW instead.
@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.
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.
@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.
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.
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()