fix(web-shell): localize remaining hardcoded UI strings - #5189
Conversation
wenshao
left a comment
There was a problem hiding this comment.
[Suggestion] Two dialogs were missed in the dialog.close migration: ModelDialog.tsx:191 and ToolsDialog.tsx:130 still use t('common.close') (lowercase "close"), while the 9 other dialogs now use t('dialog.close') (uppercase "Close"). This creates an inconsistent tooltip across dialogs. Consider migrating these two files to dialog.close as well, or reusing common.close everywhere to avoid key duplication.
— qwen3.7-max via Qwen Code /review
Route the last few hardcoded English strings in web-shell through the existing useI18n()/t() layer and add matching en / zh-CN keys: - close-button tooltips across 9 dialogs - the history-search label, placeholder and key hint in the editor - icon-button aria-labels (toast dismiss, thinking toggle, sub-agent stream toggle), which also improves screen-reader support No new i18n infrastructure; follows the existing pattern used by the same components.
f01419f to
ecdeb7d
Compare
|
Thanks for the review @wenshao — both suggestions applied:
Pushed (force-update on the same branch). PTAL. |
Resolve conflict in AssistantMessage.tsx: upstream independently localized the thinking-toggle button using thinking.expand / thinking.collapse keys (plus title attributes). Adopt upstream's version wholesale and drop our now-redundant assistant.toggleThinking key (en + zh) from i18n.tsx. Remaining web-shell i18n work (dialog close buttons, editor history search, toast dismiss, sub-agent stream toggle) is unaffected.
ytahdn
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
yiliang114
left a comment
There was a problem hiding this comment.
Thanks for the update. I re-checked the current head and the localization changes are scoped to the remaining web-shell UI strings, with the earlier consistency comments addressed. No blockers from my side.
fix(web-shell): localize remaining hardcoded UI strings
What this PR does
Routes the remaining hardcoded English strings in the web shell through its existing localization layer and adds the matching English and Simplified Chinese entries. This covers the close-button tooltip on every dialog, the history-search bar (its label, input placeholder, and key hint), and a few icon-only buttons — the notification dismiss control, the assistant thinking-details toggle, and the sub-agent details toggle. Those icon-only buttons previously carried English-only accessibility labels, so this also improves screen-reader output. Behavior and English wording are unchanged; only previously-untranslated strings are connected to the localization layer.
Why it's needed
The web shell already ships English and Simplified Chinese and lets users switch the UI language at runtime, but these few strings were still hardcoded in English. As a result a user on Simplified Chinese still saw English close-button tooltips, an English history-search bar, and English accessibility labels. This closes those gaps using the localization mechanism that is already in place — no new infrastructure — and follows the same approach as prior localization cleanups in the project.
Reviewer Test Plan
How to verify
Start the web shell and switch the UI language to Simplified Chinese, then confirm each of the following now renders in Chinese: open any dialog and hover its close button (the tooltip reads 关闭); press Ctrl+R to open history search (the label, the input placeholder, and the key hint are all Chinese); trigger an error notification — for example by passing an invalid argument to a theme switch — and hover its dismiss button (the tooltip reads 关闭通知). Then switch the language back to English and confirm every one of those strings still renders correctly in English. The expand/collapse toggles on assistant thinking output and on sub-agent output now expose localized accessibility labels, which can be confirmed in the browser inspector.
Evidence (Before & After)
History search bar (Ctrl+R) — Simplified Chinese


Dialog close-button tooltip — Simplified Chinese


Notification dismiss tooltip — Simplified Chinese


Tested on
Environment (optional)
Local web shell dev server (
npm run dev:daemon).Risk & Scope
reverse-i-searchlabel in English). Only previously-untranslated, user-visible strings are addressed.Linked Issues
Closes #5186
中文说明
这个 PR 做了什么
把 web shell 中剩余的硬编码英文字符串接入现有的本地化层,并补上对应的英文和简体中文条目。涉及:每个对话框关闭按钮的悬停提示、历史搜索栏(其标签、输入占位符和按键提示),以及几个纯图标按钮——通知的关闭控件、助手「思考详情」折叠按钮、子智能体详情折叠按钮。这些纯图标按钮此前的无障碍标签只有英文,因此本次改动也改善了屏幕阅读器的输出。行为和英文措辞均保持不变,只是把此前未翻译的字符串接入本地化层。
为什么需要
web shell 已经提供英文和简体中文,并支持运行时切换界面语言,但这几个字符串仍是硬编码英文。结果是:切到简体中文的用户,仍然看到英文的关闭按钮提示、英文的历史搜索栏和英文的无障碍标签。本次改动用已经存在的本地化机制补齐这些遗漏,不引入新的基础设施,做法与项目此前的本地化清理一致。
复审测试计划
如何验证
启动 web shell,将界面语言切换为简体中文,然后确认以下各项均显示为中文:打开任一对话框并悬停其关闭按钮(提示显示「关闭」);按 Ctrl+R 打开历史搜索(标签、输入占位符、按键提示均为中文);触发一个错误通知——例如给主题切换传入一个无效参数——并悬停其关闭按钮(提示显示「关闭通知」)。随后将语言切回英文,确认上述所有字符串在英文下依然正确显示。助手思考输出和子智能体输出上的展开/收起按钮现在暴露了本地化的无障碍标签,可在浏览器审查器中确认。
证据(前后对比)
见上方英文部分的截图位置。
测试平台
macOS ✅ · Windows⚠️ (未测) · Linux ⚠️ (未测)。
运行环境(可选)
本地 web shell 开发服务器(
npm run dev:daemon)。风险与范围
reverse-i-search标签)。仅处理此前未翻译的、用户可见的字符串。关联 Issue
Closes #5186