Per-account UI language preference (cross-device persistence) #40
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up from the "instance locale + single-language content authoring" milestone
(
docs/superpowers/specs/2026-06-05-instance-locale-and-content-authoring-design.md).That milestone sets the instance default UI language via the
DEFAULT_LANGUAGEenv var,surfaced through
GET /api/config, and a fresh browser defaults to it. A user can alreadyswitch language for their browser via the existing
LangSwitch(persisted inlocalStorage[LOCALE_KEY]). What's missing is a per-account preference that follows theuser across devices/browsers — e.g. a curator who prefers English even on a Swedish
instance shouldn't have to re-switch on every machine.
Ask
languagecolumn toapp_user(null = "use the instance default").UserView/GET /api/admin/me, andadd a way to set it (a small
PATCH /api/admin/meor a preference endpoint; decide).meload, initialize i18n from the accountlanguagewhen set,taking precedence over the instance default (and reconcile with the existing
localStorageoverride — decide the precedence: account preference as the source oftruth, with localStorage as a fast local cache).
preference; confirm against the audit policy).
Precedence (to settle during design)
Proposed order, highest first: explicit in-session
LangSwitch→ accountlanguage→instance
DEFAULT_LANGUAGE→ built-in fallback. (i.e. account preference seeds the initiallanguage; an in-session switch still wins until reload, and may update the account
preference.)
Acceptance
never set a preference.
Notes
persistence already covers the single-machine case).
me-surface field + SPA init wiring.Filed per the instance-locale brainstorm (2026-06-05).