关闭语言切花的代码

This commit is contained in:
wangsong 2021-12-20 10:00:26 +08:00
parent f0b5b4687f
commit d850be856e
1 changed files with 5 additions and 4 deletions

View File

@ -70,10 +70,11 @@ if __name__ == "__main__":
else:
logging.basicConfig(format=FORMAT,level=logging.DEBUG,filename = logfile(),filemode = 'a')
if sys.getfilesystemencoding() == "ascii" and not "LANG" in os.environ:
logging.info('start setting environ["LANG"] ...')
os.environ["LANG"] = "C.UTF-8"
os.execv(sys.argv[0], sys.argv)
#目前 多用户的语言切换还未做好 不启用
# if sys.getfilesystemencoding() == "ascii" and not "LANG" in os.environ:
# logging.info('start setting environ["LANG"] ...')
# os.environ["LANG"] = "C.UTF-8"
# os.execv(sys.argv[0], sys.argv)
# if not "LANGUAGE" in os.environ:
# os.environ["LANGUAGE"] = "zh_CN.UTF-8"