2019-08-23 18:12:41 +08:00
|
|
|
#!/usr/bin/python3
|
|
|
|
# coding=UTF-8
|
|
|
|
|
|
|
|
from .en import English
|
|
|
|
|
|
|
|
class Yuuki_LangSetting:
|
|
|
|
def __init__(self, default):
|
|
|
|
self.default = default
|
|
|
|
self.support = {
|
|
|
|
"en":English
|
|
|
|
}
|
|
|
|
|
|
|
|
def gettext(self, text, lang=None):
|
2019-08-25 09:22:44 +08:00
|
|
|
try:
|
|
|
|
if lang:
|
|
|
|
return self.support[lang].i18nText[text]
|
|
|
|
return self.support[self.default].i18nText[text]
|
|
|
|
except KeyError:
|
2019-08-25 09:44:10 +08:00
|
|
|
return text + "\n\n{\n\tLanguage Package is not Work.\n\tPlease inform the Admin of the Yuuki.\n}"
|
2019-08-23 18:12:41 +08:00
|
|
|
|
|
|
|
def _(self, text, lang=None):
|
|
|
|
return self.gettext(text, lang)
|