This commit is contained in:
Yaronzz
2022-06-30 08:57:04 +08:00
parent ed13b9b92d
commit 33c49b83db
+8 -2
View File
@@ -59,15 +59,21 @@ class Language(object):
def __init__(self) -> None:
self.select = LangEnglish()
def __toInt__(self, str):
try:
return int(str)
except:
return 0
def setLang(self, index):
index = int(index)
index = self.__toInt__(index)
if index >= 0 and index < len(_ALL_LANGUAGE_):
self.select = _ALL_LANGUAGE_[index][1]
else:
self.select = LangEnglish()
def getLangName(self, index):
index = int(index)
index = self.__toInt__(index)
if index >= 0 and index < len(_ALL_LANGUAGE_):
return _ALL_LANGUAGE_[index][0]
return ""