feat(studio): app-wide i18n via flutter_localizations (v0.24.0)

Replaces the Store-only DE/EN toggle with an app-wide one
parked in the sidebar footer next to the theme button.
Pressing it flips every translated string at once: nav
labels, page titles, common buttons, the bilingual
store-index content.

Implementation:
- Adds `flutter_localizations` + `intl` to pubspec, plus
  `flutter.generate: true` so `flutter gen-l10n` runs in the
  build pipeline.
- ARB sources at `lib/l10n/app_en.arb` and `app_de.arb`. The
  EN file is the template; DE carries the German strings.
  Initial coverage: navigation, common buttons, page titles,
  channels / store / audit / modules / approvals headers,
  hub-unreachable copy, MCP + n8n panel headers + hints.
  Rest of the UI strings are still English-literal — those
  fall in incrementally as we touch each surface.
- Generated `AppLocalizations` lives at
  `lib/l10n/app_localizations*.dart` (regenerated via
  `flutter gen-l10n` on every ARB edit).
- `StudioAppState` gains `localeNotifier` alongside
  `modeNotifier`; persisted via SharedPreferences key
  `locale.code`.
- Sidebar `_LanguageToggle` reads/writes through the
  notifier. The Store's per-page locale state is gone:
  `_locale` now reads `Localizations.localeOf(context)
  .languageCode`, so the bilingual store-index content
  follows the global setting without a second toggle.
- `_NavPage.label` becomes `_NavPage.id` + `labelOf(context)`;
  Cmd+K palette and Sidebar both read the localized label.

Out of scope this iteration: localizing the remaining
~80% of UI strings (Settings dialog labels, Store search
hint, error messages). Those land incrementally — the i18n
infrastructure now means each is a one-line ARB edit + one
call-site swap.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-08 01:19:32 +02:00
parent d2a6ed32e2
commit ee83eb851a
16 changed files with 1440 additions and 67 deletions

94
lib/l10n/app_en.arb Normal file
View file

@ -0,0 +1,94 @@
{
"@@locale": "en",
"appTitle": "F∆I Studio",
"@appTitle": { "description": "App-bar title in the OS task switcher." },
"navDoctor": "Doctor",
"navModules": "Modules",
"navStore": "Store",
"navFlows": "Flows",
"navAudit": "Audit",
"navApprovals": "Approvals",
"connectionConnected": "connected",
"connectionUnreachable": "unreachable",
"connectionConnecting": "connecting…",
"connectionStartHub": "Start hub",
"buttonCancel": "Cancel",
"buttonSave": "Save",
"buttonClose": "Close",
"buttonRetry": "Retry",
"buttonRefresh": "Refresh",
"buttonInstall": "Install",
"buttonUninstall": "Uninstall",
"buttonDetails": "Details",
"buttonAdd": "Add",
"buttonRemove": "Remove",
"buttonOpen": "Open",
"buttonExplain": "Explain",
"buttonReadDocs": "Read docs",
"settingsTitle": "Hub endpoint",
"settingsHost": "Host",
"settingsPort": "Port",
"settingsTls": "TLS",
"settingsSaveAndConnect": "Save & connect",
"settingsLanguage": "Language",
"settingsLanguageHint": "App language. Affects every page; bilingual store entries also flip via this toggle.",
"channelsHeader": "CHANNELS",
"channelsActive": "active",
"channelsRunning": "running",
"channelsStopped": "stopped",
"channelsConnect": "Connect Studio to this channel",
"channelsSwitch": "Make this the active channel",
"channelsEnableAutostart": "Enable autostart at login",
"channelsDisableAutostart": "Disable autostart",
"storeSearchHint": "Search modules — name, tagline, tag, capability…",
"storeFeatured": "FEATURED",
"storeFeaturedHint": "curated picks · click for details",
"storeNoMatches": "No matches",
"storeNoMatchesHint": "Adjust the filters or clear the search to see all entries.",
"storeClearFilters": "Clear filters",
"storeStatusAll": "All",
"storeStatusPublished": "Published",
"storeStatusAlpha": "Alpha",
"storeStatusPlanned": "Planned",
"storeInstalledOnly": "Installed",
"storeNResults": "{n} result{n, plural, =1{} other{s}}",
"@storeNResults": {
"placeholders": { "n": { "type": "int" } }
},
"auditTitle": "Audit",
"auditNoEvents": "No events yet",
"auditNoEventsHint": "Run a flow to populate the audit stream.\nEvents appear here within seconds.",
"modulesTitle": "Modules",
"modulesNoneTitle": "No modules yet",
"modulesRecentActivity": "RECENT ACTIVITY",
"approvalsTitle": "Approvals",
"approvalsTabPending": "Pending",
"approvalsTabHistory": "History",
"approvalsInboxZero": "Inbox zero",
"approvalsInboxHint": "All caught up. New `system.approval@^0` steps land here automatically.",
"doctorTitle": "Doctor",
"mcpHeader": "MCP CLIENTS",
"mcpHint": "External MCP servers federate their tools as `mcp.<server>.<tool>` capabilities. Configure once, see them in the Store.",
"mcpEmpty": "No MCP servers configured. Click + to add one.",
"n8nHeader": "N8N ENDPOINTS",
"n8nHint": "Active n8n workflows surface as `n8n.<endpoint>.<slug>` capabilities. Configure once, see them in the Store.",
"n8nEmpty": "No n8n endpoints configured. Click + to add one.",
"hubUnreachable": "Hub unreachable",
"hubUnreachableHint": "Start the hub with `fai serve`.",
"languageEnglish": "English",
"languageGerman": "Deutsch"
}