Skip to content

feat(l10n): word the page from the monorepo's messages - #74

Merged
enricobuehler merged 13 commits into
mainfrom
feat/l10n
Nov 6, 2026
Merged

enricobuehler merged 13 commits into
mainfrom
feat/l10n

Conversation

@enricobuehler

Copy link
Copy Markdown
Member

The page's words come from the monorepo's l10n/messages through the pinned Cargo checkout: scripts/l10n-messages.mjs copies the common, client, browser and host parts (source + shipped locales from l10n/locales.json) into the git-ignored apps/web/l10n before dev, check, test, build and Storybook, and Paraglide compiles them. One pin moves the kit and the words together.

@punktfunk/stream keeps no Paraglide: the page installs the engine's sentences with setWords, and host sentences (API errors, seat lines, action reasons, launch verdicts) are worded by the id the host sends since punktfunk #2308; an unknown id shows the host's English. The console on the canvas and the page follow navigator.languages; only English ships today.

Pins packages/stream and server at punktfunk c4d6fe182 (#2307 + #2308). Verified: npm run check, npm test (stream 109, web 10), npm run build with the release wasm, Storybook, fmt + clippy + tests for packages/stream (native and wasm) and server. Not run: a browser session, scripts/pack-gate.sh.

enricobuehler added 13 commits November 6, 2026 22:39
The kit and core move together, and the localized messages come from the same checkout. The server shared no pin with the stream package; it takes the same rev now.
The messages live in the monorepo's l10n crate, and one pin moves the
kit and its words together. A script finds the checkout through cargo
metadata and copies the common, client, browser and host parts for the
shipped languages into apps/web/l10n, which stays untracked. It writes
the same list into the inlang settings, so the shipped languages have
one source.

The page follows the browser's language list and has no switch. The
app's check, test and build, and Storybook, run the script first, and
so does the stream package's test. CI installs the pinned toolchain
before the web job needs cargo.
The engine and its helpers said their sentences in English. They read
the monorepo's messages through one hook, setWords, which the page
fills, so the library carries no Paraglide and no copy of the text. A
message nobody installed reads as its key.

A 429 from the page's server is a TooMany error instead of a sentence
compared by its text. A seat line, an API refusal and a launch verdict
that arrive with a message id read in the page's language; an id this
build lacks reads as the host's English.
The page showed the host's English for a launch that did not give the
player their game. The verdict now crosses as JSON that carries the
host's message id and its values beside the English, so the page can
word it. A host that names no message still shows its own sentence.
The engine takes its words from the page. Each message it reads is
picked by name, so the bundle keeps only those, and the host's own
message families are looked up by id, which is the one place a whole
family ships. A message the host names that this build lacks, or whose
values the host left out, reads as the host's English.
The sidebar, the host cards, the screen-reader announcements and the
connect, pair, trust and link sheets read the shared messages instead
of English literals. A host card's state, a plural count and a key name
are arguments, so a language can order them. The link sheet's three
sentences are three whole messages.
The library page, its empty and error states and the End game button
read the shared messages. The title count is a plural message, and End
game asks twice with the kit's own sentence instead of building one
around the title.
The toolbar, the quick actions menu and the statistics lines read the
shared messages. The captured-mouse line puts the Esc key cap where the
message places it, so a language can move it.
Every row, hint and option reads the shared player-setting messages.
The tabs have ids, so what the page remembers as the open tab is no
longer its English label. Key chords are arguments of their messages.
The error cards, link errors, wake and copy-link notices and the exit
hint read the shared messages. The engine's reasons arrive in the
page's language already; sentence() stays for the host's own English
and for errors the browser raises, which are still fragments.
The console on the canvas picks its own language from the list it is
given. The browser's list is the page's only language signal, most
preferred first, so it goes in as it is. The page has no setting for it.
The console's library error card carried an English title that the
page supplied. It reads the shared message the other clients show.
The messages are not in this repo, and the app's scripts now need cargo
and the pinned checkout to copy them. A reader who hits that on a fresh
clone should find it in the Build section.
@enricobuehler
enricobuehler merged commit 4db5d3b into main Nov 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant