feat(i18n): add browser-language localization with Jinja2 _() and locale middleware
Some checks failed
ci/woodpecker/pr/pipeline Pipeline failed
Some checks failed
ci/woodpecker/pr/pipeline Pipeline failed
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
This commit is contained in:
9
app/infrastructure/i18n/__init__.py
Normal file
9
app/infrastructure/i18n/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
"""Internationalization support for the blog application.
|
||||
|
||||
This package provides translation dictionaries and the translation service
|
||||
for localizing the web UI into multiple languages.
|
||||
"""
|
||||
|
||||
from app.infrastructure.i18n.translator import SUPPORTED_LOCALES, TranslationService, _
|
||||
|
||||
__all__ = ["SUPPORTED_LOCALES", "TranslationService", "_"]
|
||||
Reference in New Issue
Block a user