解决Xenial下语言设置闪退问题

转自这里:Firefly RK3399 折腾记
今天在Armbian Xenial上配置fcitx,打开语言设置闪退,出错信息类似这样:

locale.getlocale(locale.LC_CTYPE)[0][:3] in ['zh_', 'ja_', 'ko_', 'vi_']:
TypeError: 'NoneType' object is not subscriptable


修改这个文件:/usr/lib/python3/dist-packages/LanguageSelector/ImConfig.py
将这段代码:


        if desktop.split(':')[-1] in ['Unity', 'MATE', 'GNOME'] \
          and desktop.split(':')[0] != 'GNOME-Flashback' \
          or locale.getlocale(locale.LC_CTYPE)[0][:3] in ['zh_', 'ja_', 'ko_', 'vi_']:
            system_default = autoConfig
        else:
            system_default = 'none'

改为:

        if desktop.split(':')[-1] in ['Unity', 'MATE', 'GNOME'] \
          and desktop.split(':')[0] != 'GNOME-Flashback' \
          or locale.getlocale(locale.LC_CTYPE) == 0 \
          and locale.getlocale(locale.LC_CTYPE)[0][:3] in ['zh_', 'ja_', 'ko_', 'vi_']:
            system_default = autoConfig
        else:
            system_default = 'none'

标签: none

添加新评论