Per-user interface language (#38) #44

Merged
miko merged 2 commits from feature/38-per-user-locale into development 2026-11-02 18:59:17 +01:00
Owner

Closes #38.

Decision: build it for v1 (the column already existed; wiring it up is small).

  • resolveLocale prefers the signed-in user's User.locale over the cookie; null or unsupported values fall through to cookie → Accept-Language → instance default locale.
  • getLocale reads the current user; CurrentUser now includes locale.
  • The language switch's setLocale action still sets the cookie and, for signed-in users, also stores User.locale.
  • ADR-0007 setup notes and the User.locale schema comment updated (comment only, no migration).

Tests: unit tests for the resolution order; e2e e2e/locale.spec.ts checks that a choice made in one browser carries over to a second browser that has an English cookie, using a dedicated polyglot test user.

Note: translated renders now also resolve the session (auth() + one user lookup, deduped per request), including for guests.

🤖 Generated with Claude Code

Closes #38. Decision: build it for v1 (the column already existed; wiring it up is small). - `resolveLocale` prefers the signed-in user's `User.locale` over the cookie; null or unsupported values fall through to cookie → Accept-Language → instance default locale. - `getLocale` reads the current user; `CurrentUser` now includes `locale`. - The language switch's `setLocale` action still sets the cookie and, for signed-in users, also stores `User.locale`. - ADR-0007 setup notes and the `User.locale` schema comment updated (comment only, no migration). Tests: unit tests for the resolution order; e2e `e2e/locale.spec.ts` checks that a choice made in one browser carries over to a second browser that has an English cookie, using a dedicated `polyglot` test user. Note: translated renders now also resolve the session (`auth()` + one user lookup, deduped per request), including for guests. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A signed-in user's language switch now also stores User.locale, and
resolveLocale prefers it over the cookie; a null locale follows the
cookie, Accept-Language and the default locale setting. ADR-0007 updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit c07fc07065 into development 2026-11-02 18:59:17 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!44
No description provided.