Migrate the user-facing strings in menubar, output, search, deeplink, editor, files, terminal, markdown, and vim to ClideSettings.i18n.string/.interpolated; extend the existing catalogs and create the missing ones (deeplink, output, search, markdown, menubar, vim). vim mode labels now resolve through builtin.vim (default still `-- NORMAL --`, now localizable). A dock-status test seeds builtin.output so the widget's own i18n lookups resolve instead of warning into the logRing it counts. No en_US behaviour change (D-21). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
1.1 KiB
Dart
30 lines
1.1 KiB
Dart
import 'package:clide/builtin/vim/src/vim_mode_service.dart';
|
|
import 'package:clide/widgets/widgets.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
/// Status-bar item showing the current Vim mode (`-- NORMAL --`). Renders
|
|
/// nothing while the Vim layer is disabled, so it's invisible under
|
|
/// non-Vim presets (T-207).
|
|
class VimModeIndicator extends StatelessWidget {
|
|
const VimModeIndicator({super.key, required this.service});
|
|
|
|
final VimModeService service;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListenableBuilder(
|
|
listenable: service,
|
|
builder: (context, _) {
|
|
if (!service.enabled) return const SizedBox.shrink();
|
|
final tokens = ClideSettings.theme.of(context).surface;
|
|
final mode = service.mode;
|
|
final label = ClideSettings.i18n.string(context, 'mode.${mode.name}', namespace: 'builtin.vim', placeholder: mode.label);
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
child: ClideText('-- $label --', fontFamily: ClideSettings.fonts.monoOf(context), fontSize: clideFontCaption, color: tokens.statusBarForeground),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|