mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: typing
This commit is contained in:
parent
fb6c687117
commit
67718a45b3
1 changed files with 2 additions and 2 deletions
|
|
@ -119,7 +119,7 @@ class I18nMiddleware(BaseMiddleware):
|
|||
return LazyProxy(self.gettext, singular, plural, n, locale, enable_cache=enable_cache)
|
||||
|
||||
# noinspection PyMethodMayBeStatic,PyUnusedLocal
|
||||
async def get_user_locale(self, action: str, args: Tuple[Any]) -> str:
|
||||
async def get_user_locale(self, action: str, args: Tuple[Any]) -> Optional[str]:
|
||||
"""
|
||||
User locale getter
|
||||
You can override the method if you want to use different way of
|
||||
|
|
@ -127,7 +127,7 @@ class I18nMiddleware(BaseMiddleware):
|
|||
|
||||
:param action: event name
|
||||
:param args: event arguments
|
||||
:return: locale name
|
||||
:return: locale name or None
|
||||
"""
|
||||
user: Optional[types.User] = types.User.get_current()
|
||||
locale: Optional[Locale] = user.locale if user else None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue