mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-29 07:24:48 +08:00
🐛 修复获取系统语言代码的逻辑,添加对None值的处理
This commit is contained in:
parent
b0761e9873
commit
86f47ee411
@ -213,7 +213,11 @@ def get_system_lang_code() -> str:
|
||||
"""
|
||||
获取系统语言代码
|
||||
"""
|
||||
return locale.getdefaultlocale()[0].replace("_", "-")
|
||||
l = locale.getdefaultlocale()
|
||||
if l[0] is None:
|
||||
return "zh-CN"
|
||||
else:
|
||||
return l[0].replace("_", "-")
|
||||
|
||||
|
||||
def get_default_lang_code() -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user