ADR-0081 — English is bundled, and the control is released by hand
- Status: Accepted
- Date: 2026-08-28
- Deciders: Track 005 phase 02 (first slice)
- Follows: ADR-0010 (the language switcher stays unmounted until strings are extracted), ADR-0079 (an empty catalogue is empty, not absent), ADR-0080 (the ratchet counts where the strings are)
Context
The first extracted surface has to answer two questions that no later slice gets to reopen: where English comes from, and what a key does when the catalogue has no entry for it.
The answers on the tree were bad ones. i18n.ts built its resources
entirely from GET /api/v1/languages and set
parseMissingKeyHandler: (key) => key, so any key the server did not carry
reached the user verbatim — and until phase 00 the server carried nothing at
all (ADR-0079). Extraction against that shape would have replaced a page of
English with a page of dotted identifiers the moment a request failed.
The auth surface is the slice: sign in, register, forgot password, the OAuth callback. It is what a user reads before they have an account, it is bounded, and it is the one surface where a broken string is not recoverable by navigating somewhere else.
Decision
English is bundled, not fetched. apps/web/src/locales/en.json ships in
the build and initialises i18next synchronously at import time. Every t()
resolves to a real sentence before any network call, and whether or not one
succeeds. Translations arrive over the wire; the source text does not.
A served catalogue layers over the bundle, per key. An operator who has
translated a key gets their wording — English included, so copy can be
corrected without a deploy — and a key they have not translated keeps its
bundled text rather than vanishing. A failed request leaves English in place,
which is why initI18n resolves rather than rejects.
The catalogue is flat. keySeparator and nsSeparator are off, so
auth.login.title is one entry, not a walk into nested objects. This is the
server's shape, not a preference: the catalogue is a Record<string, string>
in a JSONB column that an admin types keys into, and a nested bundle could not
round-trip through it.
A key that en.json does not define fails the build — check:i18n rule 3
— and only literal keys are allowed, because a computed key is one no gate
can check. parseMissingKeyHandler is gone: the fallback is now a property of
the resources, not a hook that papers over a missing one.
Rule 1 is released by hand, not by progress. It used to lift itself the
moment one t() call site existed. This slice would have lifted it: 45 keys
against 1,657 still-hardcoded strings, a language control that changes 3% of
what a user reads. That is ADR-0010's defect in a smaller size. The release is
now controlAllowed in scripts/i18n-baseline.json — committed, reviewable,
and phase 04's call with the evidence that earns it.
Alternatives
Keep English on the server and seed the languages row. One source of
truth, and an operator could edit any string. But the source text would then
live outside the code that renders it: a key added in a PR would ship broken
until someone updated a database row, and a failed request would blank the app.
The bundle is the source; the server carries translations of it.
Nested JSON with namespaces. i18next's default, and better for large
catalogues. It cannot round-trip through the flat strings column an admin
edits, and a mismatch between the bundle's shape and the server's is exactly
the kind of seam that produces a key rendering as itself.
Let rule 1 lift on a threshold — 50% of strings extracted, say. A number nobody can defend is worse than a decision somebody signed: the threshold would be argued over once and then treated as permission. A flag says who decided.
Consequences
en.json is now the place a new user-facing string goes, and rule 3 makes
forgetting it a build failure rather than a bug a user finds. The ratchet and
the catalogue move together: 1,695 → 1,657, with 51 call sites where there
were 0.
The brand stays hardcoded and stays counted. "Cardsite" and the C mark are
proper nouns; extracting them would lower the ratchet while translating
nothing, and the number is only useful while it refuses that trade.
One copy change came with the extraction: the OAuth callback's "Back to login" is now "Back to sign in", the wording the other three pages already used. Two spellings cannot share a key, and the choice between them is the one extraction forces into the open. No glossary term is affected — the auth surface uses account in its ordinary sense and no member of the vocabulary.
Studio's 27 strings are untouched by this slice and extract by prop, per
ADR-0080. Phase 04 still owns the first-paint question: main.tsx awaits
initI18n() before the first render, and with English now bundled that await
buys nothing but translations for a returning user with a non-English language.
It is left as it is here rather than changed in passing.
Source: docs/decisions/0081-english-is-bundled-and-the-control-is-released-by-hand.md