fixes
This commit is contained in:
@@ -130,15 +130,18 @@ class EnumMember(object):
|
||||
return hash(self.value)
|
||||
|
||||
def localized(self, lang: str = None) -> str:
|
||||
if self.loc_obj and len(self.loc_obj) > 0:
|
||||
if lang and lang in self.loc_obj.keys():
|
||||
return self.loc_obj[lang]
|
||||
else:
|
||||
if self.loc_obj:
|
||||
if not lang:
|
||||
i18n = I18n.get_current()
|
||||
if i18n:
|
||||
return self.loc_obj[i18n.current_locale]
|
||||
lang = i18n.current_locale
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
lang = list(self.loc_obj.keys())[0]
|
||||
|
||||
if lang in self.loc_obj.keys():
|
||||
return self.loc_obj[lang]
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
|
||||
return self.value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user