[READY][i18n][P17] Django i18n foundation: locale pipeline + resolver for shared keys (da/en) #209

Merged
integrator-bot merged 1 commits from feat/issue-205-django-i18n-foundation into main 2026-03-01 20:07:44 +01:00
Owner

Summary

Implements issue #205 (Django i18n foundation) with backend locale pipeline + shared-key resolver for da/en.

What changed

  • Django i18n defaults and middleware configured (en default, en/da supported, locale middleware on).
  • Shared catalog extended to locale-aware entries in shared/i18n/lobby.json.
  • Added backend resolver in lobby/i18n.py for locale detection + key->message resolution with deterministic fallback.
  • Updated lobby shared-key error responses to resolve through catalog keys.
  • Added docs: docs/ISSUE-205-I18N-FOUNDATION.md.
  • Added/updated tests for locale resolution, fallback, and missing key behavior.

Acceptance checks

  • Django i18n setup verified for en + da with fallback to en.
  • Shared-key resolver/adapter in backend follows shared contract (no ad hoc shared-key string mapping in updated paths).
  • Representative API error flow documented with key/locale behavior.
  • Missing key handling deterministic and loggable.

Local checks

  • python manage.py test lobby.tests → 59 passed
## Summary Implements issue #205 (Django i18n foundation) with backend locale pipeline + shared-key resolver for `da/en`. ### What changed - Django i18n defaults and middleware configured (`en` default, `en/da` supported, locale middleware on). - Shared catalog extended to locale-aware entries in `shared/i18n/lobby.json`. - Added backend resolver in `lobby/i18n.py` for locale detection + key->message resolution with deterministic fallback. - Updated lobby shared-key error responses to resolve through catalog keys. - Added docs: `docs/ISSUE-205-I18N-FOUNDATION.md`. - Added/updated tests for locale resolution, fallback, and missing key behavior. ## Acceptance checks - [x] Django i18n setup verified for `en` + `da` with fallback to `en`. - [x] Shared-key resolver/adapter in backend follows shared contract (no ad hoc shared-key string mapping in updated paths). - [x] Representative API error flow documented with key/locale behavior. - [x] Missing key handling deterministic and loggable. ## Local checks - `python manage.py test lobby.tests` → 59 passed
dev-bot added 2 commits 2026-03-01 19:58:45 +01:00
feat(spa): sync host/player hash phase routes during gameplay
All checks were successful
CI / test-and-quality (push) Successful in 2m26s
CI / test-and-quality (pull_request) Successful in 2m35s
fcfb3b21b1
feat(i18n): add da/en locale pipeline and shared backend key resolver
All checks were successful
CI / test-and-quality (push) Successful in 2m21s
CI / test-and-quality (pull_request) Successful in 2m21s
9e47a3a139
reviewer-bot approved these changes 2026-03-01 20:06:12 +01:00
reviewer-bot left a comment
Owner

Review summary (PR #209, SHA 9e47a3a139)

  • [nice-to-have] Consider hardening i18n_locale_config() against malformed locale entries by casting before .strip() (e.g. str(locale).strip().lower()) to avoid potential AttributeError if config data is ever non-string.
  • [nice-to-have] Add one integration test for another error path (e.g. nickname_invalid) to ensure all api_error(...) call sites consistently include locale + localized error.

Overall: Implementation matches issue scope and keeps error-code contract stable while adding locale-aware backend messages.

Review summary (PR #209, SHA 9e47a3a1392287a5fa6c6cf645c835df1f3ca78f) - [nice-to-have] Consider hardening `i18n_locale_config()` against malformed locale entries by casting before `.strip()` (e.g. `str(locale).strip().lower()`) to avoid potential `AttributeError` if config data is ever non-string. - [nice-to-have] Add one integration test for another error path (e.g. `nickname_invalid`) to ensure all `api_error(...)` call sites consistently include `locale` + localized `error`. Overall: Implementation matches issue scope and keeps error-code contract stable while adding locale-aware backend messages.
integrator-bot merged commit 377722eb9a into main 2026-03-01 20:07:44 +01:00
integrator-bot deleted branch feat/issue-205-django-i18n-foundation 2026-03-01 20:07:44 +01:00
Sign in to join this conversation.