aiogram/CHANGES/1755.bugfix.rst
mahisafa82 53ad537739
i18n: normalize Telegram region codes in locale detection
Resolve user locale by checking the Telegram language code as-is, then
its Babel-normalized form, then the base language. This fixes lowercase
regional codes such as pt-br failing to match available translations like
pt_BR. Add tests covering region-code variants and fallback behavior, and
update i18n documentation plus changelog notes.
2026-02-26 03:07:37 +03:30

1 line
No EOL
213 B
ReStructuredText

Improved i18n locale detection in ``SimpleI18nMiddleware`` to support Telegram-style region codes such as ``pt-br`` by resolving first the raw code and then the normalized Babel-style code (for example ``pt_BR``).