feat(web): extract i18n messages for discovery detail, suggestions carousel, albums, and search (wave 2) #1183
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/i18n-extraction-wave2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 tomessages/{en,de,da}.json.m.*call sitessrc/lib/components/DiscoveryInstanceDetail.svelteinstanceDetail*)src/lib/components/DomainSuggestionsCarousel.sveltesuggestions*)src/routes/albums/+page.sveltealbum*)src/routes/search/+page.sveltesearch*)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:
Intllocale tags in the two route pages replaced withgetLocale()(decisionTime.tsintentionally untouched).declarations/selectors/match) — 30+ plural keys incl. a double-selector one (albumEditDeltaBoth).{#code}/{#strong}) rendered viaMessageWithMarkup+.parts():searchFilterTokensHint,searchPersonHint,searchPreparingHint,instanceDetailDissolveBody.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)
suggestionsClusterExplainer*,suggestionsAmbiguous*), the fold-in of two-sentence confirm texts into single plural keys (instanceDetailRemoveConfirm,instanceDetailRemoveBatchConfirm), and the self-claim ("Me"/"Ich"/"Mig") copy.instanceDetailGroupMatchCount+instanceDetailSelection{All,Partly,None}joined by·;suggestionsClosestMatchDialog/suggestionsOtherOne/suggestionsOtherManykeep their original leading spaces;suggestionsWeakClausekeeps its leading comma (it is interpolated into the cluster explainer).searchFilterTokensHint/searchPersonHint/searchPreparingHintwere restructured from<span class="font-mono">markup into{#code}…{/code}message markup; rendered viaMessageWithMarkup(whitelisted tags, escaped text). No styling change intended.instanceDetailPersonFallbackrenders 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.reasonLabel()was deliberately NOT extracted (data-derived enum→label mapping, not UI copy). AlbumsGENERATED_ALBUM_DESCRIPTIONsentinel also untouched (data-equality check).?? ''/?? 0) to satisfy the generated input types (NonNullable<unknown>); behaviour is unchanged on those guarded branches.Verification (in worktree
apps/web, post-rebase onto latestmain)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).Contains 1 item/Enthält 2 Elemente/Indeholder 1 element), markup parts forinstanceDetailDissolveBody(text/strong/text…), and the double-input cluster explainer all render correctly foren/de/da.Cookie: locale=de|daUI 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)
src/lib/i18n/domainLabels.ts— labels are API-driven and spec-asserted English.adminUtils.tsand relative-time helpers → wave 4.Checklist
messages/en.jsonwithde/datranslations in the same PRm.*calls, including attributesIntllocale tags replaced withgetLocale()npm run check+npm run buildgreenen,de,da(blocked: no backend here)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.