feat(web): extract i18n messages for discovery detail, suggestions carousel, albums, and search (wave 2) #1183

Merged
chris merged 2 commits from feature/i18n-extraction-wave2 into main 2026-10-13 05:54:07 +02:00
Owner

Summary

Wave 2 of the Paraglide i18n extraction. Converts all user-visible hardcoded strings in four target files to m.*() message calls, with 516 new keys added to messages/{en,de,da}.json.

File m.* call sites New keys (prefix)
src/lib/components/DiscoveryInstanceDetail.svelte 259 203 (instanceDetail*)
src/lib/components/DomainSuggestionsCarousel.svelte 194 130 (suggestions*)
src/routes/albums/+page.svelte 135 116 (album*)
src/routes/search/+page.svelte 75 59 (search*)
shared — 8 (loading, retry, cancel, close, tentative, approved, mediaTypePhoto, mediaTypeVideo)

Key totals per locale file: 609 (93 pre-existing + 516 new) in each of en.json, de.json, da.json.

Extraction also includes:

  • All Intl locale tags in the two route pages replaced with getLocale() (decisionTime.ts intentionally untouched).
  • Plurals use Paraglide variant messages (array-wrapped declarations/selectors/match) — 30+ plural keys incl. a double-selector one (albumEditDeltaBoth).
  • Markup keys ({#code} / {#strong}) rendered via MessageWithMarkup + .parts(): searchFilterTokensHint, searchPersonHint, searchPreparingHint, instanceDetailDissolveBody.
  • Rule 8: pre-existing German/Danish hardcodes moved verbatim into de/da (Danish assignment-history labels, Danish split/move copy, German self-claim ("Ich") copy, German background-refresh hint, Danish person hint, Danish retry, etc.); English written from context.

Review notes (rule 9 / caveats)

  • Large de/da volume is community-quality, not native-reviewed. Especially worth a native pass: the cluster/ambiguous explainer sentences (suggestionsClusterExplainer*, suggestionsAmbiguous*), the fold-in of two-sentence confirm texts into single plural keys (instanceDetailRemoveConfirm, instanceDetailRemoveBatchConfirm), and the self-claim ("Me"/"Ich"/"Mig") copy.
  • Borderline composition keys (kept mechanically faithful to the original templates, may read oddly out of context): group status instanceDetailGroupMatchCount + instanceDetailSelection{All,Partly,None} joined by ·; suggestionsClosestMatchDialog / suggestionsOtherOne / suggestionsOtherMany keep their original leading spaces; suggestionsWeakClause keeps its leading comma (it is interpolated into the cluster explainer).
  • searchFilterTokensHint / searchPersonHint / searchPreparingHint were restructured from <span class="font-mono"> markup into {#code}…{/code} message markup; rendered via MessageWithMarkup (whitelisted tags, escaped text). No styling change intended.
  • instanceDetailPersonFallback renders as "Person"/"Person"/"Person"; the Danish original used the lowercase "personen" inside one alt text — normalized to "Person" because the key is shared by three call sites.
  • Albums reasonLabel() was deliberately NOT extracted (data-derived enum→label mapping, not UI copy). Albums GENERATED_ALBUM_DESCRIPTION sentinel also untouched (data-equality check).
  • Nullable params at a few carousel/detail call sites are now coalesced (?? '' / ?? 0) to satisfy the generated input types (NonNullable<unknown>); behaviour is unchanged on those guarded branches.
  • No test specs assert the UI strings of these four files; unit tests were extended upstream and all pass here.

Verification (in worktree apps/web, post-rebase onto latest main)

  • npm run paraglide:compile — ✔ Successfully compiled inlang project.
  • npm run check — svelte-check found 0 errors and 18 warnings in 7 files (all 18 warnings are pre-existing a11y/state warnings in untouched files).
  • npm run build — ✔ built in ~32s, adapter-node ✔ done.
  • npm run test:unit — Test Files 26 passed (26), Tests 200 passed (200).
  • Compiled-output spot check via node: plural selection (Contains 1 item / Enthält 2 Elemente / Indeholder 1 element), markup parts for instanceDetailDissolveBody (text/strong/text…), and the double-input cluster explainer all render correctly for en/de/da.
  • Smoke-test limitation: the backend is not running in this environment, so no live Cookie: locale=de|da UI smoke test was possible; locale correctness is covered by the compiled-output checks above. Please spot-check de/da in a live environment before merge.

Deferred (documented in EXTRACTION.md wave table)

  • Profile page body (was split out of wave 2 scope; still unextracted).
  • src/lib/i18n/domainLabels.ts — labels are API-driven and spec-asserted English.
  • adminUtils.ts and relative-time helpers → wave 4.

Checklist

  • Keys added to messages/en.json with de/da translations in the same PR
  • Literals replaced with m.* calls, including attributes
  • Hardcoded Intl locale tags replaced with getLocale()
  • npm run check + npm run build green
  • Visual smoke-test in en, de, da (blocked: no backend here)
## Summary Wave 2 of the Paraglide i18n extraction. Converts all user-visible hardcoded strings in four target files to `m.*()` message calls, with **516 new keys** added to `messages/{en,de,da}.json`. | File | `m.*` call sites | New keys (prefix) | | --- | --- | --- | | `src/lib/components/DiscoveryInstanceDetail.svelte` | 259 | 203 (`instanceDetail*`) | | `src/lib/components/DomainSuggestionsCarousel.svelte` | 194 | 130 (`suggestions*`) | | `src/routes/albums/+page.svelte` | 135 | 116 (`album*`) | | `src/routes/search/+page.svelte` | 75 | 59 (`search*`) | | shared | — | 8 (`loading`, `retry`, `cancel`, `close`, `tentative`, `approved`, `mediaTypePhoto`, `mediaTypeVideo`) | Key totals per locale file: **609** (93 pre-existing + 516 new) in each of `en.json`, `de.json`, `da.json`. Extraction also includes: - All `Intl` locale tags in the two route pages replaced with `getLocale()` (`decisionTime.ts` intentionally untouched). - Plurals use Paraglide variant messages (array-wrapped `declarations`/`selectors`/`match`) — 30+ plural keys incl. a double-selector one (`albumEditDeltaBoth`). - Markup keys (`{#code}` / `{#strong}`) rendered via `MessageWithMarkup` + `.parts()`: `searchFilterTokensHint`, `searchPersonHint`, `searchPreparingHint`, `instanceDetailDissolveBody`. - Rule 8: pre-existing German/Danish hardcodes moved verbatim into `de`/`da` (Danish assignment-history labels, Danish split/move copy, German self-claim ("Ich") copy, German background-refresh hint, Danish person hint, Danish retry, etc.); English written from context. ## Review notes (rule 9 / caveats) - **Large de/da volume is community-quality, not native-reviewed.** Especially worth a native pass: the cluster/ambiguous explainer sentences (`suggestionsClusterExplainer*`, `suggestionsAmbiguous*`), the fold-in of two-sentence confirm texts into single plural keys (`instanceDetailRemoveConfirm`, `instanceDetailRemoveBatchConfirm`), and the self-claim ("Me"/"Ich"/"Mig") copy. - **Borderline composition keys** (kept mechanically faithful to the original templates, may read oddly out of context): group status `instanceDetailGroupMatchCount` + `instanceDetailSelection{All,Partly,None}` joined by ` · `; `suggestionsClosestMatchDialog` / `suggestionsOtherOne` / `suggestionsOtherMany` keep their original leading spaces; `suggestionsWeakClause` keeps its leading comma (it is interpolated into the cluster explainer). - `searchFilterTokensHint` / `searchPersonHint` / `searchPreparingHint` were restructured from `<span class="font-mono">` markup into `{#code}…{/code}` message markup; rendered via `MessageWithMarkup` (whitelisted tags, escaped text). No styling change intended. - `instanceDetailPersonFallback` renders as "Person"/"Person"/"Person"; the Danish original used the lowercase "personen" inside one alt text — normalized to "Person" because the key is shared by three call sites. - Albums `reasonLabel()` was deliberately NOT extracted (data-derived enum→label mapping, not UI copy). Albums `GENERATED_ALBUM_DESCRIPTION` sentinel also untouched (data-equality check). - Nullable params at a few carousel/detail call sites are now coalesced (`?? ''` / `?? 0`) to satisfy the generated input types (`NonNullable<unknown>`); behaviour is unchanged on those guarded branches. - No test specs assert the UI strings of these four files; unit tests were extended upstream and all pass here. ## Verification (in worktree `apps/web`, post-rebase onto latest `main`) - `npm run paraglide:compile` — ✔ Successfully compiled inlang project. - `npm run check` — `svelte-check found 0 errors and 18 warnings in 7 files` (all 18 warnings are pre-existing a11y/state warnings in untouched files). - `npm run build` — ✔ built in ~32s, adapter-node `✔ done`. - `npm run test:unit` — `Test Files 26 passed (26)`, `Tests 200 passed (200)`. - Compiled-output spot check via node: plural selection (`Contains 1 item` / `Enthält 2 Elemente` / `Indeholder 1 element`), markup parts for `instanceDetailDissolveBody` (text/`strong`/text…), and the double-input cluster explainer all render correctly for `en`/`de`/`da`. - **Smoke-test limitation:** the backend is not running in this environment, so no live `Cookie: locale=de|da` UI smoke test was possible; locale correctness is covered by the compiled-output checks above. Please spot-check de/da in a live environment before merge. ## Deferred (documented in EXTRACTION.md wave table) - Profile page body (was split out of wave 2 scope; still unextracted). - `src/lib/i18n/domainLabels.ts` — labels are API-driven and spec-asserted English. - `adminUtils.ts` and relative-time helpers → wave 4. ## Checklist - [x] Keys added to `messages/en.json` with `de`/`da` translations in the same PR - [x] Literals replaced with `m.*` calls, including attributes - [x] Hardcoded `Intl` locale tags replaced with `getLocale()` - [x] `npm run check` + `npm run build` green - [ ] Visual smoke-test in `en`, `de`, `da` (blocked: no backend here)
feat(web): extract i18n messages for discovery detail, suggestions carousel, albums, and search
Some checks failed
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Failing after 11m13s
866f586c63
Wave 2 of the Paraglide extraction: 516 new keys added to messages/{en,de,da}.json
and all user-visible literals in the four target files replaced with m.* calls
(attributes, plurals via Paraglide variants, markup keys via .parts() +
MessageWithMarkup, Intl locale tags via getLocale()).

Deferred to later waves: profile page body (split out of wave 2 scope),
domainLabels.ts (API-driven labels), adminUtils.ts / relative-time helpers.
test(web): pin locales and update expectations for wave-2 extracted copy
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 6m53s
1afbfb5e88
chris merged commit f2fedd6478 into main 2026-10-13 05:54:07 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1183
No description provided.