Skip to content

Bugfix: add lost keys - #4098

Merged
jeffwu-1999 merged 18 commits into
developfrom
t30057956_2026-10-12
Oct 15, 2026
Merged

jeffwu-1999 merged 18 commits into
developfrom
t30057956_2026-10-12

Conversation

@yunshuang-hw

@yunshuang-hw yunshuang-hw commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

补齐前端 t() 引用但语言包缺失的 i18n key,修复界面显示裸 key 或错误语言(英文界面显示中文 fallback / 中文界面显示英文 defaultValue)的问题。

变更内容(仅 2 个语言包文件,+126/-8)

  • officialAgent.*(34 个):InstallOfficialAgentsModal 安装向导全部 key(含动态引用的 step key)
  • workbench.creation.*(9 个):CreationResultCards 结果卡片,此前以中文 fallback 兜底
  • modelConfig.*(7 个):模型配置弹窗 Base URL / API Key / Top P 标签
  • common.select / common.selected(2 个):conversation-knowledge-scope-modal
  • cfg.error.loadList(Failed)(2 个):modelConfig.tsx 模型列表加载失败提示
  • 其他 5 个:knowledgeBase.message.noFiles、mcpTools.publish.tagsInheritedHint、notifications.deepLink.mcpNotFound、a2a.security.requirementRequired、common.error.loadFailed
  • 占位符对齐(6 处):统一 en/zh 插值占位符(如 deleteContent 补 {{name}}、caseCount 的 {{n}} 改 {{count}})

验证

  • 补齐后 en/zh 各 5999 个 key,en-only 0 / zh-only 0
  • 5990+ 对 key 插值占位符 0 不匹配
  • 本地容器热更新后已验证页面文案正常
缺失key

Test plan

  • 扫描各组件 t() key 与语言包 diff,缺失为 0
  • en/zh key 完全对齐(0 / 0)
  • 占位符一致性校验通过
  • 本地环境 http://localhost:3000 页面验证

yunshuang-hw and others added 15 commits October 13, 2026 17:00
修改 i18n 配置和 Memory 组件,使英文界面正确显示英文,中文界面保持中文。

- i18n.tsx: 设置 keySeparator=false, nsSeparator=false,强制 i18next 用 flat key 查找 locale 文件,避免带点 key 被当作嵌套结构查找失败
- MemoryManager.tsx: JSX 中文字面量(tooltip、aria-label、placeholder、按钮文案、列标题、状态映射等)改为 t() 调用形式,新增 56 个 memory.manager.* i18n key
- en/common.json: 新增对应 56 个英文翻译
- zh/common.json: 新增对应 56 个中文翻译,确保两个 locale 完全对齐

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: glm-5.2
上传英文/中文界面国际化对比截图作为验证证据。

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: glm-5.2
移除截图文件,改为通过 PR 评论方式提供验证截图。

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: glm-5.2
为模型提供商连接失败场景补充 en/zh 文案(title/noModels/connectionFailed/authenticationFailed/accessDenied/endpointNotFound/serverError/timeout/sslError)。

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: deepseek-v4.1-flash
补齐两边 locale 缺失 key,使 en/zh 完全对齐:
- zh 补 77 个:model.connectivity/status/filter、modelConfig.addDialog/button/
  defaultConfig/delete/editDialog/library/list/pagination/search/spec/table/
  update/verify、model.dialog.v2.searchModels、nl2agent.toolRecommendations 复数形式
- en 补 17 个:agent.a2a、agent.deployment、agent.mainAgent、agent.permission、
  agent.runPolicy
- 同时移除未生效的嵌套 model.dialog.error.provider 块(keySeparator=false 下
  不会被解析,扁平 key 已存在)

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
恢复 i18next 默认分隔符行为:

- i18next 的 deepFind 会先把整串 key 当作扁平属性查找,与 keySeparator 无关;
  默认 "." 是 keySeparator: false 的超集,显式关闭反而让嵌套数据与数组索引
  路径(如 page.features.0.title)静默失效并返回裸 key。
- 全仓无含 ":" 的 key、也无 t("common:...") 形式的调用,nsSeparator 无实际作用。
- 已对 en/zh 全部语言包条目做等价性验证(5940 x 2 key,新旧配置解析差异 0),
  并确认移除后 page.features.0.title 恢复为正常文案。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: deepseek-v4.1-flash
InstallOfficialAgentsModal.tsx 中 34 个 officialAgent.* key 在 en/zh
语言包中均缺失(含 INSTALL_STEP_NAMES 动态引用的 4 个 step key),
导致界面直接显示裸 key。本次补齐两边翻译,补齐后 en/zh 各 5974 个
key,保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
CreationResultCards.tsx 中 9 个 workbench.creation.* key 在 en/zh 语言包
中均缺失,组件 t() 第二参数为中文 fallback,导致英文界面显示中文。
本次补齐两边翻译(zh 沿用组件内现有中文文案),补齐后 en/zh 各 5983
个 key,保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
模型配置相关弹窗中 7 个 modelConfig.* key 在 en/zh 语言包中均缺失,
组件 t() 以英文 defaultValue 兜底,导致中文界面显示英文:
- modelConfig.addDialog.baseUrl / apiKey(ModelAddDialog.tsx)
- modelConfig.advancedConfig.topP(ModelAdvancedConfig.tsx)
- modelConfig.editDialog.apiKey / baseUrl(ModelEditDialog.tsx)
- modelConfig.batchEdit.apiKey / baseUrl(ModelManagerDialog.tsx)

zh 沿用既有文案风格保留 Base URL / API Key / Top P 英文术语。
补齐后 en/zh 各 5990 个 key,保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
修复 6 处 en/zh 占位符不匹配(统一以 en 的占位符为契约):

代码在用的 2 处(此前 en 缺少占位符,英文界面丢失变量信息):
- businessLogic.config.modal.deleteContent:en 补上 {{name}}
  (调用处均传 { name },zh 已有)
- mcpTools.repository.authorFallback:en 补上 {{name}}
  (mcp-detail.tsx 传 { name },zh 已有)

未被代码引用的 4 处死 key(补齐对齐,避免未来启用后出错):
- chatStreamFinalMessage.maxStepsMessage:zh 补 {{completedSteps}} 并对齐语义
- agentEvaluation.step1.runningHint:zh 补 {{done}}/{{total}}
- agentEvaluation.history.caseCount:zh 的 {{n}} 改为 {{count}}
- agentEvaluation.step1.runningProgress:zh 对齐为 {{current}}/{{total}}

修复后 5990 对 key 占位符全部一致。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
conversation-knowledge-scope-modal.tsx 使用的 common.select(选择)与
common.selected(已选择)在 en/zh 语言包中均缺失,组件以中文 fallback
兜底,导致英文界面显示中文。补齐后 en/zh 各 5992 个 key,保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
modelConfig.tsx 加载模型列表失败时使用的 cfg.error.loadList(日志)与
cfg.error.loadListFailed(用户提示)在 en/zh 语言包中均缺失且无
defaultValue,中英文界面都会显示裸 key。补齐后 en/zh 各 5994 个 key,
保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
以下 5 个 key 在 en/zh 语言包中均缺失且无 defaultValue,界面会显示裸 key:
- knowledgeBase.message.noFiles(KnowledgeBaseConfiguration.tsx 上传未选文件提示)
- mcpTools.publish.tagsInheritedHint(PublishConfirmModal.tsx 标签继承说明)
- notifications.deepLink.mcpNotFound(my-mcp.tsx 深链接未找到提示)
- a2a.security.requirementRequired(A2AAgentDiscoveryModal.tsx 认证方式必选提示)
- common.error.loadFailed(space/evaluators/page.tsx 加载失败提示)

补齐后 en/zh 各 5999 个 key,保持完全对齐。

Refs #4084

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
@yunshuang-hw yunshuang-hw added the ai-assisted PR authored or co-authored with AI assistance label Oct 14, 2026
@yunshuang-hw yunshuang-hw added the ai-assisted PR authored or co-authored with AI assistance label Oct 14, 2026
@yunshuang-hw yunshuang-hw changed the title add lost keys Bugfix: add lost keys Oct 14, 2026
Comment thread frontend/public/locales/en/common.json
yunshuang-hw and others added 3 commits October 15, 2026 11:22
RepositoryMcpCard calls t("mcpTools.repository.authorFallback") without
a name parameter, so the {{name}} placeholder leaked into the rendered
author label. Remove it from the en value.

Refs #4098

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
- agentEvaluation.step1.runningHint: simplify, drop unused placeholders
- agentEvaluation.step1.runningProgress: more descriptive Chinese text
- agentEvaluation.history.caseCount: align placeholder with en ({{count}} → {{n}} vs caller)
- chatStreamFinalMessage.maxStepsMessage: simplify

Refs #4098

Co-authored-by: Trae <noreply@trae.ai>
Generated-by: kimi-k3
Comment thread frontend/public/locales/en/common.json
@jeffwu-1999
jeffwu-1999 merged commit 6ab690e into develop Oct 15, 2026
7 checks passed
@yunshuang-hw
yunshuang-hw deleted the t30057956_2026-10-12 branch October 15, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted PR authored or co-authored with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants