fix: i18n rename 不全 (#77)
This commit is contained in:
parent
f47627c650
commit
4ce152827c
4
i18n.py
4
i18n.py
@ -4,7 +4,7 @@ import os
|
|||||||
|
|
||||||
|
|
||||||
def load_language_list(language):
|
def load_language_list(language):
|
||||||
with open(f"./locale/{language}.json", "r", encoding="utf-8") as f:
|
with open(f"./i18n/{language}.json", "r", encoding="utf-8") as f:
|
||||||
language_list = json.load(f)
|
language_list = json.load(f)
|
||||||
return language_list
|
return language_list
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ class I18nAuto:
|
|||||||
language = "auto"
|
language = "auto"
|
||||||
if language == "auto":
|
if language == "auto":
|
||||||
language = locale.getdefaultlocale()[0]
|
language = locale.getdefaultlocale()[0]
|
||||||
if not os.path.exists(f"./locale/{language}.json"):
|
if not os.path.exists(f"./i18n/{language}.json"):
|
||||||
language = "en_US"
|
language = "en_US"
|
||||||
self.language = language
|
self.language = language
|
||||||
print("Use Language:", language)
|
print("Use Language:", language)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user