1.4 KiB
1.4 KiB
0020 Server organisms take their text as labels from the app
Status: Proposed · Area: architecture · Date: 2026-10-07 · Decided by: agent
Context
The channel header and the track record are the same for every visitor and should render on the server with no client JavaScript. The platform has no i18n instance of its own; each app owns one, and React context (useTranslation) doesn't reach server components.
Decision
- A platform organism that renders on the server takes its text as a
labelsprop. The app's template builds it with the platform's label builder and its server i18n:channelHeaderLabels(i18n.getFixedT(null, 'channel'), i18n.getFixedT(null, 'common')),creatorStatsLabels(i18n.getFixedT(null, 'content')). - Label builders live beside the organism (
labels.ts) or, for island organisms several screens use, inplatforms/market/src/shared/labels/, and taketfixed to one namespace, so the same builder works withuseTranslation(ns).tin client components. - Client organisms keep calling
useTranslationthemselves.
Alternatives
- Make the organisms client components with
useTranslation: rejected; CreatorStats and the header would ship and hydrate for nothing. - A platform-owned i18n instance: not chosen; it would duplicate each app's instance.
Consequences
Templates in both apps pass one labels prop per server organism. Builders return functions, so labels never cross into a client component as props.