Localization #15

Merged
pi3c merged 2 commits from feature/localization into dev 2026-05-10 14:19:08 +00:00
Owner
No description provided.
pi3c added 1 commit 2026-05-10 13:27:49 +00:00
feat(i18n): add browser-language localization with Jinja2 _() and locale middleware
Some checks failed
ci/woodpecker/pr/pipeline Pipeline failed
d32ad29abc
Add i18n support to the blog web UI with 4 languages (en/ru/fr/de),
80 translation keys, automatic Accept-Language detection, persistent
locale cookie, and a language switcher dropdown in the header.

- Infrastructure: TranslationService, translation dicts, convenience _()
- Presentation: locale middleware, /web/lang/{locale} switcher route
- Templates: all 9 templates use {{ _(key, current_locale) }}
- Tests: 26 tests across TranslationService, locale detection helpers
- Docs: TEST_MODEL.md and FEATURE_INFRASTRUCTURE.md updated with TC-UNIT-811-821
pi3c added 1 commit 2026-05-10 14:05:06 +00:00
fix(i18n): register _() Jinja2 global and current_locale in error handlers
All checks were successful
ci/woodpecker/pr/pipeline Pipeline was successful
de92f73f58
Error handlers had a separate Jinja2Templates instance without the _
global function, causing UndefinedError when rendering base.html
(which now calls {{ _(key, current_locale) }}).

- Register _() from translator module as Jinja2 global on error_handlers templates
- Add current_locale to get_template_context() from request.state.locale
pi3c merged commit 391ecaa4b0 into dev 2026-05-10 14:19:08 +00:00
pi3c deleted branch feature/localization 2026-05-10 14:19:08 +00:00
pi3c referenced this issue from a commit 2026-05-10 14:19:09 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pi3c/blog.pyaqa.ru#15