feat: implement i18n — extract static texts, add EN + ES-MX translations, add language selector #2

Closed
opened 2026-03-17 19:39:54 +01:00 by marcel · 0 comments
Owner

Summary

All UI text is currently hardcoded in German. Paraglide.js is already set up in the project but not yet used. This issue covers the full i18n rollout: text extraction, translation, and a language selector in the header.

Scope

1. Text extraction

Go through every .svelte file and extract all visible German strings into messages/de.json. This includes:

  • Navigation labels (Dokumente, Personen, Konversationen, Admin, Abmelden)
  • Page headings and subheadings
  • Form labels, placeholders, helper text
  • Button labels (Speichern, Abbrechen, Bearbeiten, Zusammenführen, …)
  • Status badges (UPLOADED, PLACEHOLDER, …)
  • Empty state messages
  • Error messages (already partially in src/lib/errors.ts)
  • Section titles (Details, Personen, Inhalt, Absender, Empfänger, …)

2. Translations

Provide translations for all extracted keys in:

  • messages/en.json — English
  • messages/es.json — Spanish (Mexico, es-MX)

3. Language selector

Add a compact language switcher to the header (top-right, next to the logout button). Suggested appearance:

DE | EN | ES

The active language is bold/highlighted. Uses Paraglide's setLanguageTag() and persists the choice (cookie or localStorage).

Technical notes

  • Paraglide.js is already configured (src/lib/paraglide/, vite.config.ts)
  • The messages/ directory already exists with a de.json stub
  • Follow the existing Paraglide usage pattern from src/routes/demo/paraglide/+page.svelte if present
  • Use m.key() call syntax throughout components — do not use string interpolation inside translation keys
  • Date/number formatting already uses Intl — that stays as-is

Acceptance criteria

  • All visible UI text is driven by Paraglide message keys, no hardcoded German strings remain in .svelte files
  • Switching language updates all text immediately without a full page reload
  • Selected language persists across navigation and page reloads
  • messages/de.json, messages/en.json, messages/es.json are all complete and consistent
## Summary All UI text is currently hardcoded in German. Paraglide.js is already set up in the project but not yet used. This issue covers the full i18n rollout: text extraction, translation, and a language selector in the header. ## Scope ### 1. Text extraction Go through every `.svelte` file and extract all visible German strings into `messages/de.json`. This includes: - Navigation labels (Dokumente, Personen, Konversationen, Admin, Abmelden) - Page headings and subheadings - Form labels, placeholders, helper text - Button labels (Speichern, Abbrechen, Bearbeiten, Zusammenführen, …) - Status badges (UPLOADED, PLACEHOLDER, …) - Empty state messages - Error messages (already partially in `src/lib/errors.ts`) - Section titles (Details, Personen, Inhalt, Absender, Empfänger, …) ### 2. Translations Provide translations for all extracted keys in: - `messages/en.json` — English - `messages/es.json` — Spanish (Mexico, `es-MX`) ### 3. Language selector Add a compact language switcher to the **header** (top-right, next to the logout button). Suggested appearance: ``` DE | EN | ES ``` The active language is bold/highlighted. Uses Paraglide's `setLanguageTag()` and persists the choice (cookie or localStorage). ## Technical notes - Paraglide.js is already configured (`src/lib/paraglide/`, `vite.config.ts`) - The `messages/` directory already exists with a `de.json` stub - Follow the existing Paraglide usage pattern from `src/routes/demo/paraglide/+page.svelte` if present - Use `m.key()` call syntax throughout components — do not use string interpolation inside translation keys - Date/number formatting already uses `Intl` — that stays as-is ## Acceptance criteria - All visible UI text is driven by Paraglide message keys, no hardcoded German strings remain in `.svelte` files - Switching language updates all text immediately without a full page reload - Selected language persists across navigation and page reloads - `messages/de.json`, `messages/en.json`, `messages/es.json` are all complete and consistent
marcel added the feature label 2026-03-17 19:42:03 +01:00
Sign in to join this conversation.
No Label feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#2