feat(dashboard): German by default, English switchable (#336) #342

Merged
sharang merged 1 commits from feat/dashboard-i18n into main 2026-09-23 13:46:15 +00:00
Owner

Closes #336 (framework). Part of the pilot P0 (#338), items E (sidebar, overview) and F.

Why

The pilot customer works in German; the dashboard was English only. The sidebar's Impressum/Privacy links pointed at dashboard routes that do not exist, and runtime-only items stayed clickable in source-only deployments.

What

  • compliance-dashboard/src/i18n/:
    • Every UI string is a Text { de, en } constant in i18n/texts.rs, grouped by page. A missing translation is a compile error (a struct literal must name both fields), and reviewers see both versions side by side.
    • Lang defaults to German.
    • provide_lang() in the app shell renders German on the server and on the first client render, so hydration matches. It then applies the choice stored in localStorage (pruefwerk.lang) and sets <html lang>.
    • Terms: target = Prüfobjekt, finding = Befund, severities Kritisch/Hoch/Mittel/Niedrig.
  • Language toggle in the sidebar footer, labelled with the language it switches to.
  • Translated: sidebar, theme toggle, overview. The other pages follow in the pilot PRs that rework them (scan runs/targets, onboarding, findings). Scanner rule texts stay as the tools write them.
  • Sidebar:
    • runtime-only items in source_only are a plain span rather than a link;
    • Impressum and Datenschutz open breakpilot.com's pages, overridable by the new build args IMPRINT_URL/PRIVACY_URL in Dockerfile.dashboard, like DOCS_URL;
    • the header reads "Prüfwerk".
  • Overview:
    • an empty tenant gets an "add your first target" card;
    • the AI chat and MCP cards are hidden in source_only;
    • "Repositories" becomes "Prüfobjekte/Targets".

Verification

  • i18n unit tests: German default, code round trip, text lookup.
  • clippy with the CI flags for --features server and --features web; fmt.
  • Not yet seen in a browser (the dashboard needs Keycloak locally). Please check on staging: switching language and reloading keeps the choice; disabled items are not clickable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Closes #336 (framework). Part of the pilot P0 (#338), items E (sidebar, overview) and F. ## Why The pilot customer works in German; the dashboard was English only. The sidebar's Impressum/Privacy links pointed at dashboard routes that do not exist, and runtime-only items stayed clickable in source-only deployments. ## What - **`compliance-dashboard/src/i18n/`:** - Every UI string is a `Text { de, en }` constant in `i18n/texts.rs`, grouped by page. A missing translation is a compile error (a struct literal must name both fields), and reviewers see both versions side by side. - `Lang` defaults to German. - `provide_lang()` in the app shell renders German on the server and on the first client render, so hydration matches. It then applies the choice stored in `localStorage` (`pruefwerk.lang`) and sets `<html lang>`. - Terms: target = *Prüfobjekt*, finding = *Befund*, severities Kritisch/Hoch/Mittel/Niedrig. - **Language toggle** in the sidebar footer, labelled with the language it switches to. - **Translated:** sidebar, theme toggle, overview. The other pages follow in the pilot PRs that rework them (scan runs/targets, onboarding, findings). Scanner rule texts stay as the tools write them. - **Sidebar:** - runtime-only items in `source_only` are a plain `span` rather than a link; - Impressum and Datenschutz open breakpilot.com's pages, overridable by the new build args `IMPRINT_URL`/`PRIVACY_URL` in `Dockerfile.dashboard`, like `DOCS_URL`; - the header reads "Prüfwerk". - **Overview:** - an empty tenant gets an "add your first target" card; - the AI chat and MCP cards are hidden in `source_only`; - "Repositories" becomes "Prüfobjekte/Targets". ## Verification - i18n unit tests: German default, code round trip, text lookup. - clippy with the CI flags for `--features server` and `--features web`; fmt. - **Not yet seen in a browser** (the dashboard needs Keycloak locally). Please check on staging: switching language and reloading keeps the choice; disabled items are not clickable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-23 13:38:04 +00:00
feat(dashboard): German by default, English switchable (#336)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m55s
6aa91d07bf
The pilot customer works in German; the dashboard was English only.

- i18n module: every UI string is a `Text { de, en }` constant, so a
  missing translation is a compile error and both versions are reviewed
  side by side. German is the default; the choice is kept in the browser
  and applied after hydration, and `<html lang>` follows it.
- Language toggle in the sidebar footer, next to the theme toggle.
- Translated: sidebar, theme toggle, overview. The other pages follow as
  they are reworked for the pilot.
- Sidebar: runtime-only items in a source-only deployment are no longer
  links; Impressum and Datenschutz point at breakpilot.com (build args
  IMPRINT_URL / PRIVACY_URL) instead of dashboard routes that did not
  exist; the header says Prüfwerk.
- Overview: an empty tenant gets a call to add its first target; the AI
  chat and MCP cards are not shown in a source-only deployment.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang force-pushed feat/dashboard-i18n from 985a5a0681 to 6aa91d07bf 2026-09-23 13:38:04 +00:00 Compare
sharang merged commit 5efc267075 into main 2026-09-23 13:46:15 +00:00
Sign in to join this conversation.