From 8b6b1675ea0b1c0394600f63f482a5f05db7ab0a Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Sun, 25 Aug 2019 09:22:44 +0800 Subject: [PATCH] Update --- libs/i18n/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/i18n/__init__.py b/libs/i18n/__init__.py index ffef66c..0d6d056 100644 --- a/libs/i18n/__init__.py +++ b/libs/i18n/__init__.py @@ -11,9 +11,12 @@ class Yuuki_LangSetting: } def gettext(self, text, lang=None): - if lang: - return self.support[lang].i18nText[text] - return self.support[self.default].i18nText[text] + try: + if lang: + return self.support[lang].i18nText[text] + return self.support[self.default].i18nText[text] + except KeyError: + return text + "\n\n{Language Package is not Work, please inform the Admin of the Yuuki}" def _(self, text, lang=None): return self.gettext(text, lang)