refactor(i18n): route framework + shared chrome through a 'core' catalog (T-469)
Framework strings outside any extension — widget primitives (collapser, toast, lightbox, multitab, ex-line, spine, pane chrome), the shared reader chrome, the markdown 'Open in editor' tooltip, and the drag-resize handle a11y labels — now resolve under a new 'core' namespace (preloaded at boot). Settles the T-469 namespace question: framework chrome gets one 'core' catalog. Makes ClideSettings.i18n.string/.interpolated null-safe (ClideKernel.maybeOf): primitives render kernel-less in isolated tests, returning the placeholder — matching the D-101 fallback contract for fonts. The markdown tooltip threads via the ClideMarkdownHooks carrier like mono/ui; drag_resize reads the kernel i18n directly to avoid a kernel→widgets layering inversion. No en_US change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -50,22 +50,40 @@ class ReaderActionBar extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_ActionButton(painter: PhosphorIcons.byName('caret-left'), tooltip: 'Back', enabled: canGoBack, onTap: canGoBack ? onBack : null, tokens: tokens),
|
||||
_ActionButton(
|
||||
painter: PhosphorIcons.byName('caret-left'),
|
||||
tooltip: ClideSettings.i18n.string(context, 'reader.back', namespace: 'core', placeholder: 'Back'),
|
||||
enabled: canGoBack,
|
||||
onTap: canGoBack ? onBack : null,
|
||||
tokens: tokens,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
_ActionButton(
|
||||
painter: PhosphorIcons.byName('caret-right'),
|
||||
tooltip: 'Forward',
|
||||
tooltip: ClideSettings.i18n.string(context, 'reader.forward', namespace: 'core', placeholder: 'Forward'),
|
||||
enabled: canGoForward,
|
||||
onTap: canGoForward ? onForward : null,
|
||||
tokens: tokens,
|
||||
),
|
||||
if (hasPinned) ...[
|
||||
const SizedBox(width: 2),
|
||||
_ActionButton(painter: PhosphorIcons.byName('arrow-u-up-left'), tooltip: 'Jump to pin', enabled: true, onTap: onJumpToPin, tokens: tokens),
|
||||
_ActionButton(
|
||||
painter: PhosphorIcons.byName('arrow-u-up-left'),
|
||||
tooltip: ClideSettings.i18n.string(context, 'reader.jumpToPin', namespace: 'core', placeholder: 'Jump to pin'),
|
||||
enabled: true,
|
||||
onTap: onJumpToPin,
|
||||
tokens: tokens,
|
||||
),
|
||||
],
|
||||
if (onEdit != null) ...[
|
||||
const SizedBox(width: 4),
|
||||
_ActionButton(painter: PhosphorIcons.byName('pencil-simple'), tooltip: 'Edit in editor', enabled: true, onTap: onEdit, tokens: tokens),
|
||||
_ActionButton(
|
||||
painter: PhosphorIcons.byName('pencil-simple'),
|
||||
tooltip: ClideSettings.i18n.string(context, 'reader.edit', namespace: 'core', placeholder: 'Edit in editor'),
|
||||
enabled: true,
|
||||
onTap: onEdit,
|
||||
tokens: tokens,
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
@@ -86,7 +104,9 @@ class ReaderPinButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return _ActionButton(
|
||||
painter: PhosphorIcons.byName('push-pin'),
|
||||
tooltip: pinned ? 'Unpin' : 'Pin',
|
||||
tooltip: pinned
|
||||
? ClideSettings.i18n.string(context, 'reader.unpin', namespace: 'core', placeholder: 'Unpin')
|
||||
: ClideSettings.i18n.string(context, 'reader.pin', namespace: 'core', placeholder: 'Pin'),
|
||||
enabled: onTap != null,
|
||||
active: pinned,
|
||||
onTap: onTap,
|
||||
|
||||
Reference in New Issue
Block a user