mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update i18n.py
This commit is contained in:
parent
28dc56cc88
commit
d41d38d49f
1 changed files with 9 additions and 0 deletions
|
|
@ -108,6 +108,15 @@ class I18nMiddleware(BaseMiddleware):
|
|||
return translator.ngettext(singular, plural, n)
|
||||
|
||||
def lazy_gettext(self, singular, plural=None, n=1, locale=None) -> LazyProxy:
|
||||
"""
|
||||
Lazy get text
|
||||
|
||||
:param singular:
|
||||
:param plural:
|
||||
:param n:
|
||||
:param locale:
|
||||
:return:
|
||||
"""
|
||||
return LazyProxy(self.gettext, singular, plural, n, locale)
|
||||
|
||||
# noinspection PyMethodMayBeStatic,PyUnusedLocal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue