fix empty locale

This commit is contained in:
mihalin 2022-04-11 17:24:13 +03:00
parent a7ae47f2a7
commit 0455c6d022

View File

@ -24,6 +24,8 @@ _redis: ty.Optional[Redis] = None
def _get_translator(message: types.Message) -> ty.Callable: def _get_translator(message: types.Message) -> ty.Callable:
if not message.from_user.locale:
return _
return translators.get(message.from_user.locale.language, _) return translators.get(message.from_user.locale.language, _)