refactor(i18n): route remaining extension labels through the catalog (T-468)
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>
This commit is contained in:
@@ -105,7 +105,10 @@ class _FileTreeViewState extends State<FileTreeView> {
|
||||
}
|
||||
final root = c.rootPath;
|
||||
if (root == null) {
|
||||
return const Padding(padding: EdgeInsets.all(12), child: ClideText('Loading…', muted: true));
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: ClideText(ClideSettings.i18n.string(context, 'loading', namespace: 'builtin.files', placeholder: 'Loading…'), muted: true),
|
||||
);
|
||||
}
|
||||
final rootName = root.split(Platform.pathSeparator).last;
|
||||
final selected = c.selectedPath;
|
||||
@@ -127,10 +130,20 @@ class _FileTreeViewState extends State<FileTreeView> {
|
||||
);
|
||||
return Column(
|
||||
children: [
|
||||
ClideFilterBox(address: 'files.tree', hint: 'Filter files…', onChanged: (v) => setState(() => _filter = v)),
|
||||
ClideFilterBox(
|
||||
address: 'files.tree',
|
||||
hint: ClideSettings.i18n.string(context, 'filter.hint', namespace: 'builtin.files', placeholder: 'Filter files…'),
|
||||
onChanged: (v) => setState(() => _filter = v),
|
||||
),
|
||||
Expanded(
|
||||
child: Semantics(
|
||||
label: 'file tree — $rootName',
|
||||
label: ClideSettings.i18n.interpolated(
|
||||
context,
|
||||
'a11y.tree',
|
||||
namespace: 'builtin.files',
|
||||
placeholder: 'file tree — {name}',
|
||||
replacers: [I18nReplacer(from: '{name}', replace: rootName)],
|
||||
),
|
||||
container: true,
|
||||
explicitChildNodes: true,
|
||||
// Vim nav (j/k/h/l/gg/G/o) drives a selection cursor while this
|
||||
@@ -206,7 +219,21 @@ class _DirRow extends StatelessWidget {
|
||||
final selected = path == selectedPath;
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: '${expanded ? 'Collapse' : 'Expand'} $name',
|
||||
label: expanded
|
||||
? ClideSettings.i18n.interpolated(
|
||||
context,
|
||||
'a11y.collapse',
|
||||
namespace: 'builtin.files',
|
||||
placeholder: 'Collapse {name}',
|
||||
replacers: [I18nReplacer(from: '{name}', replace: name)],
|
||||
)
|
||||
: ClideSettings.i18n.interpolated(
|
||||
context,
|
||||
'a11y.expand',
|
||||
namespace: 'builtin.files',
|
||||
placeholder: 'Expand {name}',
|
||||
replacers: [I18nReplacer(from: '{name}', replace: name)],
|
||||
),
|
||||
onTap: () => controller.toggle(path),
|
||||
child: _Row(
|
||||
key: selected ? selectedKey : null,
|
||||
@@ -235,7 +262,13 @@ class _FileRow extends StatelessWidget {
|
||||
final selected = path == selectedPath;
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: 'Open $name',
|
||||
label: ClideSettings.i18n.interpolated(
|
||||
context,
|
||||
'a11y.open',
|
||||
namespace: 'builtin.files',
|
||||
placeholder: 'Open {name}',
|
||||
replacers: [I18nReplacer(from: '{name}', replace: name)],
|
||||
),
|
||||
onTap: () => _openFile(context, path),
|
||||
child: _Row(key: selected ? selectedKey : null, depth: depth, onTap: () => _openFile(context, path), label: name, selected: selected),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user