Repository navigation
Move the share panel's text into the catalog, and write its message in the signup's language - #961
Merged
Merged
Conversation
…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
…text Part of #626. Adds organizers.locale, a nullable text column (migration 0015, add-only), and reads it in the query loadOrganizerSessionById already runs: one more selected column, no new statement. The raw saved value, or null, travels on OrganizerSession, on the bearer seam's resolution and into the MCP ToolContext, since tool handlers may not query the database. It stays off Actor, so a cookie and a token for the same organizer still give the same actor. Nothing sets the column or follows it yet. signups.claim_token_hash is out of the schema but still in the database until a later release (#820), so drizzle-kit wanted to drop it too. The migration was generated with that field put back in the schema for the run, so its diff is only the new column and the snapshot still matches the database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…nd ships updateOrganizerLocale saves the acting organizer's own language, refusing anything that hasn't shipped to participants, and anyone who isn't an organizer. Account Settings gets "Language for new signups", a plain form that renders only once SHIPPED.participant has two languages, showing the saved language or the one getOrganizerLocale would pick. The privacy page says the account holds that choice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A new signup made through POST /api/signups, the New signup form or Magic Compose now takes a language: the one an API caller sent, else the organizer's (saved, the instance's DEFAULT_LOCALE, the browser's top language, English). The route decides and passes it into createSignup; persistDraft takes it as an option. While only English has shipped to participants nothing is stored unless the caller sent a language, so no signup is pinned to one nobody chose. signup.created records locale and localeSource for a signup created with a language, documented in docs/telemetry.md and on the privacy page. Part of #627. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The AI assistant's create_signup now gives a new signup a language the same way the browser does (#905), finishing #627: - An optional `locale` on the tool's input (added with .extend(), not on FullDraftSchema, which is also Magic Compose's output schema). It is stripped from the draft and passed through persistDraft's `locale` option with source `api`. - Without one, the signup takes newSignupLocale with the organizer's saved language (ctx.locale) and no browser: an assistant's Accept-Language is its vendor's. While only English has shipped to participants that stores nothing, as before. - A language that hasn't shipped is refused with invalid_input on `locale`, with the REST API's message and suggestion, before any quota is spent or anything created. createSignup's check is exported as checkSignupLocale, with the field name as a parameter, so both say the same thing. - signup.created records locale and localeSource as for the browser, next to viaClientId. The tool description says what locale does and which values it takes. docs/connect-ai-assistant.md, docs/telemetry.md and the CHANGELOG say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The signup page, its draft and archived messages, its not-found message and the organizer's Preview now take the signup's language from its row and pass it down: to the slot date and time formatters (which were given 'en'), to the state messages (as `lang`), and to og:locale in the page's openGraph. One rule picks the language, `signupLocale` in src/i18n/config.ts: the stored `settings.locale` once it has shipped to participants, else the instance's language for participants. It replaces `resolveLocale`, which nothing outside its tests called and which kept a stored language that has a catalog but hasn't shipped, where the Settings tab's language form shows the instance's. The form now calls `signupLocale` too, so the choice an organizer sees is the one participants get. The page reads the language from the same cached row as `loadPublicSignup`, so both GET /s/[slug] budgets stay at 5 and 6. A draft's or archived signup's row gives the page only its language. While only English ships every signup reads as English, so nothing anyone sees changes except og:locale (en_US) on a signup's link preview. Also tests the `deletedAt` check in getPublicSignup on a row read some other way, which nothing reached since the slug read skips deleted rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
A not-found page gets no params, so the not-found pages under /s/[slug] couldn't tell which signup they were under. The middleware now also runs on /s paths and copies the path alone (never the query, which on an edit link is its token) into a header of its own, x-opensignup-signup-path, with set, so a client can't supply it. It never touches the organizer callback header, which stays /app only, so nothing on a public page can choose where sign-in sends someone. Both not-found pages read the slug from that header and take only the language from the cached row (loadSignupRowBySlug, the signup page's own read), through signupLocale; a path with no plausible slug gets the instance's language without a lookup. The helper that does this for the signup page's draft and archived messages moves into signup-locale.ts so all three share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Take locale out of the MCP tools' UNREAD_SETTINGS, so get_signup and the results of create_signup and update_signup show the stored settings.locale, and update_signup takes one. Its settings schema takes the language as sent, not through the stored schema's lenient read, so updateSignup refuses an unshipped one with the REST API's message and null clears it, rather than a long string or a non-string quietly clearing the stored value. GET /api/public/signups/[slug] gains settings.locale: the language the signup's page is in (signupLocale), never a stored value no participant gets. Also: create_signup's locale gets a .describe(); SignupLocaleSource moves to the pure organizer-locale.ts; signupLocale's comment no longer says emails follow it; a telemetry.md wording fix; CLAUDE.md says a tool handler may run a pure check of its input; docs and CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Fifteen test files each carried their own copy of a function that changes SHIPPED to ship Swedish for a test, with an afterEach to put it back. The shared helper in src/i18n/testing/ship.ts does both: it changes the list for the test it's called in (or each test of a beforeEach), and restores every audience's list once the test finishes, whether it passed or threw, through vitest's onTestFinished. The test files now call it and drop their copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
…rops
SiteFooter takes `locale` and asks for its text in that language. Help,
legal, sign-in and the landing page pass English; so does the participant
layout for now, since it sits above [slug] and has no signup to read. The
footer never works out a default itself, because static pages must not call
getEnv().
Banner's ✕ ("Dismiss") and BottomSheet's ✕ ("Close") were the last English
in those two components. Each now takes the name as a prop (dismissLabel,
required whenever there is a ✕, and closeLabel), never from a translation
hook: organizer pages use both components and have no messages provider.
The organizer callers are client components whose other text is still
English, so they pass "Dismiss" and "Close" as literals and keep the
catalogs out of their bundles; the sign-up dialog passes "Close" until its
own text moves to the catalog. Every name reads as before.
Lint: the hard-coded-text rules are on for banner.tsx and BottomSheet.tsx as
well as the footer, and leave test files out (which matters once a folder
is listed). The text props now include body, eyebrow and description, and
any prop whose name ends in Label, so text passed through a shared
component's props is caught too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Next.js 15.5.29 on main adds about 0.1 kB to the page. Measured after pnpm build on this branch: 119.650 kB, so 119.6 → 119.7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
budgets.json conflicted on the Build tab line (this branch 151, #967's 151.3 after #962's Next.js 15.5.29 raise). Took 151.3 here; re-measured below. 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
Measured after pnpm build on this branch, with Next.js 15.5.29 from main: - /s/[slug]/c/[id]: 113.608 kB, over 113.6, so 113.7. - /app/signups/[id]/build: 151.106 kB. This branch had lowered it to 151 before main's Next.js raise; the catch-up took main's 151.3, and 151.2 is the measured figure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
budgets.json conflicted on a budget line #968's branch had re-measured for Next.js 15.5.29. Took #968's number here; re-measured below. 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
Measured after pnpm build on this branch, with Next.js 15.5.29 from main: 151.347 kB. This branch had raised it from 151 to 151.3 for its own change; with Next.js on top it needs 151.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
budgets.json conflicted on a budget line #970's branch had re-measured for Next.js 15.5.29. Took #970's number here; re-measured below. 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
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
docs/translating.md conflicted: #931 (through #977) turned the glossary's open questions into a "Settled" list, and this branch had added a question about the Build tab's drag refusals to the old list. Kept #931's settled list and moved this branch's question, unchanged, under "Open questions". 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
docs/translating.md conflicted: #931 (through #981) turned the glossary's open questions into a "Settled" list with an "Open questions" section after it, and this branch had added two questions from #982's review to the old list. Kept #931's settled list and added this branch's two questions under "Open questions", beside #981's. 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
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
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
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
Owner
Author
|
catch-up after #957: merges only, own diff unchanged, markers stand (review and tophat on 039ba3e). Across the restack ( https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt Generated by Claude Code |
richshaw
pushed a commit
that referenced
this pull request
Nov 16, 2026
src/app/login/page.tsx conflicted in its imports: main (through #961) added ipSubject to the rate-limit import, for the per-IP login code limit, and this branch added the signInLocale and getServerTranslator imports beside the same line. Kept both. The body merged on its own: the code limit keys on ipSubject(...) as on main, and the page's text comes from the catalog as on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
richshaw
pushed a commit
that referenced
this pull request
Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
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.
Fixes #942.
Merge after #957.
The stack
Phase 2 of the localization stack (#619), track B. Based on #957 (
claude/issue-941-signup-header-text); review against that branch.The problem
The share panel had its English written into its components: the panel, its QR code, the public link's chip and the header's Share button. So it couldn't follow the organizer's language. The message it offers to send with the link was English too ("Sign up here, no account needed: …", "21 spots open", the dates). The people it goes to read that message, so it belongs in the signup's language, not the organizer's.
The fix
38 messages under
organizer.shareand 7 underparticipant.share, English byte for byte as it read.shareText(t, title)(components/share/share-text.ts) builds them on the server in the organizer's language.SignupHeadermakes them once from thelocaleit already has.ShareScopeholds them for both headers' Share buttons.ShareButtonpasses the panel's part toSharePanel, which passes the QR code's part on.ShareUnavailabletakes the panel's part too.textprop in the header, under the title on a phone, and in the fallback.ClientMessages, so the pages send no messages and no next-intl runtime.signupLocale(sig.settings.locale, instanceDefaultLocale()), as the signup's own pages and the Build tab do, and passesshareMessagea translator forparticipant.sharein that language. Its dates and times go throughformatSlotDateandformatSlotTimein the same language. The organizer's language reaches only the panel around the message. Saving a new language in the signup's Settings tab revalidates the layout, so the message follows.shareMessage(signup, url, language, committedBySlot)takes{ locale, t }. The translator is passed in because the panel importswithLinkandemailBodyfrom the same file, and building one there would put every catalog in the browser.Intl.ListFormatwould have changed the English, with its Oxford comma. The·between the parts is a named constant (a mark, as Move account Settings and Connected apps text into the catalog #956's is).{count, number, ::group-off}, so English still reads "1234 spots open".spotCountis gone: its counts are the plural messages now. Its test went with it. The share message's tests still cover "1 spot open", "N spots open", "1 spot left" and "N spots left".TRANSLATEDgainssrc/components/share(whole folder) andPublicLinkChip.tsx.ShareButton.tsxandShareScope.tsxleaveNOT_YET_TRANSLATED, which now holds only the sign-in email.no-hard-coded-text.test.tslists the files.docs/translating.mdnames the share panel in the namespace table, and says whyparticipant.shareis in the signup's language though organizers see it. The CHANGELOG's The organizer app ignores the organizer's language #937 line names the panel and the message's language.Checked against the code:
participant.dialog.shareText). This message was still English, so it's translated here, as the issue asks.Left as they are:
lang, though the panel around it is in the organizer's. That's signup content in the organizer app, which is Signup content in the organizer app isn't marked with the signup's language #951's.<html lang>, so itslangis the page's until Organizer pages say lang="en" on <html> whatever the organizer's language #938. The same goes for Move a signup's header, tabs and status labels into the catalog #957's sheets. The e2e checkslangon a computer's popover only.Client JavaScript: base and head built in this session. Every signup tab is a few bytes smaller (gzip):
/app/signups/[id]and/edit: 129,479 → 129,468 B/build: 147,456 → 147,446 B/responses: 130,906 → 130,897 B/settings: 130,421 → 130,418 BThe panel's own chunk, which no first load carries, is 7,587 → 7,400 B. No budget moves.
Gate: auto. Nothing people see changes: English is unchanged, a signup can only store a shipped language (English), and no budget rises.
Tests
share-text.test.ts: every word in English, as literal strings, and each one from the catalog in each other language.share-message.test.ts, per other catalog language:participant.sharein that language (range, day and time, two days, three days, open, left, the sign-up line), with the time in that language;ShareButton.test.tsx: after Publish, the heading, Published, the announcement, the lead, the link box, Copy link, the message box (holding the signup's message), Copy message, Email it and ✕; then Share's later heading and lead, and a phone's sheet and its ✕.SharePanel.test.tsx: Share… and its line, and a refused copy, Link copied and Copied.ShareQrCode.test.tsx: the code's name, line and Download on a computer; QR code, Hide QR code and Save image on a phone.load-share-panel.test.tsx: the fallback's line and its chip.SignupHeader.test.tsx: the chip's label, names and tips in both headers, and Share on a computer and in a phone's bar.textprops.shareMessagecalls also gained an English language argument. No expected text changed in any existing unit, e2e or help walkthrough spec.tests/e2e/organizer-language.spec.ts, for an organizer with nothing stored and one who stores each other catalog language:lang, lead, Copy link, the QR code's button, Copy message and Email it on a computer, ✕);publishSignupIn(organizer, locale), called by that test, so the other tests still count two signups.OrganizerIncarriesworkspaceId.Run in this session on
039ba3e, all passing:pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: 3121 passed, 1 expected fail.used-keys.test.ts's TypeScript-program test, at a load average of 13. The test passes alone, and the same timeout shows in an earlier run of this stack.pnpm build && pnpm budgets: every page within budget, no number changed.organizer,public-link-chip,a11y,precompiled-messagesand every help walkthrough (tests/e2e/help): 55 passed;organizer-language: 18 passed, and 18 more at a Pixel 7's size in Chromium./opt/pw-browsers/chromiumthrough a config that isn't committed.pnpm test:dbnot run: no service,src/db,src/mcp,src/oauthor job changed.Overlaps
organizer.share, and someone must also translateparticipant.sharebefore Swedish ships to participants. The completeness check counts it then.lang) could mark the message box with the signup's language.src/app/app/**. This PR adds no paths under it: the layout's entries are Move a signup's header, tabs and status labels into the catalog #957's.🤖 Generated with Claude Code
https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt