Format code (#142)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-04-24 20:35:56 +08:00
committed by GitHub
parent 376bd31c19
commit b4c653142d
8 changed files with 64 additions and 51 deletions

View File

@@ -11,8 +11,10 @@ def load_language_list(language):
class I18nAuto:
def __init__(self, language=None):
if language in ['auto', None]:
language = locale.getdefaultlocale()[0]#getlocale can't identify the system's language ((None, None))
if language in ["auto", None]:
language = locale.getdefaultlocale()[
0
] # getlocale can't identify the system's language ((None, None))
if not os.path.exists(f"./i18n/{language}.json"):
language = "en_US"
self.language = language