Add zh/en i18n and follow DSH locale.bind for UI.

Wire API/delivery/tool strings through lib/i18n.js, and make the sidebar use ctx.locale.bind plus locale/change so English host preference no longer stays frozen on Chinese.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-09 22:10:07 +08:00
parent 51deaf037b
commit b35bfde557
12 changed files with 373 additions and 37 deletions

View file

@ -68,6 +68,15 @@ test('installable bundle declares host apply, client half, unique id, and no @de
assert.match(client, /agentPreset/)
assert.match(client, /mirrorToSession/)
assert.match(client, /inject = \['slots', 'locale', 'settingsScope'\]/)
assert.match(client, /locale\.bind/)
assert.match(client, /locale\/change/)
assert.match(client, /loginRequired/)
assert.match(client, /runNoSession/)
assert.match(client, /body\.message/)
const i18n = await readFile(join(root, 'lib/i18n.js'), 'utf8')
assert.match(i18n, /err\.login_required/)
assert.match(i18n, /export function apiError/)
assert.ok(pkg.exports['./i18n'])
const preset = await readFile(join(root, 'lib/preset.js'), 'utf8')
assert.match(preset, /resolveCreateAgentPreset/)
const delivery = await readFile(join(root, 'lib/delivery.js'), 'utf8')