Skip to content

Translate organizer refusals, a signup's Settings tab and Responses into Swedish - #977

Merged
richshaw merged 232 commits into
mainfrom
claude/issue-953-sv-batch-a1
Nov 16, 2026
Merged

richshaw merged 232 commits into
mainfrom
claude/issue-953-sv-batch-a1

Conversation

@richshaw

@richshaw richshaw commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Part of #953 (track A batch 1: refusal messages, a signup's Settings tab, Responses and the CSV).

Merge after #971.

The stack

Phase 2 of the localization stack (#619), track A. Based on #971 (claude/issue-944-reword-build-errors); review against that branch.

The problem

Each organizer area moved into the catalog lands in en.json only, so sv.json has no organizer namespace yet, and Swedish can't ship to organizers until it's complete. This batch covers the track A areas that are finished: the refusal lines (#959), a signup's Settings tab (#960) and Responses with its CSV (#964).

The fix

  • src/messages/sv.json: 72 new messages:

    • organizer.errors (13);
    • organizer.signupSettings (19) and organizer.saveNotice (1);
    • organizer.responses (39).

    Keys follow en.json's order. Every placeholder, plural and select is kept. en.json is untouched.

  • src/i18n/translated-from/sv.json: mark-translated.mjs sv organizer.errors organizer.signupSettings organizer.saveNotice organizer.responses marked the 72 as translated from today's English, so the stale check catches later English changes. It marked 72, dropped 0 and skipped 0.

  • The glossary isn't changed here. Translate the organizer strip, header, settings and share panel into Swedish #976 (track B batch 1) adds the Swedish glossary's "Organizer terms" section and owns it. This batch follows Translate the organizer strip, header, settings and share panel into Swedish #976's organizer terms: Anmälningar for the Responses tab, Språk, Spara and Sparat, fält, behörighet, Översikt for the dashboard, Offentlig länk, and {n, number} for every organizer count. The terms only this batch uses are listed under "Proposed for Translate the organizer strip, header, settings and share panel into Swedish #976's glossary" below, for whoever merges the two. (Its first commit added a section of its own; the second takes it out again.)

  • The independent review's four suggestions are taken (third commit). They're listed under "Review" below.

  • Left for later batches: the Build tab (organizer.build), New signup, Compose, its questions and aiDraft (track A), and everything only on track B.

  • Not changed here: the translate skill's note that organizer text stays English for now, because track B's batch 1 is the issue's "first batch".

The checks from the phase 2 notes

  • Settings tab "Språk" is the same word as account Settings' "Språk" (organizer.settings.language.legend, track B batch 1).
  • "Spara" is the same word as the other Save buttons, and "Sparat" matches account Settings' saved line.
  • Each message is a whole Swedish sentence; no value sits inside an English sentence.
  • The six csv.* column names are distinct: Namn, E-post, Status, Antal platser, Kommentar, Anmäld.
  • The seven statuses are distinct: bekräftad, preliminär, väntelista, avbokad, uteblev, borttagen, flyttad. noShow (English no_show) says what it means: "uteblev", didn't show up.
  • Plurals use Swedish's one and other. The number is in every branch that should show it.
  • No column name has a comma, so the CSV's header row splits the way organizer-language.spec.ts reads it.

The hardest choices

Key(s) English Swedish Why
every count (summary.*, remove.question, titleTooShort, tooManySignups) {n, number, ::group-off} {n, number} #976's Numbers rule: organizer text writes {n, number} ("1 234" with a no-break space), as the rest of Swedish does. ::group-off stays only in participant.share's spotsOpen and spotsLeft, plain text that leaves OpenSignup. The coordinator confirmed that this overrides the looser line in the phase 2 notes.
responses.remove.question "{label}? Their spot opens up for someone else. They won't get an email about it." "{label}? Platsen blir ledig för någon annan. Personen får inget mejl om det." (plural: "De {count} platserna blir lediga för andra.") Swedish has no settled singular "they". De reads as several people, and hen is accepted but still divides readers, so the sentence says personen. "för någon annan" moves into the plural's branches, since several spots open up "för andra". With a Swedish date the question reads "… lör 5 dec.?": an abbreviation's full stop before a question mark is correct Swedish, and only "dec.." is wrong.
responses.status.* confirmed, tentative, waitlist, cancelled, no_show, removed, moved bekräftad, preliminär, väntelista, avbokad, uteblev, borttagen, flyttad Lower case, as English is. The adjectives agree with anmälan. Avbokad is the glossary's avboka. "Uteblev" is the usual word in Swedish booking for someone who didn't come, and is one word for a pill. "Väntelista" stays a noun, as English "waitlist" is.
responses.table.spots, responses.csv.spots Spots Antal platser A column is read on its own. In a spreadsheet it often sits beside an organizer's own "Plats" (location) column. Glossary settled item 6 chose "Antal platser" for emails for the same reason. The sheet's 80-pixel box stays "Platser".
responses.csv.signedUp Signed up Anmäld Its cells are timestamps, so "Anmäld" reads as "when they signed up", as the English does. "Anmälningstid" also means the window when sign-ups are open, and "Tidpunkt för anmälan" is long for a header.
responses.csv.notes Notes Kommentar What the sign-up sheet called the box the participant typed in (glossary).
signupSettings.delete.* vs responses.remove.* Delete signup / Remove Radera anmälningslistan / Ta bort Kept apart: deleting the whole signup can't be undone, while removing a person only takes them off a slot. Proposed for the glossary below, so the Build tab batch follows it.
signupSettings.signupForm.required, optional Required, Optional Obligatoriskt, Valfritt A choice standing on its own after "Be om en e-postadress" reads in the neuter, like the glossary's "(valfritt)".
signupSettings.signupForm.optionalHelp "People can leave it blank. … on the Responses tab." "Deltagarna kan lämna e-postfältet tomt. Då får de inga mejl … på fliken Anmälningar." "lämna det tomt" would have no neuter noun to point back to, so it names e-postfältet. "Då" ties the "no emails" to leaving it blank. "Anmälningar" is track B batch 1's name for the Responses tab; on this branch the tab still says "Responses" until #957 meets it.
errors.code.rate_limited "Slow down — try again in a moment." "Vänta en stund och försök igen." "Sakta ner" is a calque, and "För många försök på kort tid" (the glossary's line for "Too many tries") would repeat försök. The first version, "Det gick lite för fort – försök igen om en stund.", could read as something that happened to the reader; the review's line says what to do (Review, item 4).
errors.code.already_consumed Already used. Har redan använts. "Redan använd/använt" must agree with a noun the line doesn't name; the verb doesn't.
errors.code.forbidden You don't have edit access. Du har inte behörighet att göra ändringar. Plain, and it doesn't need the bureaucratic "redigeringsbehörighet".
responses.remove.refusal.notFound "… Reload to see the latest." "… Ladda om sidan för att se de senaste ändringarna." The same words as errors.code.conflict. "det senaste" alone reads as English.

Proposed for #976's glossary

These words are only in this batch, so #976's "Organizer terms" doesn't have them yet. They're worth adding wherever the two meet:

English Swedish Notes
sign-ups, counted on Responses anmälan, anmälningar "6 anmälningar · 1 avbokad · 1 borttagen"
a sign-up's status (Responses' pill, the CSV) bekräftad, preliminär, väntelista, avbokad, uteblev, borttagen, flyttad Lower case, as in English. The adjectives agree with anmälan. no_show is "uteblev"
remove (someone from a slot) ta bort "Ta bort {name} från {slot}", "Ja, ta bort"
delete (a signup) radera "Radera anmälningslistan". Kept apart from ta bort
Required, Optional (a setting's choices) Obligatoriskt, Valfritt Neuter, like "(valfritt)"
Spots (a column on Responses and in its CSV) Antal platser A column read on its own, as in an email
Notes (the CSV's column) Kommentar What the sign-up sheet calls the box
Signed up (the CSV's time column) Anmäld
Reload (the page) Ladda om sidan
Danger zone Farozon
one person the sentence doesn't name personen Not hen or de: "Personen får inget mejl om det."
your dashboard (the page, in a sentence) dina anmälningslistor What its heading says, "Dina anmälningslistor". Översikt is only the browser tab's title (Review, item 1)

What's still missing for a launch

I added sv to SHIPPED.participant and SHIPPED.organizer locally (not committed) and ran the catalog check. On this branch it reports 267 missing organizer messages and nothing else: no stale, unrecorded or broken message, and no participant message missing.

  • On track A, translated by track B batch 1 (the areas below both tracks, 37 messages): publicPage 7, preview 3, chrome 7, crumbs 4, dashboard 9, loadError 7.
  • Track A batch 2: build 81.
  • Track A batch 3: newSignup 9, compose 130 (questions and answers included), aiDraft 10.
  • Not on this branch at all (track B): account Settings, Connected apps, the signup header, tabs and status, the share panel, auth.*, and the 7 participant.share messages.

Screenshots for the reviewer

Under /home/user/wt/t953b-shots/ on the build machine (not committed), at deviceScaleFactor 2, each at desktop (1280 px) and phone (390 px). They were taken on 1b62884, before the review's changes, which change no fit (see "Review").

How they were made:

  • A production build with sv added to SHIPPED locally, served with E2E_UNSHIPPED_LOCALES=sv.
  • An organizer storing sv, and a viewer of their workspace storing sv.
  • A Swedish signup ("Fika till föräldramötet", fields Vad and Datum). Its sign-ups came through the real API: one cancel, one move and one removal.
  • tentative, waitlist and no_show were set in the database. Nothing in the app writes them today, but their pills exist.

The screenshots:

  • 953b-settings-optional-*: Settings tab, Valfritt chosen, its help showing.
  • 953b-settings-required-saved-*: Obligatoriskt saved, with "Sparat".
  • 953b-settings-language-saved-delete-question-*: the language form's "Sparat", and the delete question open.
  • 953b-responses-statuses-*: every status, the summary "6 anmälningar · 1 avbokad · 1 borttagen", Antal platser, Ingen e-postadress, and the phone's cards with "1 plats" / "2 platser".
  • 953b-responses-remove-question-1-spot-* and -2-spots-*: both plural branches of the Remove question.
  • 953b-responses-csv-as-text-* and 953b-responses.csv: the CSV.
  • Refusals, triggered for real:
    • 953b-refusal-settings-forbidden-* (a viewer's Save);
    • 953b-refusal-remove-forbidden-* (a viewer's Remove);
    • 953b-refusal-remove-not-found-* (the signup deleted in another tab while the question was open);
    • 953b-refusal-build-title-too-short-* (the Build tab rail);
    • 953b-refusal-new-title-too-short-* (New signup, "a " trimmed);
    • 953b-refusal-new-too-many-signups-* (the hour's create quota used up).
  • 953b-refusal-settings-rate-limited-*: ?error=rate_limited, as a refused save comes back. It shows the line before the review changed it (Review, item 4).

What the reviewer will see around this batch:

Not in any screenshot (judge from the catalog):

  • remove.labelNoSlot, used only for a slot with no values;
  • empty.*, the empty-table lines;
  • errors.code.* other than forbidden and rate_limited;
  • disconnectFailed;
  • remove.refusal.failed;
  • the screen-reader-only names remove.label, remove.dialogLabel, delete.label and table.actions.

Review

The translate skill's review (step 3) was done by Fable, a different model from the translator, in the running app at 1280, 390 and 320 px: its comment, on 1b62884. It found nothing that must be fixed and made 4 suggestions. I checked each against the English, the Swedish glossary and #976's organizer terms, and took all four in 2cba05f.

# Key What the reviewer said What I did
1 organizer.signupSettings.dangerZone.body "från din översikt" names a page the organizer has never seen called that: #976 heads it "Dina anmälningslistor" and links to it as "Gå till dina anmälningslistor". "Översikt" is only the browser tab's title. Fixed: "Om du raderar anmälningslistan försvinner den från dina anmälningslistor, och den offentliga länken slutar fungera direkt." Added to "Proposed for #976's glossary" above.
2 organizer.signupSettings.language.help "i dess mejl" is correct but stiff. #976's account help says the same thing as "som deltagarna ser". Fixed: "Det här språket används för knappar, meddelanden och datum på anmälningslistans sida och i mejlen till deltagarna. Skriv titeln och passen på samma språk." It's accurate: every email in a signup's language goes to its participants (confirmation, reminder, changed time).
3 organizer.responses.remove.labelNoSlot The English says "this slot", and nothing before it gives the definite passet a slot to point back to. Fixed: "Ta bort {name} från det här passet". It also starts the Remove question: "Ta bort Kim från det här passet? Platsen blir ledig för någon annan. …"
4 organizer.errors.code.rate_limited A nit: "Det gick lite för fort" can be read as something that happened to the reader, where the English tells them to slow down. Proposed "Vänta en stund och försök igen." Fixed, with the proposed line. It says what to do, as the English does, with no det to misread, and it reads like the participant side's "Försök igen …" lines.
  • English didn't change, so the translation record stands and nothing was marked again.
  • Nothing was declined, so nothing goes into the glossary's open questions.
  • The screenshots weren't re-taken: none of the four changes how anything fits. Two are lines in a wrapping paragraph, one is shorter than before, and the fourth starts a question that wraps.
  • The choices I asked the reviewer to look at ("personen" for singular "they", the status words, "Antal platser", radera against ta bort, Obligatoriskt / Valfritt, Kommentar, Anmäld, Farozon, "Ladda om sidan") it judged right. They stand as "The hardest choices" describes.

Tests

On 2cba05f (the head, after the review):

  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test: lint, format, types and knip pass. Unit tests: 3236 passed, 1 expected fail, and 2 timed out at 5 s while the machine's load average was 20 (src/app/page-metadata.test.ts, src/i18n/testing/used-keys.test.ts). Both files pass when run on their own (19 passed). Neither reads sv.json's text.
  • to-translate.mjs sv: participant 0 missing, 0 stale, 0 unrecorded, 0 extra, 0 unneeded. Organizer 267 missing (the areas above), 0 stale, 0 unrecorded, 0 extra, 0 unneeded.
  • e2e on a production build (container config, chromium): organizer-language and responses, 26 passed and 2 skipped. The skips are "answers Magic Compose's questions", in en and sv, which skips with no LLM_BASE_URL. The sv run reads its Swedish from the catalog, so it holds the Settings tab's danger zone line, the refusal, Responses, Remove and the CSV to the new text.

On 99aede7 and 1b62884, before the review: the same checks passed, plus pnpm test src/i18n src/email (505 passed, 1 expected fail) and the catalog check with sv in both SHIPPED lists, locally (only the 267 missing messages above).

🤖 Generated with Claude Code

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt

claude and others added 30 commits November 13, 2026 22:31
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
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
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
Next.js 15.5.29 on main adds about 0.1 kB to the page. Measured after
pnpm build on this branch: 151.201 kB, so 151.1 → 151.3.

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
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
@richshaw richshaw added the pipeline:working A session is working on it right now label Nov 16, 2026 — with Claude
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
Base automatically changed from claude/issue-944-reword-build-errors to main November 16, 2026 04:33
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

Copy link
Copy Markdown
Owner Author

catch-up after #971: merges only, own diff unchanged (changed lines identical; the hash moved only with surrounding context), markers stand. Review on 2cba05f; tophat on 1b62884, and the only change since it is 2cba05f's four sv.json strings, which the round 1 review checked and kept the tophat for (Swedish isn't shipped).

https://claude.ai/code/session_016YZ9SVnYjqfPQCMgeA7pDt


Generated by Claude Code

@richshaw
richshaw merged commit 2fb8b72 into main Nov 16, 2026
5 checks passed
@richshaw
richshaw deleted the claude/issue-953-sv-batch-a1 branch November 16, 2026 04:40
@richshaw richshaw removed pipeline:merge pipeline:working A session is working on it right now labels Nov 16, 2026 — with Claude
richshaw pushed a commit that referenced this pull request Nov 16, 2026
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants