Repository navigation
Test the organizer app in every test language - #1016
Conversation
Part of #620: the core. next-intl and use-intl 4.14.9, pinned together (icu-minify too, through an override), with next.config.mjs wrapped in next-intl's plugin. src/messages/en.json is the English catalog, and next-intl's AppConfig is typed from it, through the declaration the plugin writes, so a missing key or a wrong argument fails typecheck. src/i18n holds the pure locale config (CATALOG_LOCALES, SHIPPED), a synchronous translator on use-intl/core with English filled in under any other language, the server wrapper that logs what goes wrong, the request config the plugin needs, and an English translator for tests that throws. The site footer's labels are the first text in the catalog, so the translator is proven in a server component, on static and dynamic pages. A new check runs it under the worker's toolchain. No page's first-load JavaScript changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A local ESLint plugin in eslint.config.mjs, with one rule so far: opensignup/no-catalogs-in-client. In a file that opens with a 'use client' directive, it reports any import of a catalog in src/messages, or of the translators that load every catalog (src/i18n/translator.ts, server.ts and testing/translator.ts), since either would put that text in the browser's JavaScript. It reads the directive rather than matching paths, follows @/ and relative paths, re-exports, import(), require() and import paths built from a template, and lets type-only imports through, since those are compiled away. The message says why and what to do instead. The tests lint fixtures through the repo's own config, so they also prove the rule is on for the app's files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A unit test over src/messages/ checks every catalog against en.json: completeness per namespace, enforced for each language in SHIPPED for the namespaces its audience reads; every message compiles with icu-minify; placeholders, tags and select branches match English, and each placeholder takes the value English is passed; no key English lacks; and no English message the app doesn't use. Which keys the app uses comes from the type checker: a call whose signature is use-intl's Translator, its namespace from the keys it accepts, its key from the type of its argument, so helpers, props, aliases and typed tables are all seen, and a key or namespace it can't read fails the check. The audience namespaces move from a comment to AUDIENCE_NAMESPACES in src/i18n/config.ts. src/types/next-intl.d.ts imports next-intl, because an augmentation alone doesn't load its module: without it, code with no test importing next-intl typed every message key as a plain string. icu-minify is a devDependency at exactly 4.14.9, the version next-intl and use-intl resolve, and the pnpm override now points at it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Two rules, on only for the files and folders listed in TRANSLATED in eslint.config.mjs, which so far is the site footer: - react/jsx-no-literals with noStrings and ignoreProps, for JSX text; - opensignup/no-literal-text-props, a local rule for a string on aria-label, aria-description, title, placeholder, alt or label. noAttributeStrings would also flag every className and href. TRANSLATED takes paths as they are on disk. filesAt escapes them for the config's globs, since an unescaped src/app/s/[slug]/** matches src/app/s/s/ and not the [slug] folder, and stops lint when a path doesn't exist. The footer's license line is exempt with a comment. Also, from #891's review: no-catalogs-in-client follows a + chain that starts with a string, as it does a template, and denies every module in src/i18n/ to client files except those in CLIENT_SAFE_I18N (config), rather than listing the modules that load catalogs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A translation that kept a select's argument but dropped the select
(`Status: {status}` for English's `{status, select, open {Open} ...}`)
passed, and would show participants the code's value. The check now
reports `{status} isn't a select here, but is in English`.
From the same review:
- The check's program types translators against the en.json it just
loaded, written over src/messages/en.d.json.ts, so a stale declaration
no longer gives misleading lines. findUsedKeys now builds the program
itself, and the fallback for a stale declaration is gone, with its edge
case that could pick the wrong section. messages-declaration.test.ts
still fails on a stale file.
- Code in any `testing` folder and in src/mcp/evals doesn't count as a use.
- `t?.('key')` is seen.
- A test for the dot-in-key check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Turn on next-intl's experimental message precompiling, so the first
client component with translated text ships a small formatter instead of
use-intl's ICU parser: measured here at 3,470 bytes gzipped against
12,353 without it.
Under precompile the plugin's loader compiles every catalog the Next
build imports, the server's too, and a message with an argument, plural
or tag becomes an array. withEnglishUnder treated every object as a
section and went into those arrays, so each such message would have
rendered as its key path in the web process while vitest and the worker,
which read the raw JSON, stayed green. A message is now a string or an
array, and only a section is merged into.
The footer's "{INSTANCE_NAME} · AGPL-3.0" line becomes a message with an
argument, the first the app has, and a production-build e2e checks it on
a prerendered page, a page rendered per request and the public signup
page. A unit test runs next-intl's own loader over every catalog and
checks each message formats the same precompiled as from the raw JSON.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…ext-lint Brings in #892's review fixes (a7a10ed) so this PR stays on top of #892's final state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
formatSlotDate and formatSlotTime now take the reader's language as a
required `locale`, and so does everything that prints a slot's values:
renderFieldValue, slotDetails, summarizeSlotValues, formatGroupLabel,
buildMetaSegments, prettyHeader, and the two commitment services that name a
slot for the edit and cancelled pages. Every caller passes 'en' for now, so
nothing anyone sees changes.
A date is built from its parts as a UTC moment and formatted in UTC, so no
zone can move it to another day. English keeps today's output exactly,
including the hand-written 12-hour clock with its no-break space before
AM/PM; other languages get Intl's own ("lör 3 maj", "18:30" in Swedish).
formatSlotDate now formats only a stored YYYY-MM-DD. It used to fall back to
`new Date()` for any other string, in the host's zone; no caller relied on
that, as both checked isRealDate first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
filesAt escaped the characters a glob reads specially but not the backslash it escapes them with, so a listed folder named `a\b` became the glob `a\b/**`, which matches `ab/` and not `a\b/`. The backslash is now escaped in the same pass as the rest. filesAt takes an optional root so a test can list a real folder with a backslash in its name, made in a temporary directory, and check the glob with ESLint's own matcher. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…mpile Brings in #893's later commits (#892's final code, main, and the filesAt escaping fix) so this PR stays on top of #893. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…-format Keeps this PR on top of #894's current branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
main now holds #893 (7a9fada), whose final code this branch already had. The only conflict was the footer line #893 exempted from lint and this PR turns into a message; this branch's version is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…-format Keeps this PR on top of #894's current branch, which now has main (#893) merged in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Every formatter that named a language now takes the reader's as `locale`, and every caller passes 'en' for now, so English reads exactly as before: - format-duration: `formatDuration` and `waitInMinutes` write each amount with Intl (number, unit and plural), so "1 minute" and "2 timmar" both come out right. `locale` defaults to English, since some callers are sign-in and OAuth code that gets a language with its own text. - fit-text: Magic Compose's cut-off warning writes its limit with Intl.NumberFormat. - connected apps: the approval, last-use and expiry dates go through `formatGrantDate`, which keeps English in the day-first order the page has always shown. - Magic Compose: `formatOneDay`, `appendAnswers` and `timeLength` take a locale, and `MagicComposeRoot` passes one down to Compose (the character count), Questions, Drafting and DraftingFrom. English times keep "9am"; other languages get Intl's short time, as slot times do. The participant rate-limit message now writes its plural in its own sentence from `waitMinutes`, as Magic Compose's hourly-limit message does, so the plural moves into the catalog with the sentence and Intl's unit code stays out of the participant pages, which had 5 bytes of budget left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…er-formatters Keeps this PR on top of #895's current branch, which now has main (#893, #894) merged in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…le change Part of #625. A signup can now hold a language in settings.locale, and an operator can set DEFAULT_LOCALE. Nothing reads either yet, so pages, emails and the AI connector's tools are unchanged. - settings.locale is a lenient string, so a stored language that has left the list still parses. createSignup and updateSignup refuse a language the caller sends unless it has shipped to participants; updateSignup checks only a sent one, as it does for groupByFieldRefs, because it merges the stored settings under the patch before parsing. - resolveLocale and defaultFor in src/i18n/config.ts, pure, with isShipped. - DEFAULT_LOCALE in src/lib/env.ts, an optional enum of the catalog languages. - locale joins UNREAD_SETTINGS, so update_signup refuses it and get_signup hides it until something reads it. - .env.example, fly.example.toml, the README and the CHANGELOG say what it does, that it changes nothing until a second language ships, and where a runtime variable goes on each platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…anguage ships The Settings tab gets a "Signup language" form, a plain form like "Ask for an email address" with no script of its own. It renders only once a second language has shipped to participants, so nothing shows yet. Each language is named in itself (English, Svenska), through Intl.DisplayNames. Saving sends only `locale` through updateSignup, which refuses a language that hasn't shipped; a refusal shows the tab's usual error. A signup with no language of its own shows the instance's, so instanceDefaultLocale() comes in here with its first caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
TIME_ZONE moves from src/i18n/config.ts to its own src/i18n/time-zone.ts. Browser code reaches it through src/lib/slot-label.ts (the Build tab's time picker and Magic Compose), which made config.ts part of the code those two share. Webpack counts a module's unused code when it decides whether shared code gets a chunk of its own, so the language rules this branch added to config.ts tipped it into making one. That chunk's entry in the webpack runtime added 29 to 47 bytes to every page and pushed /s/[slug]/c/[id] over its 110 kB budget. With config.ts out of the browser's graph, every page's JavaScript is byte-for-byte the size it was on the base branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…sent A settings.locale longer than 35 characters (or not a string), written straight into the database, failed the whole settings parse: the signup asked for an email the organizer had turned off, and every settings save failed on a field nobody sent. The schema now reads such a value as no language (.catch(undefined)), so a stored value can never break the row, and an unrelated save drops it. createSignup and updateSignup check the raw value the caller sends instead of the parsed one, so a too-long, non-string or unknown language is still refused with invalid_input on settings.locale (now with the service's own message, where a too-long one used to get zod's). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The README, .env.example and CHANGELOG said a language "takes effect only once OpenSignup ships it", with a Swedish school as the example, which reads as "set sv now and it will start working later". In fact any value but en stops the app: the worker exits at startup and every page that needs the database fails with an "Invalid environment" error. They now say that, tell operators to leave it unset for now, drop the example, and put what an unset value means in the future tense, since nothing reads an organizer's browser language yet. fly.example.toml says the same in one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
In a file of its own, the form was a second server module importing AsyncSubmitButton, and webpack then added a few bytes to that button's module on every page that loads it. Inline in page.tsx, every page's first-load JavaScript is byte-identical to the base. The test now renders the Settings tab itself, so it also checks the page shows the form, and that "Saved" appears only by the form that saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
#896 merged, so main now holds this branch's base. The one conflict, src/lib/slot-label.ts, is between #895 and #896 as squashed on main and the same commits in this branch's history; main's copy equals #896's head, so the branch's copy (with TIME_ZONE from its new module) stands. The merged tree is identical to the branch's before the merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…ettings-control Takes #897's address round: TIME_ZONE out of config.ts, the lenient read of a stored locale, and the docs on DEFAULT_LOCALE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
chooseOrganizerLocale takes the organizer's saved language, the instance's DEFAULT_LOCALE and the browser's Accept-Language header (null where there is no browser, as for MCP) and returns the first that has shipped to the audience asked about, else English, with the step that chose it. Only the browser's top-ranked range counts, so "sv,en;q=0.8" gives English until Swedish ships rather than settling for the second choice. It lives in its own file, away from server.ts (which the worker imports) and from next/headers. The column, the session field and the request wrapper come later. Part of #626. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
getSignupRowBySlug reads the live signup at a slug in one statement, skipping deleted rows and keeping drafts and archived ones, so the page can still say which. getPublicSignup takes that row, or a slug as before for the public API, and loadPublicSignup now gets its row from the new cached loadSignupRowBySlug. A layout that reads the row too (a later part of #628) then adds no statement to GET /s/[slug]. A unit test stands a per-request cache in for React's and checks the page's read goes through loadSignupRowBySlug and hands getPublicSignup the row, not the slug. The query-budget test says why it counts the page alone. Both page budgets stay at 5 and 6. Part of #628. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The fake-language run found a second one beside KEEP_IT_PRIVATE: main's `inSentence` in src/i18n/config.test.ts, how each language writes each language's name in a sentence, which typecheck asks a row and a column of. The guide and the translate skill said only `pnpm test` would name one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The seed now makes, in each test language, an organizer whose account stores it, with a signup of their own in each state. translated-organizer.spec.ts walks that organizer through making, building and publishing a signup and opening Responses and account Settings, and fails on English left on any of those screens where the language's catalog has a message, or on <html lang> or the app's wrapper saying another language. It also measures the signup's tabs and header buttons down to 320px. The accessibility spec checks Your signups and the Build tab in each language, and the organizer screens join the translation screenshots. Each help article's on-screen names now say where they are in the English catalog (FROM_CATALOG), and src/help/ui-names.test.ts checks the two still agree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The no-English check took a word out of a language's pattern whenever that language's own catalog wrote it, so a message left in English in the catalog switched the check off on the very page it should catch. Now SHARED_WITH_ENGLISH lists, by language, the words of ENGLISH_WORDS a language really writes as its own (none for Swedish), and only those leave the pattern. The catalog scan stays, only to word the failure: it names the messages that write the English words found. The check also runs on innerText as well as textContent: textContent runs one element's text into the next, so a word at an element's edge slipped past the word boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…guage' into claude/issue-952-organizer-tests-per-language # Conflicts: # CLAUDE.md
The organizer smoke built its own list of English words from the catalogs, so, like the participant check before #935's fix, a message left in English in a language's catalog took its words off the list on the very page it should catch. It now runs the same check as the participant pages, moved to tests/e2e/helpers/no-english.ts: ENGLISH_WORDS, gaining the organizer app's buttons, tabs and statuses, less the words SHARED_WITH_ENGLISH declares a language says too, over textContent and innerText, with the catalog scan only naming the messages that write a word it finds. Until a language ships, the smoke writes it into the signup it makes (storeSignupLanguage, as the story spec does), so the signup's own words are in the organizer's language, as they will be once it ships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Tophat: passedRan da8b94e locally as a production build (
CI on da8b94e is green (lint-type-test, e2e, CodeQL). Notes on what the screenshots show. None of these come from this PR, and none blocks it:
Screenshots are in https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt. Generated by Claude Code |
richshaw
left a comment
There was a problem hiding this comment.
Review: passed (round 1)
Tests and docs only, and it does what #952 asks. Each test language gets a seeded organizer who stores it. translated-organizer.spec.ts walks that organizer through every screen in the issue's list (Your signups, New signup, Build with the Fields dialog and a slot's editor, publish and the share panel, Responses, account Settings). On each it checks <html lang>, the wrapper's lang and the no-English check, and it measures the tabs and header buttons at 320, 390 and 768 px. Axe runs on Your signups and the Build tab, the organizer screens join the translation screenshots, and src/help/ui-names.test.ts holds each help name to its message in en.json.
What I looked at hardest:
- The shared no-English check is stricter for
translated-signup.spec.ts, never looser.tests/e2e/helpers/no-english.tsis #935's code moved as it was: the same pattern, the same two matches (textContentandinnerText), the same guard against an empty list. The participant scan reads the same three namespaces, now fromAUDIENCE_NAMESPACES.ENGLISH_WORDSonly grew.SHARED_WITH_ENGLISHis still a declared table, typed to the word list, with Swedish empty, and the catalog is read only to word the failure. - The new words on Swedish pages. Of the added words,
sv.jsonwrites onlydraft, as aselectbranch name in two messages, which never reaches a page. "the", "and", "you" and "your" are matched in lower case as whole words. A later language that writes one as its own ("and" is a noun in Danish and Norwegian, "Help" and "Account" are Dutch) declares it, which is what the table is for. - The help check does catch a rename. I reworded
organizer.responses.remove.buttoninen.json; the test failed withUI.remove is "Remove", but organizer.responses.remove.button is "Take off", naming the article. Keys are explicit (FROM_CATALOG), its type asks for an entry per name, and the test compares the two key sets as well. Reverted. - It survives the launch. With
svadded to bothSHIPPEDlists and a rebuild, the three specs pass (43 of 43): the smoke skipsstoreSignupLanguage, and the new signup starts in the organizer's language by itself. Reverted.
Blocking (0): none.
Optional (4):
tests/e2e/translated-organizer.spec.tsline 257:if ((await bar.count()) > 0)skips the bottom-bar measure without a word ifdata-phone-baris ever renamed, and line 234's loop over.all()passes with no tabs. Expecting the bar on the draft and the open signup, and at least one tab, would close both.- Line 204: the
organizer-responsesscreenshot shows the tab's count and the bar at 0 beside one sign-up (the tophat's note; it's the same in English, since the header refreshes only on a reload). Apage.reload()before the shot would stop a translation reviewer taking the 0 for a mistake. - Flakiness, for the record and not against this PR: neither new spec fails on React's hydration error (#418) itself. The label-fit test is the most exposed to a slow hydration: it clicks the three dots straight after
page.gotosix times per language (line 265), and a click that lands before hydration is lost.a11y.spec.tsline 313 does the same once. Three local runs passed, with the smoke at about 4 s and label fit at about 6 s per language. - For the launch PR (nothing in it must change for these tests to pass): after it, no language runs the
storeSignupLanguagebranch (line 138), so say so indocs/translating.md;unshippedHint(line 69, and ina11y.spec.ts) will end in an emptyE2E_UNSHIPPED_LOCALES=; and the spec's header comment that the fields keep the names "What" and "Date" stops being true once a new signup's fields are named in its language (the spec already reads the name from the API, so it passes).
Earlier threads: none. Copilot answered that it couldn't review (quota).
Checks: CI is green on da8b94e (lint-type-test, e2e, CodeQL). Locally on da8b94e: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass (243 files, 3458 tests); pnpm build passes; translated-organizer, translated-signup and a11y on chromium pass 43 of 43, three runs in a row, and once more with sv in both SHIPPED lists. The tophat passed on this SHA (ux=no), and no runtime code has changed since. The branch is behind main by #1015, which merges cleanly (it touches docs/translating.md and the translate skill too, in other places).
Gate: auto. Tests and docs only; src/help gains data only a test reads, and nothing on the high-risk list is touched. No personal data (fixtures use example.test), no secrets, no model names.
https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Generated by Claude Code
#1016 added translated-organizer.spec.ts, which already saves the organizer screens on the way to a published signup. Keep that as the base, and from organizer-language.spec.ts save only the screens and states it doesn't reach, under names that don't clash with its own. Drop the Build tab spec's shots, which repeat main's, and the note that account Settings' language choice has no screenshot, which #1019 made untrue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVwh9pcQeEc28jgf1b
Fixes #952.
Merge after #935. #935 has landed on
mainasba54e25, so this PR now targetsmain.The stack
Part of the localization stack (#619). This PR was built on #935 (
claude/issue-637-tests-every-language), which added the per-language test setup. Once #935 was squash-merged, this branch merged its final head8321c30and recordedba54e25with-s ours; the two trees are identical. The diff againstmainis this PR's work alone.The problem
The participant side has tests in every test language (
TEST_LOCALES), but no seeded organizer stores one, so no test walks the organizer app as such an organizer would, and nothing checks all of a screen's text for English. A screen, or a part of one, that forgets the organizer's language renders English inside a translated app. The tabs and header buttons were never measured with longer words, the organizer screens weren't in the translation screenshots, and nothing checked that a help article's on-screen names still match the catalog's English.Where the issue was out of date: it says "the organizer side has none". Since it was written,
organizer-language.spec.ts(#937 and the extraction PRs) checks each organizer screen's messages one by one in every catalog language, with axe on Your signups and Responses, andorganizer-language-story.spec.tsfollows one organizer from account Settings to a participant's email. This PR doesn't repeat those. It adds what they don't have: a seeded organizer, a whole-screen check for English, axe on the Build tab, label fit, screenshots and the help names check.The fix
A seeded organizer per language (
tests/e2e/helpers/seed.ts,makeOrganizerIn, throughglobal-setup.ts):seed.languages[locale].organizerstores the language on their account, has a session of their own, and owns a signup in each state (open with sign-ups, a draft, closed, archived), made by the samemakeSignupsInas the language's test signups. The language is written into the row, and the server shows it throughE2E_UNSHIPPED_LOCALES(#937).tests/e2e/translated-organizer.spec.ts, for eachTEST_LOCALESlanguage:The smoke. As that organizer: Your signups, New signup (Magic Compose's first screen too, where the server has an AI), create a signup, its Build tab, its Fields dialog, fill its slot in the slot editor, publish it (the share panel), a sign-up through the API, Responses, then account Settings from the header. On every screen,
<html lang>and the app wrapper'slangare the language (Organizer pages say lang="en" on <html> whatever the organizer's language #938/Set the organizer pages' html lang to the organizer's language #1011), and the no-English check passes on the wrapper (header and page) and on any open dialog, which must be in the language too. Until a language ships, a new signup doesn't start in it (newSignupLocale), so the smoke writes it into the signup's row (storeSignupLanguage, whichpublishForParticipantsnow uses too), asorganizer-language-story.spec.tsdoes. The signup's fields keep their names, "What" and "Date", which the check doesn't look for.The shared no-English check (
tests/e2e/helpers/no-english.ts,noEnglishCheck) is Run the translation tests for every language with a catalog #935's check, moved out oftranslated-signup.spec.tsso both specs run the one copy:ENGLISH_WORDS, now with the organizer app's words too (Publish, Share, Preview, Build, Responses, Settings, Fields, Delete, Done, Close, Reopen and the like, plus "the", "and", "you", "your");SHARED_WITH_ENGLISHdeclares a language says too (Swedish: none);textContentandinnerText;None of the added words is in Swedish's catalog, and
translated-signup.spec.tspasses with them.Label fit. On the organizer's draft, open and closed signups, at 320px and 390px: each tab's name, Help, Account and Sign out, the bottom bar (Publish and share, or the count and Share), and the three dots' sheet items (Preview, Close signup or Reopen signup) must sit on one line and not be cut off, and the page must not scroll sideways. At 390px every tab must be in view. At 320px the strip scrolls sideways, which it already does in English (330px of tabs), so only each name is held whole. At 768px, the narrowest computer header, Preview and Publish and share, Share or Reopen signup are checked too. The measure (
tests/e2e/helpers/label-fit.ts) counts lines from the text alone, so an icon beside a label isn't counted as a line of its own.Accessibility (
tests/e2e/a11y.spec.ts): axe (WCAG A/AA) on Your signups, and on the Build tab both as it loads and with a slot's editor open, for each language, as the seeded organizer.Screenshots: the smoke saves
organizer-dashboard,-new-signup,-compose(with an AI set up),-build-new,-build-fields,-build-slot,-share,-responsesand-account-settingsthroughtranslationShot.pnpm translation:screenshotsandTRANSLATION_SPECSinplaywright.config.tsnow include the spec, at desktop and at the phone width.Help names check (
src/help/ui-names.test.ts): each article's.ui.tsgainsFROM_CATALOG, theen.jsonkey of eachUIname. A list is used where one name stands for several controls, such as Save in the Fields dialog and the Settings tab, and values where the message has placeholders (Set {label}). Its type requires an entry for every name. The test, registered throughHELP_BODIESasuiis, fails when a message's English no longer equals the name, and says which article to change. Every name today comes from the catalog.new-article.mjsscaffolds and registersFROM_CATALOG.Docs:
docs/translating.md("Adding a language", withSHARED_WITH_ENGLISH's new home; "How translations are made and checked"; the screenshots section), thetranslateskill and its review prompt now say the organizer side runs these checks and has screenshots.CLAUDE.md, thehelp-pagesskill anddocs/writing-help.mdcover the new checks.Proof that the checks catch what they're for
English left in the catalog. I set
organizer.signup.publish.labelinsv.jsonto its English ("Publish and share") and rebuilt. The Swedish smoke failed on the Build tab:With the message restored, it passes. Under the first version of this PR, which built its word list from the catalogs, that same change would have taken "Publish" off the list and passed.
The other checks:
organizer.signup.publish.labelandorganizer.build.empty.namedinen.jsonfailed the help check, naming both.None of these changes was committed.
Bugs found
None. Every Swedish organizer screen the smoke visits passes the no-English check, both axe checks pass, and every label fits at 320px, 390px and 768px.
One unrelated flake: in the first full e2e run,
root-layouts.spec.ts› "signing out … lands on the home page" reported a hydration error (#418) and a 404 on the home page after sign-out. It passed 3 of 3 times on its own and in a second full run. It comes from #1011's test, and this PR changes nothing it touches.A fake language
Locally, and never committed:
de.jsoncopied fromsv.json,deadded toCATALOG_LOCALES,CATALOGSandinSentence, then a rebuild.translated-organizer,translated-signup,a11yandorganizer-language-story: 80 passed, 35 of them German. That includes the German smoke, label fit, both axe checks and the participant pages, with the longer word list.deon both projects.pnpm test: onlyKEEP_IT_PRIVATEfailed. It asks each language for its entry by design.Tests
On the final head:
pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: pass (243 files, 3458 tests). One run timed outused-keys.test.tsunder machine load; it passed alone and in a full rerun.pnpm build: pass.translated-organizer,translated-signup,a11y,organizer-language-storyandorganizer-language: 76 passed, 4 skipped (Magic Compose's AI-only tests, no AI on this server).On the first commit (
3f3857a); none of the later changes touches services or the app:pnpm test:db: pass (47 files, 857 tests).pnpm translation:screenshots: pass (12 email tests, 58 e2e tests).No CHANGELOG entry: tests and docs only, and nothing a person using OpenSignup or a self-hoster would notice.
src/help/bodies.tsxgains a field only tests read, asuialready is.🤖 Generated with Claude Code
https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt