005-i18n — the strings come out, and the control comes back
Status: ACTIVE · Phase: DEFINE · Chartered: 2026-08-28 ·
Starts: now — nothing gates it; 003's registry and 004's capabilities are
DONE
Problem
The product carries a complete internationalisation front end with nothing
behind it, and has carried it since before the audits. The full statement is
ADR-0010
and .station/jobs/001-renaissance/plans/04-system-integrity.md
task 1, whose full path this track is; the analysis there stands and is not
restated. Four findings shape the phases, each re-verified on this tree rather
than inherited:
- No catalogue can reach a client.
repository/languages.go:101—ListActive, the read behindGET /api/v1/languages— selects a literal'{}'in thestringsposition. The admin Languages CRUD writes real JSONB (lines 122/132) and the admin reads return it; the public one throws it away. Every key would render as itself even if call sites existed (parseMissingKeyHandler: (key) => key). - Zero translated call sites.
scripts/check-i18n-coverage.mjsreportstranslatedCallSites: 0against a committed baseline of 1,668 hardcoded strings across 109.tsxfiles underapps/web/src. - The ratchet's scope no longer matches where the strings live. The
counter reads
.tsxunderapps/web/srconly. 002 moved user-facing copy intostudio/packages/react/**, which is 11.jsxfiles — outside the counter on both axes, root and extension. A string relocated there leaves the baseline honest-looking and the app no more translated. That is the ratchet-scope decision ROADMAP names, and it is phase 01, not a footnote. - Two dead controls, not one. ADR-0010 unmounted the topbar switcher and
said plainly that the more visible one survives:
SettingsPage.tsxstill offers a LanguageSelectwhose options are hardcoded English names, persisted tousers.language, while i18n reads ISO codes fromlocalStorage.cardsite_lang— two disjoint namespaces, two disjoint stores, and a "Profile updated successfully" either way.
Objective
A user selects a language and what they read changes — served from the
languages catalogue an operator authors, with no deploy. The extraction is
measured by the ratchet as it happens, the ratchet counts where the strings
actually are, and no language control ships before it is honest.
Phases
| Phase | What | Done when |
|---|---|---|
| 00 — The catalogue reaches the client | Fix ListActive's '{}' so GET /api/v1/languages serves the strings an admin stored, and decide the payload's shape — every active language's catalogue in one response, or the active one's by code — the public payload widened only as far as a consumer reads | A string authored through the admin Languages page reaches the browser, demonstrated on a running stack; the shape choice is an ADR if it constrains the client |
| 01 — The ratchet counts where the strings are | Widen check-i18n-coverage.mjs's scope to the surfaces that render user-facing copy — studio/packages/react/** included, .jsx included — and re-baseline in the same commit with a movement row | The gate is watched failing on a deliberately broken input; i18n-baseline.md carries the movement row and its reason; the scope decision is an ADR, because every later number depends on it |
| 02 — Extraction | Strings behind t(), one surface per PR, the en bundle seeded from the extracted keys. Key vocabulary from docs/GLOSSARY.md — a key is user-facing the moment a translator reads it | Each slice lowers hardcodedStrings in the same commit that extracts it; a missing key resolves to the en bundle, never to the key itself |
| 03 — The Settings dropdown | Resolve the second dead control: one namespace and one store, or archived to .archives/removal-safe/ — including whether users.language drives the UI language at all | Selecting a language in Settings changes what the user reads, or the control is gone. Nothing user-visible is left answering "Profile updated successfully" to a write nothing reads |
| 04 — The control returns | Rule 1 of the gate lifts itself once real call sites exist. Remount a language control against the served catalogue, and settle i18next gating first paint (main.tsx awaits /api/v1/languages; the chunk is 45.04 kB raw / 14.57 kB gzipped on this tree) | A live E2E asserts that switching language changes rendered text and that the text came from the database, not a bundled literal; translatedCallSites is raised so the rule cannot fall back |
Phases 00 and 01 are independent of each other and of everything outside this track; 02 needs both (a key with no catalogue behind it renders as itself, and an unwidened ratchet mismeasures the work). 03 is claimable at any point. 04 is last by ADR-0010's rule, not by convenience.
Out of scope
Authoring translations. Delivering a second language's strings is content
an operator writes through a CRUD that already works; this track delivers the
path, seeded with en. RTL layout. languages.direction exists and a
right-to-left audit of Studio is its own workstream. User-authored content —
block copy, page text, product names an account owns — is data, never a
catalogue key. The Swift target. A translation-management integration
of any kind: the catalogue is JSONB in a table an operator edits.
Verification
Gate — scripts/check-i18n-coverage.mjs, which exists and carries both of
ADR-0010's rules. This track widens rule 2's scope (phase 01) and lifts rule 1
by satisfying it (phase 04). It must still fail when a language control mounts
with nothing translated, when the hardcoded count rises, and when a decrease is
not committed — a ratchet that only falls silently is not a ratchet.
Tests. Go: the public languages read returns stored strings, table-driven,
with the empty-catalogue case asserted as empty, never as absent. Unit: a
missing key falls back to en and never renders as itself. Live E2E per surface
per docs/guides/workstream.md, asserting a
database read rather than rendered text alone.
Evidence. .station/jobs/001-renaissance/evidence/i18n-baseline.md
is the ratchet's canonical record and stays there — every movement this track
makes is a row in it, not a second baseline file. evidence/verification-runs.md
carries this track's gate-failure observations and running-stack proofs.
Merge policy: the standing policy on ROADMAP.md.
Risks
| Risk | Mitigation |
|---|---|
| A half-extracted codebase, permanently bilingual | The ratchet only falls, and each slice commits its own decrease. Stalling is visible in the baseline file, not in someone's memory |
| Widening the ratchet's scope raises the number and looks like regression | Phase 01 re-baselines in the same commit with a stated reason. A scope change that moves the number without a movement row is the one move the baseline file exists to make visible |
| The control returns before the strings do | Rule 1 is structural — it resolves bindings, not spellings — and phase 04 is last. A rebuilt switcher under a new name fails the build the same way |
| Keys are named ad hoc and a translator cannot read them | Keys go through docs/GLOSSARY.md, like every other user-facing vocabulary in this repo |
| A missing key renders as itself in production | parseMissingKeyHandler is phase 02's own deliverable, not a later cleanup |
Source: .station/jobs/005-i18n/README.md