Repository navigation
Add German admin UI and localise operator-facing emails - #276
Mehr-Vertrieb wants to merge 1 commit into
Conversation
Mehr-Vertrieb
commented
Nov 26, 2026
- Ship a German admin catalogue (frontend/src/lib/i18n/de.json) and register it in ADMIN_LOCALES; catalogue tests now cover every translation, not only French.
- Host notifications, login link, password reset, team invitation and the email test message read their text from the booker catalogue in the operator's fallback language. English output is unchanged.
- Polish German booker wording (verschieben instead of umbuchen, a few idiomatic fixes), mirrored in de-x-neutral; glossary updated.
- Ship a German admin catalogue (frontend/src/lib/i18n/de.json) and register it in ADMIN_LOCALES; catalogue tests now cover every translation, not only French. - Host notifications, login link, password reset, team invitation and the email test message read their text from the booker catalogue in the operator's fallback language. English output is unchanged. - Polish German booker wording (verschieben instead of umbuchen, a few idiomatic fixes), mirrored in de-x-neutral; glossary updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015iakVADVRvb5zkK5sEwxtg
|
All contributors have signed the CLA. ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Important
The host-email wiring misses two send paths: reschedule (manage page / MCP) and reassignment never populate HostLocale, so those host emails still go out in English even when a German fallback locale is configured.
Approach: sound in shape — a dedicated HostLocale keeps the attendee's language and the operator's language from bleeding into each other, and the German admin catalogue slots into the existing ADMIN_LOCALES/catalogs architecture — but the host-locale plumbing stops short of every send site it promises.
Reviewed changes — read the full 19-file diff and ran the relevant suites (go test ./internal/i18n/ ./internal/mailer/, node --test src/lib/i18n/catalog.test.ts, check-i18n.mjs, gofmt -l).
- German admin catalogue. New
frontend/src/lib/i18n/de.json(1,325 keys, formal Sie) registered incatalog.ts; key parity, placeholders, plurals and anchor guards incatalog.test.tsnow iterate every translation. Verified againsten.jsonstructure and read the whole catalogue for obvious mistranslations. - Host/operator email localisation. New
BookingData.HostLocale,operatorLocale(ctx)helper, andT/Tf-driven host confirmation/cancellation/reschedule templates plus login-link, reset, invite and settings-test emails. English output is byte-identical to the previous hardcoded copy. - German booker wording. verschieben replaces umbuchen, mirrored in
de-x-neutral.json, with the glossary extended. hostBookingDatastampsHostLocalefrombranding.FallbackLocale; the admin event-type preview now uses a 24-hour clock for every non-English admin locale.
⚠️ Reschedule and reassignment host emails still go out in English
SendRescheduleToHost and the reassignment confirmation only localise when BookingData.HostLocale is set, but hostBookingData is the only site that sets it. rescheduleSideEffects and reassign build their host copy inline, so a German instance still sends those two host notifications in English — and reschedule is explicitly listed in the changelog.
Technical details
# HostLocale not set on two host-send paths
## Affected sites
- `internal/handler/manage_handler.go:335-338` — `hd := d; h.applyHostInvite(...); mailer.SendRescheduleToHost(...)`; `d` comes from `loadCancellationData` + `applyBranding`, neither of which sets `HostLocale`.
- `internal/handler/reassign.go:221-226` — same pattern for the new host's confirmation email.
- `internal/handler/booking_handler.go:1101` — `hostBookingData` is currently the only assignment.
## Required outcome
Every `SendConfirmationToHost` / `SendCancellationToHost` / `SendRescheduleToHost` call carries the operator locale, so the reschedule notification the changelog promises is actually German on a German instance.
## Suggested approach (optional)
Set `hd.HostLocale = h.operatorLocale(ctx)` inside `applyHostInvite`, which all three paths already call; the assignment in `hostBookingData` then collapses into the same helper (and stops duplicating `i18n.Get(loadBranding(ctx).FallbackLocale)`).
## Open questions for the human (optional)
`TestHostEmails_followHostLocale` calls the mailer directly with `HostLocale` pre-set, so it cannot catch a handler that never populates the field. A handler-level assertion (or setting the field centrally) would close that hole.ℹ️ Nine shipped locales now get half-translated host emails
Only en, de and de-x-neutral received the 22 new keys. Locale.T falls back per key to English, but the host templates also reuse long-standing keys (email_greeting, email_label_*) that every locale already translates — so a French, Spanish, Italian, Dutch, Polish, Portuguese, Swedish, Greek or Canadian-French operator now gets a translated greeting and labels beside an English subject and lead. That is less coherent than the uniformly English mail shipped before.
Technical details
# Per-key fallback mixes languages in host emails
## Affected sites
- `internal/i18n/locales/{fr,fr-CA,es,it,nl,pl,pt,sv,el}.json` — 169/191 keys; all 22 new keys missing.
- `internal/i18n/locales/en.json:147-168` — the new `email_host_*`, `email_magic_*`, `email_reset_*`, `email_invite_*`, `email_test_*` block.
- `internal/mailer/booking.go:468-559` — host templates mix `email_greeting`/`email_label_*` (translated everywhere) with the new keys (English fallback).
## Required outcome
Host email language is either coherent for a locale or uniformly English.
## Suggested approach (optional)
Translate the 22 keys in the other shipped locale files (the structural guards stay green either way). If that is out of scope, say in the changelog that the new copy currently ships in German and English only, so French/Spanish hosts get a mixed email rather than the previous all-English one.ℹ️ docs/ARCHITECTURE.md §23 still says host emails stay English and that the admin ships only en + fr
Line 1306 states "Host-facing sends deliberately pass a nil locale and stay English" and line 1263 lists the admin SPA as en + fr. This PR invalidates both; §23 is also where the new rule (the fallback locale drives operator-facing email) belongs, and the repo convention is that behaviour changes update that section in the same PR.
Technical details
# ARCHITECTURE §23 not updated for this PR's behaviour change
## Affected sites
- `docs/ARCHITECTURE.md:1263` — admin SPA row: "`en` + `fr`".
- `docs/ARCHITECTURE.md:1268-1276` — prose that says `fr.json` is the only translation.
- `docs/ARCHITECTURE.md:1303-1306` — "Host-facing sends deliberately pass a nil locale and stay English."
## Required outcome
§23 describes the shipped admin locales (`en`, `fr`, `de`) and the operator-email language rule (`server_settings.fallback_locale` drives host/operator emails; attendee emails stay per-booking).deepseek-v4.1-flash | 𝕏
| // HostLocale is the language of host-facing emails: the operator's configured fallback | ||
| // language (server_settings.fallback_locale), set by the caller. nil keeps host emails in | ||
| // English, the previous behaviour. | ||
| HostLocale *i18n.Locale |
There was a problem hiding this comment.
The Locale doc block just above still says host-facing sends "explicitly clear this to keep host emails in English", and TestSendConfirmation_attendeeLocaleTranslatesButHostStaysEnglish encodes the same contract in its name and comment. Both are now wrong: a nil HostLocale is what keeps the mail English. Update the doc block and rename/rewrite that test.
| const frKeys = Object.keys(flatten(fr)).sort(); | ||
| assert.deepEqual(frKeys, enKeys); | ||
| }); | ||
| for (const [code, catalog] of Object.entries(TRANSLATIONS)) { |
There was a problem hiding this comment.
Only this node:test copy was converted to iterate every translation. CI runs pnpm test:visual (vitest), which excludes catalog.test.ts and runs i18n.test.ts — still hardcoding fr for key parity, placeholders, plurals and anchors. So de.json has no CI guard, and the claim that tests cover every translation holds only for the suite CI does not run; mirror the TRANSLATIONS loop into i18n.test.ts.
| "body": "Hallo {attendee},\n\nIhr Termin wurde verschoben.\n\nTermin: {event}\nMit: {host}\nBisher: {prev}\nNeu: {start}\nEnde: {end}{location}\n\nBuchungsreferenz: preview-test{note}\n— Calnode" | ||
| }, | ||
| "reminder": { | ||
| "body": "Hallo {attendee},\n\nwir erinnern Sie an Ihren bevorstehenden Termin.\n\nTermin: {event}\nMit: {host}\nBeginn: {start}\nEnde: {end}{location}\n\nBuchungsreferenz: preview-test{note}\n— Calnode" |
There was a problem hiding this comment.
wir starts a new sentence after the blank line, so it should be capitalised — en and fr both do, and the real reminder lead (email_reminder_lead) reads "Wir erinnern Sie …". This string renders verbatim in the event-type editor's email preview.
