Translate the remaining shell text at display and keep translated values out of logic
This commit is contained in:
1 parent
e236713d9f
commit
2b2302a279
17 files changed
+112
-25
No files matched your search
@@ -320,10 +320,12 @@ pass "Claude collector caches a successful probe"
|
||||
# The panel reads a window out of a label, and that guess cannot survive a
|
||||
# model name — "Opus 5 (1M context)" parses as a one-minute window. A collector
|
||||
# that states the title outright is taken at its word.
|
||||
run_node_test <<'JS'
|
||||
run_node_test <<'JS' || exit 1
|
||||
const fs = require('fs')
|
||||
const source = fs.readFileSync(root + '/shell/plugins/agents/Panel.qml', 'utf8')
|
||||
const panelRoot = { nowMs: Date.now() }
|
||||
// The panel's text goes through I18n; English here, with its %1 arguments filled.
|
||||
const I18n = { tr: (text, ...args) => text.replace(/%(\d)/g, (m, n) => (n > 0 && n <= args.length ? String(args[n - 1]) : m)) }
|
||||
const start = source.indexOf('function windowIsLong')
|
||||
const end = source.indexOf('// The window that decides')
|
||||
assert(start > 0 && end > start, 'agents panel exposes its limit-window helpers')
|
||||
|
||||
@@ -27,11 +27,11 @@ assert(/target\.kind === "signin"\) signInAgain\(/.test(panelSource) && /target\
|
||||
assert(/target\.kind === "autoswitch"\) setSwitchMode\(/.test(panelSource), 'Enter on Autoswitch flips the switch mode')
|
||||
assert(/keyColumn = use >= 0 \? use : /.test(panelSource), 'moving up or down onto an account lands on Use')
|
||||
assert(/Qt\.callLater\(function\(\) \{ if \(picking\) pointAt\("choice", 0\) \}\)/.test(panelSource), 'picking an agent to add starts with the first one focused')
|
||||
assert(!/opacity: stale \?/.test(panelSource) && /"Last updated " \+ root\.formatDuration/.test(panelSource), 'stale limits say how old they are only on hover')
|
||||
assert(!/opacity: stale \?/.test(panelSource) && /I18n\.tr\("Last updated %1 ago", root\.formatDuration/.test(panelSource), 'stale limits say how old they are only on hover')
|
||||
assert(/onPickingChanged: resetKeys\(\)/.test(panelSource), 'the cursor starts over when the agent list comes or goes')
|
||||
assert(!/t === "a" \|\| t === "A"/.test(panelSource), 'adding an account has no hotkey; the + is the way in')
|
||||
assert(/if \(!accounts\[a\]\.active\) \{/.test(panelSource) && /if \(row\.length > 0\) rows\.push\(row\)/.test(panelSource), 'the active account with nothing to fix is not a keyboard stop')
|
||||
assert(/text: section\.provider \? String\(section\.provider\.authHelpText \|\| section\.provider\.usageStatusText \|\| ""\) : ""/.test(panelSource), 'the trouble line falls back to the usage status when a record has no auth help')
|
||||
assert(/text: section\.provider \? I18n\.tr\(String\(section\.provider\.authHelpText \|\| section\.provider\.usageStatusText \|\| ""\)\) : ""/.test(panelSource), 'the trouble line falls back to the usage status when a record has no auth help')
|
||||
const mainSource = fs.readFileSync(root + '/shell/plugins/agents/Main.qml', 'utf8')
|
||||
assert(/var from = Math\.min\(0\.8, \(threshold - 15\) \/ 100\)/.test(mainSource), 'faster checks start 15 points below the switch threshold')
|
||||
assert(/rows\.push\(\[\{ kind: "provider", index: p \}\]\)/.test(panelSource), "every agent's header is a keyboard stop")
|
||||
|
||||
Reference in new issue
Block a user