Skip to content
Toolkit

ADR-0082 — The account's language field is not the UI language

Status: Accepted · Date: 2026-08-28 · Track: 005-i18n, phase 03 · Supersedes nothing. Follows ADR-0010, ADR-0081.

The finding

ADR-0010 named two dead controls. The topbar switcher was unmounted then; the Settings page's Language dropdown was the other, and it was the more visible of the two.

It offered seven options whose values were English names — 'english', 'spanish', 'french', 'german', 'portuguese', 'japanese', 'chinese' — and wrote the chosen one to users.language through PATCH /api/v1/account/profile. Everything else in the system speaks ISO 639-1: languages.code is what the catalogue is keyed by, what GET /api/v1/languages serves, and what i18n.ts reads out of localStorage.cardsite_lang at import time. Two namespaces, two stores.

The more interesting half is what a census found: nothing reads users.language. Not the API — it is selected into models.User, written by UpdateProfileFull, and never branched on. Not the client — the only reader in apps/web/src was the useState initialiser of the form that wrote it. Not email, not the public page, not the admin portal. It was a column whose sole purpose was to receive a value and hand it back to the control that sent it, under "Profile updated successfully".

So this was not a control wired to the wrong store. It was a control wired to nothing, in a vocabulary nothing speaks.

The decision

The dropdown is archived, not rewired — .archives/removal-safe/apps/web/src/pages/settings/SettingsPage.language-select.tsx.

Rewiring it to ISO codes now would ship exactly the control phase 04 owes, one phase early, against 1,516 strings that are still hardcoded. ADR-0010's rule stands: a language control ships only once selecting a language changes what a user reads, and that release is controlAllowed in scripts/i18n-baseline.json (ADR-0081), not a judgement made at a call site.

The column stays, and the namespace is settled now so phase 04 inherits an answer rather than a question:

  1. users.language holds an ISO 639-1 code that exists in languages.code — the same namespace as the catalogue, the public read and localStorage.cardsite_lang. The English names are retired with the control that minted them.
  2. The server is the authority. localStorage.cardsite_lang stays what it is today — the pre-boot cache i18n.ts reads synchronously at import time, before any profile has been fetched — never a second source of truth. Phase 04's control writes the profile and refreshes the cache from it; a conflict resolves to the profile.
  3. Until phase 04, no surface writes the column. SettingsPage omits language from its updateProfile payload rather than sending an empty string: the handler's field is a *string, so an absent key leaves the stored value exactly as it was. Archiving the control clears nobody's data.

Consequences

  • Phase 03 is met by a deletion. That is a legitimate result, and the routine says so: "leaving a control that answers success to a write nothing reads" is the thing that is not allowed, not the control's absence.
  • The hardcoded-string ratchet falls by one — label="Language" — for a reason that is not extraction. It is recorded as such in .station/jobs/001-renaissance/evidence/i18n-baseline.md; a ratchet that falls silently for a deletion is a ratchet nobody can read.
  • check:i18n rule 1 could not see this control and still cannot: it resolves the i18n binding, and this select never touched it — its setLanguage was a useState setter, which the rule exempts by design because four unrelated pages have one. The guard against its return is a source-level regression test beside the page, not a widened gate: nothing about the deleted control was structurally an i18n control, so a rule broad enough to catch it would also catch AiTranscriptionPage's transcription language and TwimlPage's voice language, which are content, not chrome.

Source: docs/decisions/0082-the-account-language-field-is-not-the-ui-language.md

Library