Repository navigation
Write the sign-in email in the language of the account it goes to - #965
Conversation
…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
The page, its signup view, the slot formatting and the state messages now
take their text from the `participant` namespace, in the signup's language.
Glued sentences are whole messages: the signed-up bar, the Closed banner's
"spot is / spots are", "N slots", and "(no {label})" with the label whole in
it. Counts use a `::group-off` skeleton, so English reads "1234 left" as
before rather than "1,234".
The organizer's text on these pages (the organizer strip, the Preview banner
and the disabled button's tip, the own-draft note) goes to the `organizer`
namespace, stays English, and is marked lang="en" where the element allows.
slot-format.ts takes a translator as an argument, typed with `import type`,
since the sign-up dialog imports it. The hard-coded-text lint rules are on
for the five files, and now also catch `detail`, props ending in Title, and
text keys of an object passed as a prop (`action={{ label }}`).
English is unchanged: the HTML differs from before only by the lang markers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
ClientMessages is a client component around next-intl's provider that passes the language, the messages and the time zone itself, so it never reads the request config. messagesFor, now exported from translator.ts, gives a server component just one namespace's messages with English under them, and a lint rule keeps every other file from importing the provider. The live signup page mounts it around the view that renders the dialog, and the edit page around its form. The name box's label, "Your name", is the first text a client component reads with useTranslations: the dialog and the edit form both show it, so both pages carry the runtime they'll need, and the four pages whose JavaScript includes it get their budgets raised by the measured amount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The rest of the sign-up dialog's text and participant-fields.tsx read their words with useTranslations, from the participant catalog the page passes ClientMessages: participant.dialog, fields, slot (its "N of M spots left" is the row's leftOf) and errors. messagesFor takes a list of namespaces for that. The Sign up button's two messages move from signupView to dialog, which the Preview and showcase stand-ins read on the server. The message helpers (capacity, closed, conflict, gone, name, rate limit, participantErrorCopy) take a translator instead of returning English, so the same code runs in the dialog, on the edit page, and on the server. The not-found pages build their copy with gonePage(t), and the e2e specs that read it build an English translator. Glued sentences are whole messages: plurals for spot counts and the rate limit's minutes, selects for the reminder clause and the calendar sentence, and tags around the slot and the address. Closing the sheet now gives the focus back to its Sign up button. Lint is on for the dialog, its fields, the helpers and the signup's not-found page. English is unchanged, and the four dialog pages' first JavaScript is 223 to 416 bytes smaller, so their budgets come down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
src/messages/sv.json holds Swedish for every participant message and the footer's common text, a first machine pass for #639's review to check. sv joins CATALOG_LOCALES, not SHIPPED, so nobody can choose it and every page stays English; DEFAULT_LOCALE=sv is now accepted and changes nothing until Swedish ships, which the README, .env.example, fly.example.toml and the CHANGELOG now say. The e2e seed adds a published Swedish signup, created through createSignup and given settings.locale 'sv' directly, since the service refuses a language that hasn't shipped. The server Playwright starts gets E2E_UNSHIPPED_LOCALES=sv, which lets signupLocale keep a stored language that has a catalog though it hasn't shipped. It ships nothing on its own: nothing in the app can store such a language. precompiled-messages, a11y and slot-row-layout run on the Swedish signup too, and a new spec checks the organizer strip and the Preview banner stay English, marked lang="en", over it. Slot dates and times now take a CatalogLocale rather than any string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
getOwnCommitment also selects the signup's settings->>'locale', in the statement it already ran, and returns it as signupLocale: the stored string or null, never the settings object. The unsubscribe preview does the same. The edit page and the unsubscribe page read it through signupLocale(), as the signup's own page does, pass it to the slot-name helpers in place of 'en', and mark their <main> with lang. Their words stay English for now. GET /api/commitments/[id] keeps its answer as it was: nothing reads the language from there, so the route leaves signupLocale out. A db test checks the answer has exactly the commitment's fields, the participant's name and email and the signup's slug, with no settings, on a signup whose settings hold organizer-only keys and a language. A broken or incomplete unsubscribe link takes the language of the signup its path names, as a broken edit link's not-found page does, sharing that page's cached read. No page or route sends another statement. Part of #630. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The sign-up sheet's Spots box is 80px wide in every language, and the
Swedish "Antal platser" wrapped there, pushing its input below the Notes
input beside it at every width. It now says "Platser", the term list's
word for a spot. slot-row-layout.spec.ts checks the sheet's field labels
fit on one line, and that Notes and Spots line up, in English and
Swedish down to 320px, so a longer translation fails the test rather
than the page.
Three more fixes in sv.json from the tophat's reading: the success
screens said "din plats på {slot}", a preposition that doesn't take a
slot's name, and now say "din anmälan till {slot}", as the edit link
already did; and the draft page said the link works "när den är
publicerad", which reads as the link being published, and now says the
list.
The server logs one warning at startup when E2E_UNSHIPPED_LOCALES is
set (src/instrumentation.ts), so an operator who sets it by mistake
hears about it. The edge build drops the branch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The participant's edit page (change or cancel a spot), its form, the cancelled and moved messages, and the unsubscribe page now read their words from the participant catalog in the signup's language, which #915 worked out. Their tab titles do too, from the read the not-found pages already make, so no request sends another statement. Sentences that were glued from pieces are whole messages: "You're editing this as {name} ({email})." and the unsubscribe page's "for", "at" and "sending" clauses each have a version with the address and one without, and "You can have up to N spots on this slot" is a plural. English reads exactly as before. Swedish for every new message goes in sv.json, in #914's terms. The hard-coded-text lint rules now cover the whole of src/app/s/[slug] (tests left out), and TEXT_PROPS takes the unsubscribe page's `error`. The Swedish e2e signup gains a cancelled sign-up and a participant who turned reminders off, and swedish-signup.spec.ts checks every state of the edit, cancelled, unsubscribe and broken-edit-link pages in Swedish. The edit page's JavaScript is 183 bytes smaller, so its budget comes down from 113.6 to 113.5 kB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
The participant pages word an error by its code, but `invalid_input` covers too much for that: a missing email, one that isn't an address, a blank or long name, long notes and a quantity out of range all share it, and the pages fall back on the server's English. Errors from signing up and from the edit link now name their case in `details.reason`, from a closed set (`ErrorReason`) that also takes in Magic Compose's `refusal` and `asked_again`. `fromZodError` takes a table of reasons by field path and Zod issue code (`COMMITMENT_INPUT_REASONS`, beside the commitment schemas), and the service adds `email_required` itself. An issue the table doesn't name, and every other error, carries no reason. The rest of each error is unchanged: `message` and `suggestion` stay English for API callers, and `details` is added last. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Brings in #914's address round (Swedish "Platser" label, sheet label-fit e2e, startup warning for E2E_UNSHIPPED_LOCALES, three sv.json fixes) so this PR stays on top of #914. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
Brings in #914's address round (via #915): the Swedish "Platser" label, the sheet's label-fit e2e, a startup warning for E2E_UNSHIPPED_LOCALES and three sv.json fixes, so this PR stays on top of #915. 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
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt
|
Approved by the owner at The owner approved merging the localization stack (#897 up to #999) in the orchestrating session on 16 November 2026: "Stop before launch: merge everything up to and including the simplification", with #999 added after it. https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt Generated by Claude Code |
scripts/lib/email-samples.ts (the pnpm email:dev and test samples) conflicted with #931 in two places, both kept: - imports: this branch's formatDuration, and #931's formatSlotTime beside formatSlotDate; - this branch's signIn(locale) sample, then #931's nineAm for the English confirmation's time. 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
|
catch-up after #963: markers on 1bf5963 stand (no own commits since, 0 runtime hunks; the restack changed only one guide table row). The first merge (#963's final head, which carries #931) conflicted in
The PR's own changed lines are identical to before; only context moved. On the merge, https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt Generated by Claude Code |
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
Fixes #949.
Merge after #963.
The stack
Phase 2 of the localization stack (#619), track B. Based on #963 (
claude/issue-948-sign-in-text); review against that branch.The problem
The sign-in email was the one email with its English written into it: the template's ten-odd strings in
magic-link.tsx, and its subject, "Sign in to OpenSignup", typed intosendVerificationRequest. So it couldn't follow the organizer's language, and it was the one file left out of the hard-coded-text lint rules (NOT_YET_TRANSLATED).The fix
7 messages in a new
auth.emailsection, English byte for byte as it read.src/email/templates/magic-link.tsx) takes alocale, as the participant emails do: its text comes fromauth.emailin that language, its<Html lang>says which, and both lifetimes are written in it (formatDuration(…, locale)). The address goes in through a<b>tag, as in the participant emails. The six-digit code, the link and the "OpenSignup" brand are untouched (Show the site's own name on the organizer and sign-in pages #884 owns the brand).signInSubjectinsrc/email/subjects.ts, beside the others;sendVerificationRequestand the email sample both call it. The preview text adds the address ("Sign in to OpenSignup as {email}"), so it's a message of its own in the template rather than the subject.signInEmailLocale(src/auth/sign-in-email-locale.ts): one read oforganizers.localeby the normalized address, handed togetOrganizerAppLocale, the organizer app's own rule. So it's the language stored on the account once it has shipped to organizers, else the instance'sDEFAULT_LOCALEonce that has, else English. An address with no account, or an account with nothing stored, gets the instance's language, which is the sign-in pages' (signInLocale).chooseOrganizerLocalewith the'organizer'audience. Show organizer text in the organizer's own language #954 has since wrapped that rule asgetOrganizerAppLocale, which also keeps the e2e run's unshipped languages, as the app does. Using it keeps the email and the screens it signs in to on one rule.magic-link.tsxis out ofNOT_YET_TRANSLATED. That left the list empty, so the list and itsignoresentry are gone; the comment onsrc/email/templatesinTRANSLATEDnow says it covers every email.scripts/lib/email-samples.tsbuilds the sign-in email for every language with a catalog (magic-link,magic-link-sv), its expected text (the button and the code's sentence) taken from that language's catalog, so a new language needs nothing written there.pnpm translation:screenshotswrites it out for the review with the participant emails.docs/translating.md(namespace table, which language, adding a language), thetranslateskill,getOrganizerAppLocale's andEmailLayout's comments, and a CHANGELOG line.Security and privacy
sendVerificationRequestreads the account only onceconsumeMagicLinkRateLimitshas charged the request to both buckets, so a request either one refuses reads nothing. A db test shows it: with the address's limit used up,signInthrowsMagicLinkRateLimited, the lookup never runs and nothing is sent. Moving the read above the rate limit fails that test (tried).SELECT locale … WHERE email = $1 LIMIT 1on the unique email index: a miss and a hit make the same index lookup, and a hit adds one row fetch, microseconds against the send the request already waits on (an SMTP or HTTP round trip). Auth.js already reads the account by address on every request, before our code runs (adapter.getUserByEmailin itssendToken, unchanged), so an account's existence already shapes the request's work that way; this is a second read of the same shape. A stored language changes only which strings render, at the same cost.auth.magic_link_sentkeeps its payload (emailDomain,expiresInMinutes): no language.issueLoginCode, the confirm URL and the callback URL are the same calls on the same values; the only lines changed insrc/auth/config.tsadd the read, passlocaleto the template and take the subject fromsignInSubject.English is unchanged
subjects.test.tsand in the db test through the real Auth.jssignIn.',+and&) before and after. The plain text is byte-identical. The HTML differs only by React's empty<!-- -->separators: they're gone where a sentence and its lifetime are now one message, and one appears where "Or copy this URL:" now sits before the<br/>as a piece of its own. That's the same as Write participant email subjects from the catalog, in the signup's language #919/Write participant emails from the catalog, in the signup's language #920's participant emails.magic-link.db.test.tspins the whole plain text.emails.test.tsxrenders every sample, both sign-in ones included, with both formatters and finds them equal.Statement budget
No change.
budgets.jsoncapsGET /s/[slug]andPOST /api/slots/[id]/commitments, which this doesn't touch, andquery-budget.db.test.tspasses on the same numbers. The sign-in request itself isn't budgeted; it gains one statement (the read) on each request the rate limit lets through.Client JavaScript
No change: the template and the lookup run on the server. Gzipped first load, base
788d291(#963) against this head, both built in this session's container: every page within −6 to +1 B (module ids);/login108,979 → 108,974 B. No budget moves.Gate: owner. It's sign-in (
src/auth/), it adds a read on an unauthenticated path, and it changes the privacy page. Nobody sees a change yet: English is unchanged and no language but English has shipped to organizers.Tests
src/auth/sign-in-email-locale.db.test.ts:signInEmailLocalefor each other catalog language: no account and nothing stored are English; a stored language counts once shipped to organizers, not when shipped to participants alone; the site default applies to no account and to nothing stored once shipped; a stored English beats the site default; an unknown stored value is passed over.signIn('nodemailer', …), with the transport watched: an address with no account gets "Sign in to OpenSignup" withlang="en"and the English intro; an account in another shipped language gets its subject and body from that language's catalog with itslang; an address with no account gets the shipped site default; and the rate-limited case above.test:dbrun). The test passes the real refusal on once the adapter has been asked to store the token, which makes it deterministic. That ordering is Auth.js's and predates this PR; in production Next logs such a rejection.magic-link.db.test.ts: the English plain text word for word,lang="en", the preview and the intro's HTML; and for each other catalog language, every word from its catalog with the values it was given (both lifetimes in that language), the code and URL as they are, and itslang.subjects.test.ts:signInSubjectin English and from the catalog in each other language.emails.test.tsx(the Swedish list gainsmagic-link-sv; every sample now goes through the precompiled catalogs),worker-render.test.ts(ok magic-link-sv),no-hard-coded-text.test.ts(the sign-in email is linted: it's in the translated files, and the "off for the sign-in email" case is gone). No expected English changed anywhere.Run in this session on the pushed head, all passing:
pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: 3163 passed, 1 expected fail.used-keys.test.ts(timeout) and twoQuestions.test.tsxcases (Magic Compose, untouched here). Both files pass alone, and the full rerun was clean.pnpm test:db: 838 passed,query-budget.db.test.tsincluded.pnpm build && pnpm budgets: every page within budget, no number changed.sign-in-text,login-code,login-form,organizer,oauth-consentand every help walkthrough (tests/e2e/help): 50 passed.node .claude/skills/help-pages/scripts/affected-articles.mjs origin/claude/issue-948-sign-in-text: no article describes the sign-in email. It flagscreate-and-publish-a-signupfor "What", which is CLAUDE.md's Email paragraph, not a screen.Overlaps
auth.email.subject,.previewand.headinginen.jsonrather thanconfig.tsand the template.scripts/lib/email-samples.tsaroundTEST_LOCALESand teaches the render check HTML entities. Whichever lands second mapssignInoverTEST_LOCALESand merges the two lists inemails.test.tsxandworker-render.test.ts.auth.email.subject,auth.email.headingandauth.headingshare their English, and should share their Swedish.src/auth/config.tsnear the lines this changes; a small merge for whichever lands second.🤖 Generated with Claude Code
https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt