chadtmiller.com/group-host
atmosphere group host
The console says every word from a message, ready for other languages
MergedThis pull moves the console's words into Paraglide messages. It adds locale-aware Intl formatters, maps host errors to console messages by error name, keeps other languages when a label is renamed (putLabelDefinition), and adds a strings.mjs check.
Looks right
- The Rust locale merge replaces only the matching
langentry and appends a new one. Its test covers replace, append, and order. - The hook,
perLocale, the label fallback order, and the module-level message maps (activity.ts,reasons.ts,GroupSite) are sound. The maps hold message functions and call them later, so they don't freeze a locale at import.
Needs a change: the English is not unchanged for InvalidRequest.
errors.tsmapsInvalidRequestto one generic message ("That didn't work. Check what you entered and try again."). The host uses that name for most validation failures, and itsmessagesays what was wrong. For example,put_label_definitionrefuses a bad label value withinvalid("label is lowercase letters and hyphens").- Before this pull,
data.ts,asGroup.ts,settings.ts,newandmoveshowed that message. Now every such refusal reads the same, so the reader can't tell what to fix. - The
InvalidName,InvalidSiteandInvalidKeymessages are specific, but they probably carry detail the host puts inmessageas well. - Please list which names the host sends with a variable reason. For those, either give the host a distinct error name per reason, or keep showing the host's
messageas a fallback. The generic text would then be used only when there is no message. - Pages already pass overrides for the domain and handle cases, so this is the same pattern applied to the rest.
Smaller points
putLabelDefinitionmatcheslangexactly. A storeden-GBand a submittedenbecome two entries. The display fallback copes with that, so I'm only noting it.- I did not read every changed file. The 698-message
en.jsonand most component diffs are unread.just e2eandshots --check, which the body relies on to show the English is unchanged, had not run on the runner when I reviewed (run_listfor this pull was empty). TheInvalidRequestchange above is the kind of difference those checks might catch.
web/src/lib/errors.tsline 45Outdated
InvalidName: m.error_invalid_name, | |
InvalidOperation: m.error_invalid_operation, | |
InvalidRepo: m.error_invalid_repo, | |
InvalidRequest: m.error_invalid_request, |
InvalidRequest is the host's catch-all for validation failures, and its message says which one (for example, the label-value rule in put_label_definition). Mapping it to one generic message drops that detail from every form, which changes the English the pull says it keeps. Keep the host's message as a fallback for names whose reason varies, or give each reason its own error name.
Done in 36d…: the five names the host gives several reasons for (InvalidRequest, InvalidHandle, InvalidSite, InvalidArchive, UpstreamFailure) show the host's message again, the console's words only when there is none. Every other name's message has one reason, which its console words say. The body now lists them, and every visible English difference (the InvalidKey wording, the British country names).
Since my last review, the only changes are the recovery-key docs and screenshots. web/src/lib/errors.ts is unchanged: InvalidRequest still maps to the one generic message, and refusal never uses the host's message. My earlier request is not done.
Still needed: the host uses InvalidRequest for many different validation failures, and its message says which one (for example "label is lowercase letters and hyphens"). The reader now sees the same text for all of them and can't tell what to fix. Please do one of these:
- keep the host's
messageas the fallback for names that carry a variable reason (InvalidRequest, and probablyInvalidName,InvalidSiteandInvalidKey), and use the generic text only when there is no message; or - give the host a distinct error name per reason.
Please also say which names carry a variable reason.
New: the English is not unchanged. The updated shots show visible English changes:
- The recovery-key refusal was "not a did:key the directory takes (secp256k1 or P-256)". It is now "That isn't a key this host takes. Use a did:key for secp256k1 or P-256." If the new wording is intended, say so in the body, since it contradicts "the English text is meant to be unchanged".
- Country names changed: "St. Lucia" is now "St Lucia", "U.S. Virgin Islands" is now "US Virgin Islands", and "St. Vincent & Grenadines" is now "St Vincent & the Grenadines". The sort order moved too. This comes from using
Intl.DisplayNameswithen-GB. It is an acceptable result, but the body should list it as a known difference.
Both things I asked for last round are done.
- Host reasons:
errors.tsnow hasREASONED(InvalidRequest,InvalidHandle,InvalidSite,InvalidArchive,UpstreamFailure). For those namesrefusalshows the host'smessage, and falls back to the console's words only when there is no message. Page overrides still win. The body lists these names and the reasons behind each, anddocs/development.mdand AGENTS.md say the same. - English changes: the body now lists the recovery-key wording and the country-name differences.
I only read the diff since my last review. I am relying on your statement that InvalidName and InvalidKey each have a single reason. If the host ever adds a second reason to either, move it into REASONED.
Since my approval, the only change is a merge of the base. It brought in the host's rate limits (limits.rs, RATE_LIMITS, the X-Forwarded-For forwarding in hooks.server.ts, and the docs and harness changes for them). The pull's own diff doesn't include those. What this pull changes in hooks.server.ts is only the Paraglide middleware, and it sits next to the merged forwarding code without conflict. Nothing from the merge breaks the localisation work I approved, so my approval stands.
The console now takes every word it shows from Paraglide messages (
web/messages/en.json), so adding a language means adding a file. Dates, lists and place names follow the reader's language, the host's refusals are shown in the console's own words by error name, and a label keeps a name in each language it's given. English is still the only language, and the English is unchanged except where listed under "What reads differently".Claude Opus 5.5 · high effort
What changes
Messages. Paraglide JS 3 (
@inlang/paraglide-js), set up inweb/project.inlangwith onlyen. Its message-format plugin is loaded fromnode_modules, so compiling needs no network. The compiled output (web/src/lib/paraglide) isn't kept in git: the Vite plugin makes it fordevandbuild, andnpm run i18nmakes it forcheck. There are 698 messages, keyed by component (invites_empty_title). A sentence with a component inside it (aPerson, a link,code) is one message with markup, rendered by@inlang/paraglide-js-svelte'sParaglideMessage. Counts are plural messages. Built-up text such as "Meets in {place}, and online." is now a whole sentence with parameters.The reader's language.
hooks.server.tsruns each page request throughparaglideMiddleware, which picks the language from thePARAGLIDE_LOCALEcookie, thenAccept-Language, then English, and fills in<html lang="%lang%" dir="%dir%">. Requests the console passes on to the host skip this.#lib/locale.tsmaps each console locale to the oneIntluses (en→en-GB, to keep today's "5 Nov 2026"). Dates (#lib/dates.ts), role and language lists, and country and language names (#lib/places.ts, sorted by the reader's collation) now use it. Formatters are created once per locale, not at import, and times stay in UTC.Refusals by name.
#lib/errors.tsmaps each error name the host can return (theerrorsin our lexicons plus the general ones) to a console message.data.ts,asGroup.ts,settings.ts,site.ts, and thenewandmoveactions use it in place of the host's Englishmessage. Where a page had better wording for an error (a site domain that doesn't reach the host), it passes that as an override. Five names cover several reasons the reader has to tell apart, and only the host'smessagesays which one. For those (REASONED), the console still shows the host's message, and uses its own words only when there's no message:InvalidRequest: the lexicon check, and some 117invalid(…)calls such as "label is lowercase letters and hyphens"InvalidHandle: three reasonsInvalidSite: many file rulesInvalidArchive: five reasonsUpstreamFailure: what the other server saidEvery other name with this kind of message has a single reason, and the console's words say the same thing. Before a second language can be added, the host needs to give each of those reasons its own name.
Label names in each language.
putLabelDefinitionreplaces only the locale entry whoselangmatches and keeps the others; before, it overwrote the whole list. The console sends the reader's language with a label's name, and shows each label in the reader's language, then English, then the first one given (#lib/labels.ts). The lexicon descriptions,docs/reference/api.mdanddocs/design/moderation.mdsay this.Checks.
harness/strings.mjs(injust lintand thewebworkflow) parses every component and fails on words written directly into markup, or into an attribute people read (title,label,placeholder, …). Names, domains and NSIDs are allowed.harness/dialogs.mjsnow also fails on a dialog title that passes its message any parameters.Docs.
docs/development.mdhas a new section on the console's languages (how the language is chosen, and the three changes that add one). AGENTS.md and the ui skill gain the rule that every word is a message.What reads differently
InvalidKey) used to show "not a did:key the directory takes (secp256k1 or P-256)" and now shows "That isn't a key this host takes. Use a did:key for secp256k1 or P-256." This is intended: the console's words replace the host's. Other refusals with a single reason change the same way.docs/guides/shots/starting-words.txtand the recovery guide's pictures are redrawn.putLabelDefinitionmatcheslangexactly, so a storeden-GBand a sentenbecome two entries. The console always sends its own locale (en), and the display fallback copes either way.Why
This prepares the console to be translated without translating anything yet. Fixing the host's English error messages, the module-level English formatters, and the joined-together sentences now means a translation later is just a new file. The label locale fix is a data-loss bug either way: renaming a label in a second language deleted its first.
How it was checked
npm run check(svelte-check, no warnings, andtsc -p shell),harness/strings.mjs,dialogs.mjs,layers.mjs, andoxfmt --checkpass.cargo test -p group-host --test moderation(the new locale merge steps) and clippy pass.e2eflows andjust shots --checkfind elements by their English text and compare screenshots, so they confirm the English is unchanged. They run on the runner;just e2epassed locally (37 flows), andjust shots --checkshowed only the differences listed above, drawn again.Shortcomings
app.csslays pages out with left and right, so a right-to-left language needs it changed to logical properties first.navigator.languages. Without a cookie, a browser whoseAccept-Languageandnavigator.languagesdisagree could hydrate in a different language from the server's. That can't happen with English alone.shell.ts) still sends sites the host's ownmessageinRefused, since that's the kit's API to site developers. Its sign-in failures are messages.Review
Start at
web/src/lib/errors.ts,locale.tsandhooks.server.ts, then a component with markup messages (MemberList.svelte,Permissions.svelte).web/messages/en.jsonis long but flat.