ADR-0086 — Studio's own text is handed in through one provider
- Status: Accepted
- Date: 2026-08-29
- Deciders: Track 005 phase 02
- Follows: ADR-0080 (a Studio string is extracted by becoming a prop), ADR-0018 (one component set, checked across three targets), ADR-0084 (a declaration keeps its English as the fallback and takes the translation at the boundary)
Context
ADR-0080 settled what happens to Studio's 27 hardcoded strings — they become
text Studio is handed, never a t() call inside @studio/react — and left
how open. The first slice to try it found the how is not obvious.
The strings are not decorations on a call site's content. They are the
component's own chrome: DataTable's empty line, its bulk bar and its
select-all checkbox; Pagination's landmark name, its page readout, its size
select and both arrows; Modal's backdrop and close button. Fourteen strings
across three components — and DataTable has 58 call sites in apps/web,
Pagination 57.
A prop per string is the literal reading of ADR-0080 and it does not survive contact with those numbers. Fifty-eight call sites would each carry a dozen props saying the same thing, every new call site would start untranslated, and the day a component gains a fifteenth string is the day 58 files are wrong. A design system whose text can only be replaced call site by call site is a design system whose text is not replaceable.
The tempting shortcut is worse: give each string a prop with an English default and pass nothing. ADR-0080 refused that in advance — a default that renders English to a user is English rendered to a user, and moving it out of JSX only moves it out of the counter's view.
Decision
Studio declares its own text once, and one provider replaces it.
studio/packages/react/src/intl.jsx exports three things:
STUDIO_STRINGS— every string Studio draws for itself, in English, grouped by component. It is the fallback, not the shipped copy for a consumer that translates: a tree with no provider renders it, which is what keeps@studio/reactusable outside this app.StudioIntlProvider— takes astringsoverride and merges it group by group, so a consumer may replace a subset.useStudioStrings()— what a component reads. Never i18next; Studio imports no i18n stack, and by ADR-0018 it cannot.
apps/web mounts it once, in main.tsx, through
components/StudioStrings.tsx, which builds the object from t() calls with
literal keys under studio.* — literal because rule 3 of the coverage gate can
only check a key it can read.
A string that varies is a function of what varies. page,
selected and their kind take their values as arguments rather than being
assembled from fragments:
selected: (count) => `${count} selected`,
page: (page, pages) => `Page ${page} of ${pages}`,
Page {page} of {pages} written in JSX is an English word order compiled into
a component, and the counter reads it as the two strings it is — Page and
of — which is exactly how much of the sentence a translator would have been
handed. As a function, the app answers it with one whole key,
Page {{page}} of {{pages}}, and a locale that orders it the other way has
somewhere to say so. The same shape carries the plural: selected resolves
t('studio.table.selected', { count }), so _one/_other do their work
where the catalogue is.
The provider is not a component in the parity sense. It ships a
not-planned Swift disposition saying so: it hands text in, and a Swift target
states its text however SwiftUI localisation does.
Alternatives
A prop per string. The literal reading of ADR-0080, and the reason this ADR exists: 58 and 57 call sites, each carrying a dozen props, each new one starting untranslated. ADR-0080's own words are that the string becomes a prop; its intent is that the string comes from outside Studio, and a provider is a prop that only has to be passed once.
A module-level configureStudioStrings(). No context, no provider, no
parity row. Also no re-render when the language changes, which makes the
control phase 04 ships do nothing to any Studio chrome on screen — the
switcher that lies, one component set over.
Leave Studio's chrome in English. Sixteen of the 27 are aria-labels
(ADR-0080), which is all the text a screen-reader user gets. A table that
announces its columns in French and its empty state in English is not a lesser
translation, it is a broken one.
Consequences
The remaining 13 Studio strings — overlays.jsx's command palette and date
picker, resource.jsx's drawer and domain field, feedback.jsx's dismiss and
loading labels — extract by adding their group here, and their call sites do
not change at all. That is the point: the second slice through this mechanism
touches two files.
STUDIO_STRINGS is now a public part of Studio's surface, and a component that
adds chrome text adds it there rather than inline. A string that appears in
Studio JSX after this is a string the coverage ratchet will see, and should.
The app's provider sits above ToastProvider and below ThemeProvider in
main.tsx. It re-renders Studio's chrome when t changes identity, which is
what phase 04's control will depend on.
Source: docs/decisions/0086-studios-own-text-is-handed-in-through-one-provider.md