fix: filtering capabilities, feat: improve enum i18n
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from aiogram.utils.i18n import I18n
|
||||
from pydantic_core.core_schema import str_schema
|
||||
from sqlalchemy.types import TypeDecorator, String
|
||||
from typing import Any, Self, overload
|
||||
@@ -133,7 +134,11 @@ class EnumMember(object):
|
||||
if lang and lang in self.loc_obj.keys():
|
||||
return self.loc_obj[lang]
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
i18n = I18n.get_current()
|
||||
if i18n:
|
||||
return self.loc_obj[i18n.current_locale]
|
||||
else:
|
||||
return self.loc_obj[list(self.loc_obj.keys())[0]]
|
||||
|
||||
return self.value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user