ADR-0010: The language switcher stays unmounted until the strings are extracted
- Status: Accepted — condition met 2026-08-29, and the control is back under ADR-0088. Not superseded: the rule below is what held across all ninety-nine extraction slices, and the release was made by satisfying it, not by revising it.
- Date: 2026-08-13
- Deciders: Cardsite platform team (workstream
001-renaissance, audit 03-D1)
Context
apps/web carries a complete internationalisation front end with nothing
behind it. Measured on this tree:
- Zero
t()call sites. Across the 239.ts/.tsxfiles underapps/web/srcas the audit found them,useTranslationwas imported exactly once — byLanguageSwitcher.tsx, which destructuredi18nand nevert. There are no<Trans>elements and noi18n.t(calls. Every user-facing string is hardcoded English (audit 03-D1,.archives/removal-safe/AUDITS-081226.md).scripts/check-i18n-coverage.mjsmeasures the count and it is still zero. - The switcher shipped anyway, in the topbar's desktop branch
(
Topbar.tsx:461), to every desktop user. - The catalogue is structurally empty even if authored. The public read,
repository/languages.go:101, selects a literal'{}'in thestringsposition, soGET /api/v1/languagesnever returns the JSONB an admin stored. WithparseMissingKeyHandler: (key) => key, every key would render as itself even if call sites existed. - i18next init gates first paint.
main.tsxawaitsinitI18n()— which awaits/api/v1/languages— before the first render, for a feature with no consumers.
The switcher hides itself when fewer than two languages are active
(LanguageSwitcher.tsx:20), and migration 000009 seeds exactly one. So the
defect is not visible in a default install: it appears the moment an operator
adds a second language through the admin Languages page, which is a working
CRUD surface. The lie is one admin action away, and the operator who takes that
action is precisely the person who believes the feature works.
The phase plan
(.station/jobs/001-renaissance/plans/04-system-integrity.md,
task 1) states the constraint: two paths exist — unmount (hours) or extract
~903 strings (weeks) — and doing nothing is not one of them. A control that
lies is worse than an absent feature, and AGENTS.md non-negotiable #7 says a
shipped control works.
Decision
No language-selection control ships while zero strings are translated. The switcher is unmounted and archived; the i18next infrastructure stays, dormant; a CI gate holds both halves of that sentence true.
<LanguageSwitcher />is removed fromTopbar.tsx, and the component is archived to.archives/removal-safe/apps/web/src/components/layout/with a register row (AGENTS.md§2) rather than left insrc/as a component nothing renders.apps/web/src/i18n.ts, thelanguagestable,GET /api/v1/languagesand the admin Languages CRUD are unchanged. They are the foundation the extraction builds on; removing them would make the full path a rewrite rather than a continuation.scripts/check-i18n-coverage.mjsruns innpm run verifyand in the Studio CI job beside the existing parity gates. It enforces two rules:- No control that lies. While
apps/web/srccontains zero translated call sites, any mounted language-selection control fails the build — detected both by component name and, structurally, by any call to the i18n module'ssetLanguage/changeLanguageoutsidei18n.ts, which any rebuilt switcher must make. The anchor resolves bindings rather than matching spellings, so an aliased import or a destructured method is the same control under another name. A translated call site only counts in a file that imports i18next: without that, one helper function namedtanywhere in the app switches this rule off everywhere. Once real call sites exist, the rule lifts itself — a switcher is then honest. - A hardcoded-string ratchet. A committed baseline
(
scripts/i18n-baseline.json) records today's count of user-facing string literals in the JSX surface. The count may not rise. It may not fall silently either — a decrease fails with an instruction to commit the lower number, so extraction progress is locked in as it is made rather than drifting back.
- No control that lies. While
The choice between the short path and the full path is not made here. This ADR makes the short path unconditional, which is what the plan requires within a day of the phase opening; the full path remains open and now has a ratchet to land against.
Consequences
Easier. The product no longer offers a control that does nothing. The
extraction, if it happens, starts from a measured baseline instead of an
estimate, and cannot stall halfway into a permanently bilingual codebase
without CI saying so. The gate also protects the next well-meant rebuild: a
new LanguagePicker wired to setLanguage fails the build with an explanation
rather than shipping the same defect under a new name.
Harder. Deleting user-facing strings now costs a one-line baseline commit. That is the price of a ratchet that actually ratchets, and it is paid by the person making the change, who is the person who knows the number is legitimate.
Accepted, and deliberately not fixed here. Each is recorded on the ROADMAP rather than folded into this slice, because they are separate defects with separate fixes:
repository/languages.gostill returns'{}'forstrings. Any extraction must fix that query first, or every key renders as itself. It is a backend defect, not a topbar one, and fixing it now would ship a widened public payload no consumer reads.- The Settings page still offers a Language dropdown
(
apps/web/src/pages/settings/SettingsPage.tsx:170) whose seven options are hardcoded English names ('english',SettingsPage.tsx:142-149), persisted tousers.language, while i18n reads ISO codes fromlocalStorage.cardsite_lang. Two disjoint namespaces, two disjoint stores. It is a second dead control and it is the same finding class as this one — but it round-trips through the API and needs a decision about whether the profile field should drive the UI language at all, which is not the topbar's question. Stated plainly, because it is the uncomfortable part of this decision: by the discoverability argument used above, that control is the more visible of the two. The switcher was invisible until an admin added a language; the Settings dropdown ships to every user on a stock install and answers "Profile updated successfully". Neither this gate nor the new live spec can see it — the gate exemptsuseStatesetters and the spec scopes itself to the topbar — so it is on the ROADMAP with a line cite rather than left to be rediscovered. - i18next still gates first paint on
/api/v1/languages, and thei18nvite chunk still ships — 46.12 kB raw, 15.08 kB gzipped, plus one blocking request before the first render. Dormant infrastructure has a cost; that is the number, and the alternative is deleting the foundation. - The ratchet measures a subset, and only that subset.
<p>{'Save'}</p>, a string in aconst, a ternary branch and a template literal are all user-facing and all invisible to it;placeholder="x"counts whereplaceholder={'x'}does not. It is a floor under regression, not a census — which is why the count is defined by a stated method rather than by intent. - The ~903-string estimate is not this gate's number. The baseline counts a
precisely defined subset (JSX text nodes and five user-facing attributes
across
.tsx); the counting method is documented in the script header and in.station/jobs/001-renaissance/evidence/i18n-baseline.md. A ratchet is only as trustworthy as the reproducibility of its measurement, so the method is pinned rather than the estimate.
Alternatives considered
- Extract all ~903 strings now (the full path) — rejected as the immediate step, not on the merits. It is weeks of work; it would leave the lying control shipped throughout; and the plan sequences extraction before phase 01 task 5's vocabulary rollout, which is itself blocked on decision 001. Nothing here forecloses it — the ratchet exists to receive it.
- Delete i18next, the
languagestable and the admin CRUD entirely — rejected. It converts a future feature into a rewrite, discards an admin surface that works, and requires a migration to undo. Dormant is cheaper than gone, provided nothing user-facing points at it. - Keep the switcher and disable it, or show a "coming soon" tooltip — rejected. A disabled control is still a claim, and this one would be a claim about a feature with no committed delivery date.
- Leave it — excluded by the plan and by non-negotiable #7. Three shipped-but-dead subsystems are already on record; this is the fourth being closed, not a fifth being opened.
Source: docs/decisions/0010-language-switcher-unmounted-until-strings-are-extracted.md