Repository navigation
feat(l10n): word the page from the monorepo's messages - #74
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The page's words come from the monorepo's
l10n/messagesthrough the pinned Cargo checkout:scripts/l10n-messages.mjscopies thecommon,client,browserandhostparts (source + shipped locales froml10n/locales.json) into the git-ignoredapps/web/l10nbeforedev,check,test,buildand Storybook, and Paraglide compiles them. One pin moves the kit and the words together.@punktfunk/streamkeeps no Paraglide: the page installs the engine's sentences withsetWords, 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 follownavigator.languages; only English ships today.Pins
packages/streamandserverat punktfunkc4d6fe182(#2307 + #2308). Verified:npm run check,npm test(stream 109, web 10),npm run buildwith the release wasm, Storybook, fmt + clippy + tests forpackages/stream(native and wasm) andserver. Not run: a browser session,scripts/pack-gate.sh.