mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
parent
2e207c636c
commit
899228904a
1 changed files with 2 additions and 2 deletions
|
|
@ -132,11 +132,11 @@ class I18nMiddleware(BaseMiddleware):
|
|||
user: Optional[types.User] = types.User.get_current()
|
||||
locale: Optional[Locale] = user.locale if user else None
|
||||
|
||||
if locale:
|
||||
if locale and locale.language in self.locales:
|
||||
*_, data = args
|
||||
language = data['locale'] = locale.language
|
||||
return language
|
||||
return None
|
||||
return self.default
|
||||
|
||||
async def trigger(self, action, args):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue