feat(studio): Doctor + Modules localized + sparse-store federation nudge (v0.25.0)
Two threads.
Translation expansion: every visible string on the Doctor
page (section headers, status text, button labels, daemon-
control card, daemon-files panel, update banner) and the
Modules page (recent-activity strip, capabilities label,
uninstall dialog + toast) flips between DE and EN with the
sidebar toggle. Adds ~50 ARB keys split between
`app_en.arb` / `app_de.arb`. Pluralised + parametrised
strings (`{n} events verified`, `Running on {name}: {endpoint}`)
use the standard ICU placeholder syntax so future locales
slot in without code changes.
Sparse-store federation nudge: the Store page renders an
inline banner above the grid when the operator has zero
federated entries — single biggest store-fullness lever is
configuring an MCP server / n8n endpoint, so the banner
says exactly that and the button opens Settings straight
to the editor. Banner dismisses automatically the next
render after a federated entry appears.
Coverage stand for translation: Doctor + Modules + sidebar
+ page titles + nav + Cmd+K labels are bilingual. Settings
dialog, Approvals cards, Audit drilldown, MCP/n8n editors,
Store search hint + filter chips remain English-literal.
The infrastructure (ARB plumbing, generator hookup,
locale-notifier) means each follow-up surface 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:
parent
ee83eb851a
commit
349619d68e
11 changed files with 1091 additions and 80 deletions
|
|
@ -6,6 +6,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../data/hub.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../theme/theme.dart';
|
||||
import '../theme/tokens.dart';
|
||||
import 'fai_pill.dart';
|
||||
|
|
@ -48,19 +49,16 @@ class _FaiModuleSheetState extends State<FaiModuleSheet> {
|
|||
}
|
||||
|
||||
Future<void> _confirmAndUninstall(ModuleDetail detail) async {
|
||||
final l = AppLocalizations.of(context)!;
|
||||
final ok = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('Uninstall module?'),
|
||||
content: Text(
|
||||
'Removes ${detail.name} v${detail.version} from this hub. '
|
||||
'Flows that reference it will fail at the next run. '
|
||||
'A `module.uninstalled` audit event is recorded.',
|
||||
),
|
||||
title: Text(l.modulesUninstallTitle),
|
||||
content: Text(l.modulesUninstallBody(detail.name, detail.version)),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(ctx, false),
|
||||
child: const Text('Cancel'),
|
||||
child: Text(l.buttonCancel),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => Navigator.pop(ctx, true),
|
||||
|
|
@ -68,7 +66,7 @@ class _FaiModuleSheetState extends State<FaiModuleSheet> {
|
|||
backgroundColor: Theme.of(ctx).colorScheme.error,
|
||||
foregroundColor: Theme.of(ctx).colorScheme.onError,
|
||||
),
|
||||
child: const Text('Uninstall'),
|
||||
child: Text(l.buttonUninstall),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -79,14 +77,16 @@ class _FaiModuleSheetState extends State<FaiModuleSheet> {
|
|||
final r = await HubService.instance.uninstallModule(detail.name);
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Uninstalled ${r.name} v${r.version}.')),
|
||||
SnackBar(
|
||||
content: Text(l.modulesUninstalledToast(r.name, r.version)),
|
||||
),
|
||||
);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() => _uninstalling = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Uninstall failed: $e')),
|
||||
SnackBar(content: Text(l.modulesUninstallFailed(e.toString()))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -269,7 +269,11 @@ class _Body extends StatelessWidget {
|
|||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.delete_outline, size: 16),
|
||||
label: Text(uninstalling ? 'Uninstalling…' : 'Uninstall'),
|
||||
label: Text(
|
||||
uninstalling
|
||||
? AppLocalizations.of(context)!.modulesUninstalling
|
||||
: AppLocalizations.of(context)!.buttonUninstall,
|
||||
),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: theme.colorScheme.error,
|
||||
side: BorderSide(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue