v0.250.0: i18n slice 1 release C — the language switch on every dashboard page (R-556)
gates / gates (push) Successful in 20s

- addLanguageData: the v0.247.0 hide condition (switch only on non-Hungarian pages or with ?lang=) is
  deleted; every template is converted, so the offer no longer leads to a half-English page.
- 89 layout parity fixtures re-captured; each equals its predecessor plus exactly one switch form after
  the version span (checked byte-for-byte, 89 of 89). The 17 standalone fixtures are unchanged.
- TestLanguageSwitch_EndToEnd: a Hungarian household with no ?lang= sees the form (red-proofed by
  restoring the condition: this test and 89 parity cases fail).
- CHANGELOG v0.250.0, README §18, CONTEXT.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
2026-09-17 18:43:01 +02:00
parent ac149c2aa4
commit be2efe5624
94 changed files with 156 additions and 119 deletions
+18 -16
View File
@@ -46,7 +46,7 @@ backups, monitoring and notifications. All Proxmox/disk operations are delegated
- [App-to-App Integrations](#15-app-to-app-integrations)
- [Network File Sharing — SMB](#16-network-file-sharing--smb-megosztás-v01440-r-7-slice-1)
- [Async-job feedback](#17-async-job-feedback-v0147x-feedback-slice-1)
- [Dashboard language (i18n)](#18-dashboard-language-i18n-v02470-spike)
- [Dashboard language (i18n)](#18-dashboard-language-i18n-v02470v02500)
- [Repository Layout](#repository-layout)
- [Configuration](#configuration)
- [REST API](#rest-api)
@@ -3614,17 +3614,16 @@ without reaching `Images()`.
---
### 18. Dashboard language (i18n) (v0.247.0, spike)
### 18. Dashboard language (i18n) (v0.247.0–v0.250.0)
Design: `felhom.eu/documentation/architecture/10-localisation.md`. Inventory:
`felhom.eu/documentation/audits/I18N-INVENTORY-2026-09-17.md`.
**What a household sees:** nothing new. Hungarian is the default and the only language shown unless
the language is switched. English covers the **launcher**, the **backups overview** (`/backups`), the
**app page** (`/apps/<slug>`), the shared **layout**, and since v0.248.0 the **dashboard, apps list,
logs, monitoring, import, export, deploy/settings-of-an-app and the three settings pages** — other
pages keep their Hungarian body inside an English menu. Server-built messages and catalog copy stay
Hungarian (slices 2 and 5).
**What a household sees:** Hungarian by default, and since v0.250.0 a **Magyar / English** switch in the
sidebar footer of every dashboard page. Every template is converted (v0.247.0 three pages, v0.248.0
apps and settings, v0.249.0 backups, v0.250.0 storage, sharing, sign-in, claim, guest share, catch-all,
debug). Server-built messages (flash lines, errors, labels built in Go), three page titles built in Go
around an app name, and catalog copy stay Hungarian (slices 2 and 5).
- **Bundles:** `internal/i18n/locales/hu.json` (authoritative, every key) and `en.json`, embedded.
Flat `key → text`; a value may carry template actions (`{{.RecoveryAbandonDate}}`) and inline
@@ -3637,15 +3636,18 @@ Hungarian (slices 2 and 5).
- **Fallback:** a key missing from English shows the Hungarian text and is counted (startup INFO line
`i18n: en template set shows Hungarian for N markers`); never a key, never a blank.
- **Language of a request:** `?lang=hu|en` (testing override, never persisted) → `settings.json`
`language` → `hu`. `executeTemplate` renders from that language's set. Pages rendered outside
`executeTemplate` (login, claim, recovery, the guest share pages) stay Hungarian.
`language` → `hu`. `executeTemplate` renders from that language's set. Pages outside the dashboard
chrome (login, claim, recovery, both guest share pages, the catch-all) render through
`executeTemplateLang`: the household language, but NO session CSRF fields and NO escrow reminder
(`TestI18nDirectRenderPagesHaveNoAdminChrome`, `TestDirectRenderHandlersFollowLanguage`).
- **The switch:** `POST /settings/language` (`lang`, `back`; session CSRF like every form) saves the
language and redirects to `back` without its query. Shown in the sidebar footer **only when the page
is not Hungarian or the request carries `?lang=`** — deliberate for this release (three pages are
English); the way back is always on screen.
- **Go-side copy:** a handler names its title key (`data["TitleKey"]`); non-Hungarian sets override
the copy-producing template funcs (`stateLabel`, `timeAgo`, `timeAgoStr`, `nextRunLabel`,
`statusText`) from the bundle. The Hungarian funcs are untouched.
language and redirects to `back` without its query. Shown in the sidebar footer of **every**
dashboard page, in both languages, since v0.250.0 (until then only on non-Hungarian pages or with
`?lang=`, while English was partial).
- **Go-side copy:** a handler names its title key (`data["TitleKey"]`, pinned equal to its Hungarian
literal by `TestHandlerTitleKeysMatchHungarianTitle`); non-Hungarian sets override the copy-producing
template funcs (`stateLabel`, `timeAgo`, `timeAgoStr`, `nextRunLabel`, `statusText`, `infraMeta`) from
the bundle. The Hungarian funcs are untouched.
- **Report:** the hub report carries `"language"` (always present). No hub release reads it yet.
- **Tools and gates:** `scripts/i18n_extract.py` converts a template (moves each Hungarian run into
hu.json, leaves a marker); `scripts/i18n_missing_gate.py` (in `controller_gates.py`) checks keys