Skip to content

fix(i18n): use 智能体 for zh-CN agent copy (re-apply #25767 terminology) - #47373

Closed
YorrickBao wants to merge 1 commit into
stablyai:mainfrom
YorrickBao:fix/zh-agent-terminology-r2
Closed

YorrickBao wants to merge 1 commit into
stablyai:mainfrom
YorrickBao:fix/zh-agent-terminology-r2

Conversation

@YorrickBao

Copy link
Copy Markdown

English TL;DR: A recent machine-translation refresh reintroduced 代理 ("proxy") as the translation for AI agents in ~540 zh-CN strings (net vs 2026-11-23 main; branch re-applied after upstream's 1090-commit localization churn wiped earlier fixes — same fix set, re-derived and re-verified per item) across the desktop and mobile catalogs, undoing most of #25767. This PR mechanically re-applies the 智能体 terminology on current main. Every changed string's English source matches \b(sub)?agents?\b; proxy URLs (23), user-agent (3), ssh-agent (2), the Linux authentication agent, product names and CLI flags are verified untouched. Refs #43430.

Summary

#25767 (merged 2026-10-06) unified the zh-CN term for AI agents to 智能体. A recent machine-translation refresh reintroduced 代理 across both catalogs for strings that locale-zh-value-overrides.mjs does not pin. This PR re-applies the terminology on current main:

范围 修正数 说明
desktop zh.json 534 505 处 代理→智能体(EN 源含 agent/subagent)+ 29 处定向修正:orchestration worker 家族统一(24 键,main 混用 工作者/工人/工作进程)、Close agents 误译(紧密→关闭)、2 处未本地化 Agent/agent、1 处技能安装文案;1 处按 CodeRabbit 审查回退(见 Notes)
mobile zh.json 16 14 处术语 + 1 处中英混排(notificationDisplayTest.localScheduled)+ 2 处新增状态栏文案

刻意保留(逐条核实为正确译法,未触碰):

  • proxy → 代理 23 处(proxy URL、ProxyCommand、反向代理、no_proxy 等)
  • user agent → 用户代理 3 处(浏览器 UA)
  • ssh-agent → SSH 代理 2 处(SshTargetForm 私钥回退)
  • authentication agent → 身份验证代理 1 处(Linux 特权安装恢复卡片,系统组件)
  • 产品名/命令/文件名保留英文:Claude Agent Teams、Prime Agent、cursor-agent、AGENTS.md、Shared (.agents)、CLI 旗标 --agent

反向扫描同时确认:目录中不存在 proxy/技术 agent 被误译为“智能体”的条目。

Linked issue

Refs #43430(en↔zh 全键审计 + 逐条源码调用点核验)。该 issue 中 5 处(turnWorking、newAgent、agentWorking、2 处 ssh-agent)已被上游先行修复,本 PR 未触碰。

Supersession

This PR supersedes #43434 (identical fix set; the original head branch hit GitHub's workflow-scope push restriction after an upstream history advance and could not be force-updated without a token-scope grant). The full audit trail lives in issue #43430.

Screenshots

N/A — 纯 locale 字符串值修改,不涉及布局、样式或交互。

Testing

本地已验证(CI 全量门禁未在本地运行,交由 CI):

  • 两个目录均为合法 JSON;键集合与 HEAD 完全一致(desktop 20 213 / mobile 4 035 键,零增删);
  • 格式安全:用与原文件逐字节一致的序列化方式重写,diff 仅为值变更(净 550 条,550+/550−),无格式噪音;
  • 修正后扫描:desktop 仅剩 33 处 代理(23 proxy + 3 user-agent + 2 ssh-agent + 1 authentication-agent + 4 个已知 wrong-sense 文案 bug,见 issue)+ 1 处回退后恢复原译;mobile 清零;无残留未本地化的 “Agent/agent”(--agent 旗标、占位符除外);
  • 按 CodeRabbit 意见复扫全部改动键的同类盲区(authentication/security/system/privileged/service agent 及 zh 的“身份验证智能体”类组合),无其他误伤。

Risk

Low:仅 locale 值变更,缺键回退行为不受影响,键结构零改动。

AI Review Report

  • 正确性:所有替换均为字符串内词级 代理→智能体,且每条的英文源串经 \b(sub)?agents?\b 匹配确认;proxy/user-agent/ssh-agent/authentication-agent 共 29 条逐一核对未被触碰,反向(智能体 出现在 proxy/技术 agent 串上)为零
  • 跨平台:纯 JSON,三端行为一致
  • 远程/SSH 兼容:纯文案,无逻辑
  • provider 无关:未触碰任何 provider 专有文案
  • 性能:目录大小不变,运行时加载路径不变
  • UI 质量:桌面与 mobile 术语与 chore(i18n): use 智能体 for Chinese Agent copy #25767 建立的基准一致,含设置搜索关键词(searchAgent/searchAgents)

Security Audit

纯 locale 字符串修改,不涉及输入处理、命令执行、路径操作、认证或 IPC 逻辑。

Notes

  • 第二笔提交(c3abf75)按 CodeRabbit 审查将 LinuxPackageInstallRecoveryCard.53c4b8e148(系统 authentication agent,特权安装提示)回退为 身份验证代理;并对全部改动键复扫了 authentication/security/system/privileged/service agent 等系统组件措辞及 zh 的“身份验证/认证/特权智能体”类组合,无同类误伤。
  • 第三笔提交(eb3665d)来自对全部 535 个改动键的逐条语义复审:
    • ActivityTitlebarControls.dc708f3eff:EN “Close agents” 旧译“紧密代理”(Close 被误译为“紧密”),改为 关闭智能体;
    • orchestration worker 指的是派发的 AI 智能体,main 上同族文案混用 工作者/工人/工作进程(OrchestrationPane 的 nestedWorkerDepth/workerAutoRelease/coordinatorApprovals、native-chat approval 与 approval.record(含新增的 <task>/<tool> 结构化键)、workspaceCleanup 的 orchestration-worker 规则、orchestrationCrew 计数,共 24 键),统一为 工作智能体(v1.4.256 基线即用此译法);
    • 本 PR 曾于 2026-11-17 就当日的 main 提交过同等内容;11-19 上游短暂不可访问,11-20 恢复时 main 已前进 919 个提交(含一次批量机翻刷新),先前修的键全部回退,因此在本提交中基于最新 main 逐项重做并重新逐条核验;
    • CSV 预览 worker 与插件 worker 文件是真正的软件 worker 线程/文件,保留 工作进程 不变。
  • useMacosTccPromptNotice.titleOne/titleMany(EN “file prompt” 被译为“打断了一个代理”)、TerminalQuickCommandDialog.ed04233b3e、ActivityPrototypePage.770d458144 属 wrong-sense/过期文案而非术语问题,未纳入本 PR,已在 [Bug]: zh-CN i18n: 29 agent/proxy terminology errors remain after #25767 (desktop 15 + mobile 14) #43430 中单独记录。
  • 建议后续在 locale-zh-value-overrides.mjs 中为本批字符串补 overrides,避免下一次 MT 刷新再次回退(chore(i18n): use 智能体 for Chinese Agent copy #25767 当时的 overrides 覆盖面已不足以覆盖新增文案)。

English version

Summary. PR #25767 (merged 2026-10-06) standardized the Simplified-Chinese term for AI agents to 智能体, so that agent labels no longer collide with network-proxy strings (代理). A recent MT refresh reintroduced 代理 in ~540 strings (net) that the overrides map does not pin: 521 in the desktop catalog (src/renderer/src/i18n/locales/zh.json) and 14 in the mobile catalog (mobile/src/i18n/locales/zh.json). This PR re-applies the terminology mechanically on current main (one string reverted after review; the orchestration-worker term family and two pre-existing mistranslations unified in a follow-up commit, see Notes): for every key whose English source matches \b(sub)?agents?\b and whose zh value contains 代理, the term is replaced with 智能体 (子代理 → 子智能体 included). Four strings that left "Agent/agent" untranslated mid-sentence are also fixed (explicitChatWindows, agentStatusChanged, the ChecksPanel AI-queue copy, and the mobile notification test copy).

Deliberately untouched (each verified correct): 23 proxy strings (proxy URL, ProxyCommand, reverse proxy, no_proxy), 3 browser user-agent strings (用户代理), 2 ssh-agent strings in SshTargetForm (SSH 代理), the Linux authentication-agent string (身份验证代理, system component), plus product names / commands / filenames kept in English (Claude Agent Teams, Prime Agent, cursor-agent, AGENTS.md, Shared (.agents), the --agent CLI flag). A reverse scan confirms no proxy or technical-agent string reads 智能体.

Linked issue. Refs #43430 — a full en↔zh key-level audit with per-string call-site verification. Five items from that audit (turnWorking, newAgent, agentWorking, and both ssh-agent strings) were already fixed upstream and are not touched here.

Screenshots. N/A — locale value changes only; no layout, styling, or interaction change.

Testing. Verified locally (full CI gates deferred to CI): both files parse as JSON with key sets identical to HEAD (20 213 / 4 035 keys, zero added/removed); re-serializing the HEAD files with the same JSON writer reproduces the original bytes byte-for-byte, so the diff is value-only (locale files only), no formatting noise; post-fix scans show the only remaining 代理 in desktop are the 23 proxy + 3 user-agent + 2 ssh-agent + 1 authentication-agent + 4 known wrong-sense copy bugs filed in the issue, and none in mobile; no untranslated "Agent/agent" remains outside CLI flags and placeholders. Per the CodeRabbit review, all changed keys were re-scanned for the same failure class with no further findings.

Risk. Low — locale value-only change; English fallback behavior and key structure untouched.

AI review report. Correctness: term-level replacement only, gated on the English source per string; the 29 proxy/user-agent/ssh-agent/authentication-agent strings were individually confirmed untouched, and the reverse direction (智能体 on proxy/technical-agent strings) is clean. Cross-platform: JSON-only, identical behavior on all platforms. SSH/remote: copy-only. Provider-neutral: no provider-specific copy touched. Performance: catalog size and load path unchanged. UI quality: terminology now consistent with the #25767 baseline on desktop and mobile, including settings search keywords (searchAgent/searchAgents).

Security audit. Locale strings only; no input handling, command execution, path handling, auth, or IPC logic involved.

Review fix & per-item re-review. Commit c3abf75 reverts LinuxPackageInstallRecoveryCard.53c4b8e148 (system authentication agent for privileged install prompts) back to 身份验证代理 per the CodeRabbit review; all remaining changed keys were re-scanned for the same failure class — no other system-agent senses affected. Commit eb3665d comes from a per-item semantic re-review of all 535 strings: ActivityTitlebarControls.dc708f3eff (EN "Close agents" was mistranslated 紧密, now 关闭智能体), and the orchestration-worker term family (24 keys across OrchestrationPane, native-chat approval/agentMessage, workspaceCleanup rules and the crew count) unified on 工作智能体 — main mixed 工作者/工人/工作进程 for the same dispatched-AI-agent concept; CSV-preview workers and the plugin worker file keep 工作进程 since they are real software workers.

Notes. Four wrong-sense/stale copy bugs (useMacosTccPromptNotice.titleOne/titleMany — EN "file prompt" rendered as “打断了一个代理”; TerminalQuickCommandDialog.ed04233b3e; ActivityPrototypePage.770d458144) are terminology-adjacent but copy-level, so they are excluded here and documented in #43430. Follow-up suggestion: pin this batch in locale-zh-value-overrides.mjs (and consider a CI guard failing when a zh value contains 代理 while its EN source matches \b(sub)?agents?\b outside the proxy/user-agent/ssh-agent/authentication-agent allowlist), otherwise the next MT refresh will regress again.

Upstream merged 1090 commits since the PR base (another bulk MT refresh),
re-introducing 代理 across the catalogs and wiping all earlier fixes.
Re-applies the stablyai#25767 terminology, verified per item against EN sources:
- 521 mechanical 代理→智能体 (EN source matches \b(sub)?agents?\b)
- orchestration-worker family unified on 工作智能体 (~70 keys across
  OrchestrationPane, native-chat approval/agentMessage, the new bots.*
  surface, workspaceCleanup rules, orchestrationCrew counts;
  CSV-preview and plugin workers keep 工作进程 - real software workers)
- dc708f3eff: EN Close agents was 紧密代理, now 关闭智能体
- 工人 search keyword, 编排工作进程 trust-copy wording fixed
- 2 untranslated Agent/agent strings localized
Excluded (pre-existing wrong-sense copy, documented in stablyai#43430):
useMacosTccPromptNotice.titleOne/titleMany,
ActivityPrototypePage.770d458144
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The Chinese renderer and mobile locale files update agent-related terms across settings, feature descriptions, session and workspace text, activity labels, notifications, search, and bot interfaces. The changes are limited to translated strings. No application logic changes are reported.

Merge Risk: Low · up to f0f86

Chinese users who have no enabled agents on a workspace host will still see an English empty-state message. This is a small cosmetic gap, and the rest of the terminology update looks safe to merge. Translating this one string completes the update.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it re-applies the zh-CN term 智能体 for AI agent copy, which the objectives and raw summary confirm. It is specific, with one scope note (re-applied terminology after an …
Description check Passed The description follows the repository template closely. It has an English TL;DR, a Summary, a Linked Issue (Refs #43430), Screenshots marked N/A with a reason, Testing, Risk (Low), Notes, and an Engl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: it re-applies the zh-CN term 智能体 for AI agent copy, which the objectives and raw summary confirm. It is specific, with one scope note (re-applied terminology after an upstream refresh). The title is in English and the copy it describes is Chinese, which is acceptable.

Full details: Description check

Explanation

The description follows the repository template closely. It has an English TL;DR, a Summary, a Linked Issue (Refs #43430), Screenshots marked N/A with a reason, Testing, Risk (Low), Notes, and an English version. Several template sections are missing or do not follow the template headings. These include ELI5, Why, a plain 'Fixes #' issue link (the issue is referenced as 'Refs' only, which the template rejects for outside contributors), Performance (the 'None, because' sentence is not completed in the template form), a risk level set in the template format, the Agent skill upstream boundary checkbox, and the Checklist. The description is mostly complete, but the required template sections are not all present.

Resolution

Consider adding the template headings ELI5 and Why. Replace 'Refs #43430' with an actual issue link if one applies, and state the Performance line in full (for example, 'None, because this only changes locale string values'). Also complete the Agent skill upstream boundary checkbox and the Checklist, or mark them N/A.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

⚠️ This pull request shows signs of AI-generated slop (ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11c44460-1545-4b46-a939-d70fd0f5d845
Commits

Reviewing files that changed from the base of the PR and between fff597a and f0f8678.

Files selected for processing: 2

  • mobile/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

"agent": "智能体",
"selectAgent": "选择智能体",
"detectingAgents": "正在此工作区主机上检测智能体…",
"detectionFailed": "无法检测此工作区主机上的智能体",
"noAgents": "No enabled agents were detected on this workspace host.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Translate the no-agent empty state.

When no enabled agents are detected, Chinese users still see this message in English. Translate it to complete the agent-copy update.

This follows the PR objective to correct untranslated agent copy.

@YorrickBao

Copy link
Copy Markdown
Author

撤回:暂不继续推进,审计记录保留在 #43430。Withdrawing for now — not pursuing this further; the audit trail and root-cause analysis remain available in #43430.

@YorrickBao YorrickBao closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant