Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(i18n): 术语表扩到 27 条,补 ja/ko 约束与影子 catalog 门禁

Dash8a5f5e9ab985
diff --git a/apps/mobile/src/__tests__/shadowCatalogGlossary.test.ts b/apps/mobile/src/__tests__/shadowCatalogGlossary.test.ts
new file mode 100644
index 0000000000..d04db53181
--- /dev/null
+++ b/apps/mobile/src/__tests__/shadowCatalogGlossary.test.ts
@@ -0,0 +1,146 @@
+/**
+ * 影子 catalog 的术语表门禁。
+ *
+ * mobile 有一批**不走 i18next** 的手写四语 catalog(loginMessages / newSessionMessages),
+ * 原因是它们在 React 渲染树之外、更早期被同步调用。根脚本 check-i18n-glossary.mjs 只扫
+ * locale JSON,扫不到这些 .ts —— 这是引入术语表时明确记录在案的盲区,本测试把它补上。
+ *
+ * 走 vitest 而不是扩展根脚本:vitest 本就能解析 TS 与路径别名,直接 import 拿到运行时对象,
+ * 比在 node 脚本里正则抠 TS 源码可靠得多(嵌套结构下正则根本判不准 locale 归属)。
+ * 规则函数复用 scripts/shared/glossary-rules.mjs,与根门禁同一套判定,不另写一份。
+ */
+import { describe, expect, it } from 'vitest';
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+
+import { authErrorMessages, loginMessages } from '@/auth/loginMessages';
+import { newSessionMessages } from '@/session/newSessionMessages';
+import {
+ ELLIPSIS_LOCALES,
+ HALFWIDTH_PUNCT_LOCALES,
+ findCaseMismatch,
+ findHalfWidthPunct,
+ hasAsciiEllipsis,
+ makeExemptChecker,
+ occursIn,
+ stripNonProse,
+} from '../../../../scripts/shared/glossary-rules.mjs';
+
+const REPO_ROOT = resolve(__dirname, '../../../..');
+
+interface GlossaryTerm {
+ id: string;
+ status: 'decided' | 'proposed';
+ en: string;
+ translations: Record<string, string>;
+ forbidden?: Record<string, (string | { text: string; whenEn: string })[]>;
+ exempt?: string[];
+ checkCase?: boolean;
+}
+
+const glossary = JSON.parse(
+ readFileSync(resolve(REPO_ROOT, 'i18n/glossary.json'), 'utf8'),
+) as { locales: string[]; sourceLocale: string; terms: GlossaryTerm[] };
+
+/**
+ * 把影子 catalog 摊平成 (source, locale, key, value)。
+ * source 前缀与根脚本的 `mobile/<ns>:` 保持同一形态,便于 exempt 复用同一套写法。
+ */
+function collectEntries(): { locale: string; key: string; value: string }[] {
+ const out: { locale: string; key: string; value: string }[] = [];
+
+ // loginMessages: locale → key → string
+ for (const [locale, table] of Object.entries(loginMessages)) {
+ for (const [key, value] of Object.entries(table)) {
+ out.push({ locale, key: `mobile/loginMessages:${key}`, value });
+ }
+ }
+
+ // authErrorMessages: errorCode → locale → string(与上面维度相反)
+ for (const [code, table] of Object.entries(authErrorMessages)) {
+ for (const [locale, value] of Object.entries(table)) {
+ out.push({ locale, key: `mobile/authErrorMessages:${code}`, value });
+ }
+ }
+
+ // newSessionMessages: locale → key → string
+ for (const [locale, table] of Object.entries(newSessionMessages)) {
+ for (const [key, value] of Object.entries(table)) {
+ out.push({ locale, key: `mobile/newSessionMessages:${key}`, value });
+ }
+ }
+
+ return out;
+}
+
+const entries = collectEntries();
+
+describe('影子 catalog 术语一致性', () => {
+ it('catalog 非空且覆盖全部支持语言(防止 import 失效后测试静默通过)', () => {
+ expect(entries.length).toBeGreaterThan(0);
+ const seen = new Set(entries.map((e) => e.locale));
+ for (const locale of glossary.locales) {
+ expect(seen.has(locale), `影子 catalog 缺 ${locale}`).toBe(true);
+ }
+ });
+
+ it('不使用术语表的禁用译法', () => {
+ const violations: string[] = [];
+ for (const term of glossary.terms) {
+ if (term.status !== 'decided') continue;
+ const isExempt = makeExemptChecker(term.exempt);
+ for (const { locale, key, value } of entries) {
+ if (isExempt(key)) continue;
+ for (const entry of term.forbidden?.[locale] ?? []) {
+ // 条件禁用({ text, whenEn })依赖英文源判断,而影子 catalog 的 en 表
+ // 与 zh 表是同一份对象的不同 locale 分支,这里按 key 取同名英文条目。
+ const bad = typeof entry === 'string' ? entry : entry.text;
+ const whenEn = typeof entry === 'string' ? null : entry.whenEn;
+ if (!occursIn(stripNonProse(value), bad)) continue;
+ if (whenEn) {
+ const source = entries.find((e) => e.key === key && e.locale === glossary.sourceLocale)?.value;
+ const re = new RegExp(
+ `(?<![A-Za-z0-9_-])${whenEn.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}s?(?![A-Za-z0-9_-])`,
+ 'i',
+ );
+ if (!source || !re.test(source)) continue;
+ }
+ const expected = term.translations?.[locale] || term.en;
+ violations.push(`${locale} ${key}: 「${bad}」应为「${expected}」— ${value.slice(0, 40)}`);
+ }
+ }
+ }
+ expect(violations, `影子 catalog 命中禁用译法:\n${violations.join('\n')}`).toEqual([]);
+ });
+
+ it('保留英文的术语大小写形态统一', () => {
+ const violations: string[] = [];
+ for (const term of glossary.terms) {
+ if (term.status !== 'decided' || term.checkCase === false) continue;
+ const isExempt = makeExemptChecker(term.exempt);
+ for (const { locale, key, value } of entries) {
+ if (isExempt(key)) continue;
+ const standard = term.translations?.[locale];
+ if (!standard || standard !== term.en) continue;
+ const hit = findCaseMismatch(stripNonProse(value), standard);
+ if (hit) violations.push(`${locale} ${key}: 「${hit}」应为「${standard}」`);
+ }
+ }
+ expect(violations, `影子 catalog 大小写不统一:\n${violations.join('\n')}`).toEqual([]);
+ });
+
+ it('标点风格符合各语言规则', () => {
+ const violations: string[] = [];
+ for (const { locale, key, value } of entries) {
+ const prose = stripNonProse(value);
+ if (HALFWIDTH_PUNCT_LOCALES.has(locale)) {
+ const mark = findHalfWidthPunct(prose);
+ if (mark) violations.push(`${locale} ${key}: 中文后半角「${mark}」— ${value.slice(0, 40)}`);
+ }
+ if (ELLIPSIS_LOCALES.has(locale) && hasAsciiEllipsis(prose)) {
+ violations.push(`${locale} ${key}: 省略号应为「…」— ${value.slice(0, 40)}`);
+ }
+ }
+ expect(violations, `影子 catalog 标点不规范:\n${violations.join('\n')}`).toEqual([]);
+ });
+});
diff --git a/apps/mobile/src/i18n/locales/ja/devices.json b/apps/mobile/src/i18n/locales/ja/devices.json
index c5f0df7249..6e7588bf89 100644
--- a/apps/mobile/src/i18n/locales/ja/devices.json
+++ b/apps/mobile/src/i18n/locales/ja/devices.json
@@ -226,7 +226,7 @@
"workspace": "ワークスペース",
"projectDir": "プロジェクトディレクトリ",
"model": "モデル",
- "effort": "推論の強度",
+ "effort": "推論強度",
"timezone": "タイムゾーン"
},
"namePlaceholder": "例:毎日のプロジェクト点検",
diff --git a/apps/mobile/src/i18n/locales/ja/models.json b/apps/mobile/src/i18n/locales/ja/models.json
index 30785c8fd4..69f0fd76fc 100644
--- a/apps/mobile/src/i18n/locales/ja/models.json
+++ b/apps/mobile/src/i18n/locales/ja/models.json
@@ -23,8 +23,8 @@
"options": {
"fastMode": "高速モード",
"fastModeAccessibility": "高速モード {{model}}",
- "reasoningEffort": "推論の強度",
- "reasoningEffortAccessibility": "推論の強度 {{label}}"
+ "reasoningEffort": "推論強度",
+ "reasoningEffortAccessibility": "推論強度 {{label}}"
},
"agentSwitch": {
"browseAccessibility": "{{agent}} のモデルを表示",
diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.json
index a6b37c9d3a..2563e0074e 100644
--- a/apps/mobile/src/i18n/locales/ja/session.json
+++ b/apps/mobile/src/i18n/locales/ja/session.json
@@ -54,7 +54,7 @@
"attachmentsUploadingBeforeEdit": "添付ファイルをアップロード中です。完了してからキュー内メッセージを編集してください。",
"goalAlreadyActive": "このセッションには進行中のゴールがあります。先にこちらで対応してください。",
"resetReconfirmTitle": "再確認してください",
- "resetOfferExpired": "リセット用の認証が期限切れです。更新後の残量情報を確認してください。",
+ "resetOfferExpired": "リセット用の認証が期限切れです。更新後のクォータ情報を確認してください。",
"resetOutcomeReset": "Codex の使用量ウィンドウをリセットしました。",
"resetOutcomeNothing": "リセットが必要な使用量ウィンドウはありません。",
"resetOutcomeNoCredit": "利用できるリセット回数がありません。",
@@ -175,7 +175,7 @@
"deleteConfirmBody": "削除すると元に戻せません。",
"dirAlreadyAdded": "このディレクトリはすでにリストにあります。",
"resetCodexTitle": "Codex の使用量をリセットしますか?",
- "resetCodexBody": "{{account}} のリセットを 1 回消費します。残量ウィンドウはすぐに再開され、この操作は取り消せません。",
+ "resetCodexBody": "{{account}} のリセットを 1 回消費します。クォータウィンドウはすぐに再開され、この操作は取り消せません。",
"currentCodexAccount": "現在の Codex アカウント",
"resetConsumeOnce": "リセットを 1 回消費",
"titlePlaceholder": "セッションのタイトル",
@@ -189,10 +189,10 @@
"noSessionSpend": "セッションの使用量はまだありません",
"contextLabel": "コンテキスト",
"accountLimits": "アカウントの上限",
- "quotaExhaustedResettable": "現在の残量を使い切りました。リセットするとすぐに 1 回消費され、取り消せません。",
+ "quotaExhaustedResettable": "現在のクォータを使い切りました。リセットするとすぐに 1 回消費され、取り消せません。",
"resetting": "リセット中…",
"resetCodexUsage": "Codex の使用量をリセット",
- "quotaExhaustedNoCredit": "現在の残量を使い切りましたが、利用できるリセット回数がありません。",
+ "quotaExhaustedNoCredit": "現在のクォータを使い切りましたが、利用できるリセット回数がありません。",
"openDir": "ディレクトリを開く",
"copyPath": "パスをコピー",
"extraDirsSection": "追加参照ディレクトリ",
diff --git a/apps/mobile/src/i18n/locales/ko/message.json b/apps/mobile/src/i18n/locales/ko/message.json
index fd5fd4d66e..1c29393508 100644
--- a/apps/mobile/src/i18n/locales/ko/message.json
+++ b/apps/mobile/src/i18n/locales/ko/message.json
@@ -39,7 +39,7 @@
"statusFailed": "실패",
"statusStopped": "중지됨",
"toolUseCount": "도구 호출 {{n}}회",
- "subagentTaskTitle": "서브 에이전트 작업",
+ "subagentTaskTitle": "하위 에이전트 작업",
"recentTool": "최근 도구: {{name}}",
"outputFile": "출력: {{file}}",
"noMoreDetail": "추가 세부 정보 없음",
@@ -48,10 +48,10 @@
"listCount": "{{n}}회 목록 표시",
"collapseThinking": "생각 내용 접기",
"expandThinking": "생각 내용 펼치기",
- "subagentTyped": "서브 에이전트 · {{type}}",
- "subagent": "서브 에이전트",
+ "subagentTyped": "하위 에이전트 · {{type}}",
+ "subagent": "하위 에이전트",
"workedDuration": "작업 시간 {{duration}}",
- "subagentSummary": "서브 에이전트 요약",
+ "subagentSummary": "하위 에이전트 요약",
"agentSwitchLabel": "{{from}}에서 {{to}}(으)로 전환됨",
"agentSwitchViewHandoff": "{{label}}, 인계 내용 보기",
"sessionResumedPill": "원래 세션을 재개함",
diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.json
index f9cf73ee01..40af8aa8c6 100644
--- a/apps/mobile/src/i18n/locales/ko/session.json
+++ b/apps/mobile/src/i18n/locales/ko/session.json
@@ -218,7 +218,7 @@
"retry": "다시 시도",
"ignore": "무시",
"codexThreadLost": "Codex 인증 모드가 전환되어 이 세션을 계속할 수 없습니다 —— 새 세션을 만들면 적용됩니다.",
- "encryptedContentInvalid": "공급자 변경으로 암호화를 사용할 수 없게 되어 이 세션은 원래 공급자에서만 사용할 수 있습니다. 컴퓨터에서 처리하세요(Fork하여 프로토콜 암호화 콘텐츠를 버린 후 새 세션에서 계속할 수 있습니다)."
+ "encryptedContentInvalid": "제공자 변경으로 암호화를 사용할 수 없게 되어 이 세션은 원래 제공자에서만 사용할 수 있습니다. 컴퓨터에서 처리하세요(Fork하여 프로토콜 암호화 콘텐츠를 버린 후 새 세션에서 계속할 수 있습니다)."
},
"row": {
"moreOptions": "기타 옵션",
@@ -232,6 +232,6 @@
"extraDirsSummary": "추가 디렉터리 {{num}}개",
"noExtraDirsSummary": "추가 디렉터리 없음",
"attachmentUploadFailed": "첨부 업로드에 실패했습니다. 다시 시도하거나 이 메시지를 삭제하세요.",
- "authGateHint": "이 컴퓨터에 {{agent}}에 연결된 모델 공급자가 없어 전송이 실패합니다. 컴퓨터의 {{appName}}에서 '설정 → 모델 공급자'를 설정하세요."
+ "authGateHint": "이 컴퓨터에 {{agent}}에 연결된 모델 제공자가 없어 전송이 실패합니다. 컴퓨터의 {{appName}}에서 '설정 → 모델 제공자'를 설정하세요."
}
}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/devices.json b/apps/mobile/src/i18n/locales/zh-CN/devices.json
index b49ef39a3d..53f8ad2501 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/devices.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/devices.json
@@ -75,7 +75,7 @@
"preview": {
"needAttention": "{{count}} 个需关注",
"waiting": "等待处理 {{count}} 个",
- "automationRunning": "自动化执行中",
+ "automationRunning": "自动化运行中",
"totalRuns": "共 {{count}} 次运行"
}
},
@@ -95,10 +95,10 @@
"a11y": "按{{label}}分组"
},
"metric": {
- "active": "活动",
+ "active": "活跃",
"waiting": "待处理",
"automation": "自动化",
- "activeA11y": "筛选活动对话",
+ "activeA11y": "筛选活跃对话",
"waitingA11y": "筛选待处理对话",
"automationA11y": "筛选自动化对话"
},
@@ -157,8 +157,8 @@
"emptyTitle": "这个项目还没有对话"
},
"subtitle": {
- "deviceActive": "{{deviceName}} · {{count}} 个活动对话",
- "activeAndProjects": "{{count}} 个活动对话 · {{projects}} 个项目"
+ "deviceActive": "{{deviceName}} · {{count}} 个活跃对话",
+ "activeAndProjects": "{{count}} 个活跃对话 · {{projects}} 个项目"
},
"row": {
"a11yAutomationGroup": "自动化对话组 {{title}}",
@@ -173,7 +173,7 @@
"automationPrefix": "自动化",
"sessionCount": "{{count}} 个对话",
"aggregate": "聚合",
- "running": "执行中",
+ "running": "运行中",
"unread": "未读 {{count}}"
},
"child": {
@@ -304,7 +304,7 @@
"promptEmpty": "没有保存任务提示词",
"deleteA11y": "删除自动化",
"runNowA11y": "立即执行自动化",
- "running": "执行中",
+ "running": "运行中",
"resumeA11y": "恢复自动化",
"pauseA11y": "暂停自动化",
"resume": "恢复",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/message.json b/apps/mobile/src/i18n/locales/zh-CN/message.json
index 0234c5fb8d..f0777e1ee7 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/message.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/message.json
@@ -177,7 +177,7 @@
"learnStarted": "技能学习已启动",
"learnStartedBody": "蒸馏在桌面端后台进行,完成后请到桌面端查看并评审技能草案。",
"learnFailed": "技能学习未能启动",
- "learnBusyBody": "已有一个学习任务在进行中,等它完成后再试。",
+ "learnBusyBody": "已有一个学习任务在运行中,等它完成后再试。",
"learnFailedBody": "启动失败:{{detail}}",
"unknownError": "未知错误"
},
diff --git a/docs/dev-rules/engineering-conventions.md b/docs/dev-rules/engineering-conventions.md
index 7141805fd6..7f07639f31 100644
--- a/docs/dev-rules/engineering-conventions.md
+++ b/docs/dev-rules/engineering-conventions.md
@@ -120,14 +120,22 @@ UI 文案的语气与措辞另见 [`DESIGN.md`](../design-rules/DESIGN.md) 的 V
- `pnpm check:i18n-glossary` 校验译文术语与标点,并检查 `GLOSSARY.md` 是否与术语表同步。
- 两者互补:前者管「key 齐不齐」,后者管「词译得一不一致」,谁也替代不了谁。改
i18n 后两个都要跑(CI 已强制)。
-- **已知盲区**:mobile 存在 i18next 之外的手写四语 catalog(`src/auth/loginMessages.ts`
- 等 `.ts` 文件),guard 只扫 locale JSON,不解析这些 TS。改动它们时需人工对照术语表。
+- **影子 catalog**:mobile 有一批不走 i18next 的手写四语 catalog(`src/auth/loginMessages.ts`、
+ `src/session/newSessionMessages.ts`),根脚本只扫 locale JSON、扫不到这些 `.ts`。它们由
+ `apps/mobile/src/__tests__/shadowCatalogGlossary.test.ts` 覆盖——走 vitest 直接 import 运行时
+ 对象,复用 `scripts/shared/glossary-rules.mjs` 的同一套判定,随 `test:unit` 阻断。新增同类
+ 手写 catalog 时记得加进那个测试的 `collectEntries()`。
- **批量改术语时必须跑全量 `pnpm test:unit`**:仓库里有若干测试直接断言中文文案
(`automationGeneratedSessions.test.ts`、`builtinToolsCollabDescriptionI18n.test.ts`、
mobile 的 `sessionMenu.test.ts` 等)。它们是有意的文案锁,改词后要同步更新期望值,
不能靠 guard 绿灯就认为改完了。反过来这也是一层兜底——Session→对话 那轮正是
`mobileCindyVoiceSession.test.ts` 暴露了漏网的「语音识别会话」(ASR WebSocket
连接,不是产品对话)。
+- **有些 locale 文案是 package 源的镜像**:改 locale 时必须同步改源,否则镜像断言会红。
+ 已知两处:`packages/maker-shared/src/sessionOperation.ts` 的 `DESKTOP_SESSION_CHAT_PLACEHOLDER_ZH_CN`
+ (mobile composer placeholder 必须等于 desktop `ccAgent.layout.chatPlaceholder`)、
+ `packages/maker-scheduler/src/builtin-templates.ts`(desktop locale 的 scheduler 模板块要求与
+ package 源逐字一致)。这类断言不是碍事,正是它们保证了跨端文案不漂移。
- **标点可能不在 locale 里**:部分错误消息由代码拼接(如 `cloudVoiceHttpErrorMessage()`
给 `composer.voice.refineFailed` 补半角冒号),guard 只扫 locale JSON,改不到也管不到。
批量改标点后若测试断言与实际值方向相反,先查该文案的冒号究竟来自 locale 还是代码,
diff --git a/i18n/GLOSSARY.md b/i18n/GLOSSARY.md
index 35e64fbcd1..a97de2e7b5 100644
--- a/i18n/GLOSSARY.md
+++ b/i18n/GLOSSARY.md
@@ -15,25 +15,33 @@
| 英文 | zh-CN | ja | ko | 禁用译法 |
| --- | --- | --- | --- | --- |
-| **Agent** | `Agent`(保留英文) | エージェント | 에이전트 | zh-CN: 智能体 |
-| **Automation** | 自动化 | オートメーション | 자동화 | — |
+| **Active** | 活跃 | アクティブ | 활성 | zh-CN: 活动(仅当英文含 Active) |
+| **Agent** | `Agent`(保留英文) | `Agent`(保留英文) | `Agent`(保留英文) | zh-CN: 智能体 |
+| **Author** | 作者 | 作成者 | 작성자 | zh-CN: 提交者(仅当英文含 Author);zh-CN: 提出者(仅当英文含 Author) |
+| **Automation** | 自动化 | 自動化 | 자동화 | ja: オートメーション;ko: 오토메이션 |
| **Balance** | 余额 | 残高 | 잔액 | — |
| **Chat** | 对话 | チャット | 채팅 | zh-CN: 聊天 |
+| **Collaboration** | 协同 | 協同 | 협업 | zh-CN: 协作(仅当英文含 Collaboration) |
+| **Collapse** | 收起 | 折りたたむ | 접기 | zh-CN: 折叠(仅当英文含 Collapse) |
| **Credits** | 点数 | クレジット | 크레딧 | zh-CN: 额度 |
-| **Effort** | 推理强度 | 推論強度 | 추론 강도 | zh-CN: 思考强度;zh-CN: 思考深度;zh-CN: 推理深度;zh-CN: 努力程度;zh-CN: 推理力度 |
-| **Issue** | `Issue`(保留英文) | `Issue`(保留英文) | `Issue`(保留英文) | zh-CN: 工单;zh-CN: 议题 |
+| **Directory** | 目录 | ディレクトリ | 디렉터리 | — |
+| **Dismiss** | 关闭 | 閉じる | 닫기 | zh-CN: 忽略(仅当英文含 Dismiss);zh-CN: 知道了(仅当英文含 Dismiss) |
+| **Effort** | 推理强度 | 推論強度 | 추론 강도 | zh-CN: 思考强度;zh-CN: 思考深度;zh-CN: 推理深度;zh-CN: 努力程度;zh-CN: 推理力度;ja: 推論レベル;ja: 推論の強度 |
+| **Issue** | `Issue`(保留英文) | `Issue`(保留英文) | 이슈 | zh-CN: 工单;zh-CN: 议题;ja: 課題 |
| **Plugin** | 插件 | プラグイン | 플러그인 | zh-CN: Plugin;zh-CN: plugin |
| **Project** | 项目 | プロジェクト | 프로젝트 | zh-CN: Project |
-| **Provider** | 供应商 | プロバイダー | 제공업체 | zh-CN: 提供方;zh-CN: 提供商 |
+| **Provider** | 供应商 | プロバイダー | 제공자 | zh-CN: 提供方;zh-CN: 提供商;ja: 提供元;ja: 事業者;ko: 공급자;ko: 제공업체 |
| **Proxy** | `Proxy`(保留英文) | プロキシ | 프록시 | zh-CN: 代理 |
-| **Quota** | 配额 | クォータ | 쿼터 | — |
+| **Quota** | 配额 | クォータ | 할당량 | ja: 残量 |
+| **Running** | 运行中 | 実行中 | 실행 중 | zh-CN: 执行中(仅当英文含 Running);zh-CN: 进行中(仅当英文含 Running) |
| **Session** | 对话 | セッション | 세션 | zh-CN: 会话 |
-| **Skill** | 技能 | スキル | 스킬 | — |
-| **SkillHub** | `SkillHub`(保留英文) | `SkillHub`(保留英文) | `SkillHub`(保留英文) | — |
-| **Subagent** | `Subagent`(保留英文) | サブエージェント | 하위 에이전트 | — |
+| **Skill** | 技能 | スキル | 스킬 | ja: 技能;ko: 기술 |
+| **SkillHub** | `SkillHub`(保留英文) | `SkillHub`(保留英文) | `SkillHub`(保留英文) | ja: スキルハブ;ko: 스킬 허브 |
+| **Subagent** | `Subagent`(保留英文) | サブエージェント | 하위 에이전트 | ko: 서브 에이전트 |
| **Thread** | 对话 | スレッド | 스레드 | zh-CN: 线程 |
-| **Usage** | 用量 | 使用量 | 사용량 | zh-CN: 使用情况;zh-CN: 使用表现 |
+| **Usage** | 用量 | 使用量 | 사용량 | zh-CN: 使用情况;zh-CN: 使用表现;ja: 使用状況;ja: 利用状況;ko: 사용 현황 |
| **Worker** | `Worker`(保留英文) | `Worker`(保留英文) | `Worker`(保留英文) | — |
+| **Worktree** | worktree | worktree | worktree | zh-CN: 工作树(仅当英文含 Worktree);zh-CN: 工作区(仅当英文含 Worktree) |
### 分场合译法
@@ -41,6 +49,8 @@
| 英文 | 语言 | 译法 | 什么场合 |
| --- | --- | --- | --- |
+| **Active** | zh-CN | 活跃 | 默认 |
+| Active | zh-CN | 生效中 | 计费语境("no active subscription"→没有生效中的订阅),指订阅状态而非活跃度 |
| **Automation** | zh-CN | 自动化 | 默认 |
| Automation | zh-CN | 自动任务 | 指单条自动化实例(一个定时跑的任务)时 |
| Automation | zh-CN | 自动化任务 | 需要与模块名区分、强调它是一条任务时 |
@@ -50,6 +60,8 @@
| Credits | zh-CN | 重置次数 | reset credits——指可用的配额重置次数,与计费点数无关 |
| **Provider** | zh-CN | 供应商 | 默认 |
| Provider | zh-CN | 模型供应商 | 首次出现或需要消歧时用全称,如设置页标题 |
+| **Running** | zh-CN | 运行中 | 默认 |
+| Running | zh-CN | 正在运行 | 完整句子里作谓语时("Agent 正在运行"),不是状态标签 |
| **Skill** | zh-CN | 技能 | 默认 |
| Skill | zh-CN | Skill | 技术语境下指代具体的 skill 文件 / 目录结构时,可保留英文 |
| **Thread** | zh-CN | 对话 | 默认 |
@@ -58,28 +70,38 @@
### 裁决理由
-- **Agent** — 产品一级概念,中文保留英文原词(现状 44:5 已是主流)。「代理」一词在中文 UI 里整体废弃——Agent 与 Proxy 都保留英文,不共用这个译名(2026-07 裁决);该词的 forbidden 规则统一登记在 proxy 条目下,避免同一处违规被两个术语重复报告。引入术语表时全仓仅 9 处「代理」,已全部清理为 Agent / Subagent / Proxy。ja / ko 沿用既有片假名 / 한글 音译,不受本条约束。豁免 settings.remote 整段:那里的 agent 指 ssh-agent(英文原文即 "SSH agent" / "probe agent"),是与产品 Agent 同形的另一个概念。
+- **Active** — 对话 / 设备状态用「活跃」(现状 21:7)。mobile/devices 同一屏上筛选 chip 写「活跃」、指标磁贴写「活动」。条件禁用:「活动」是 Activity 的正确译法,无条件禁会误伤「活动记录」这类。
+- **Agent** — 产品一级概念,四语统一保留英文原词。zh-CN 现状 44:5 已是主流;ja / ko 实测拉丁 Agent 同样是主流(59:38 / 58:39),故三语一致(2026-07 修正:此前误按抽样声明为片假名 エージェント / 한글 에이전트,那是少数派)。「代理」一词在中文 UI 里整体废弃——Agent 与 Proxy 都保留英文,不共用这个译名;该词的 forbidden 统一登记在 proxy 条目下,避免同一处违规被两个术语重复报告。引入术语表时全仓仅 9 处「代理」,已全部清理为 Agent / Subagent / Proxy。豁免 settings.remote 整段:那里的 agent 指 ssh-agent(英文原文即 "SSH agent" / "probe agent"),是与产品 Agent 同形的另一个概念。
- 豁免范围:`desktop:settings.remote.`
-- **Automation** — 模块名 / 能力名用「自动化」(现状 88 处主流);指单条实例时用「自动任务」,这是刻意保留的场景差异——一刀切会写出「查看你的自动化」这类别扭中文。特别注意 Automation 在本产品里指两个不同概念:scheduler 的定时任务,以及 settings.computerUse 的操控电脑能力;后者用「自动操作电脑 / 浏览器」,改成「自动化电脑」反而不通。因此不设 forbidden。
+- **Author** — 中文用「作者」(现状 9:4)。典型的同模块自相矛盾:issueTracker 同一个页面里,assignee.labelAuthor 写「提交者」、list.filterAuthor 写「提出者」、visibility.onlyAuthorCanChange 写「作者」——同一个字段三种叫法。条件禁用避免误伤 Committer / Reporter 等其它英文词的正确译法。
+- **Automation** — 模块名 / 能力名用「自动化」(现状 88 处主流);指单条实例时用「自动任务」,这是刻意保留的场景差异——一刀切会写出「查看你的自动化」这类别扭中文。特别注意 Automation 在本产品里指两个不同概念:scheduler 的定时任务,以及 settings.computerUse 的操控电脑能力;后者用「自动操作电脑 / 浏览器」,改成「自动化电脑」反而不通。因此不设 forbidden。(2026-07 修正:ja 原声明 オートメーション 仅 37/121,主流是 自動化;ko 的 자동화 75/121 本就正确。)
- **Balance** — 账户余额用「余额」。原先被并入「额度」(可用额度 / 额度更新于 / 剩余额度),与 Credits、Quota 混同。Balance 是「账上还剩多少」,Credits 是「可购买消耗的计数单位」,Quota 是「周期内上限」——三者是不同层面的量,中文必须分开。
- **Chat** — 在本产品里 Chat 与 Session 指同一个东西,中文统一叫「对话」(2026-07 裁决),不再区分「聊天 / 会话 / 对话」三套说法。原先 22 处「聊天」(聊天正文、聊天区、聊天记录…)已一并改为「对话」。ja / ko 保留各自既有译法,两语没有中文这种三词混用问题。
+- **Collaboration** — Orca 多 Agent 功能名,中文用「协同」(现状 21:2)。可见 bug:设置导航项写「协作」,点进去页面标题写「协同」。条件禁用:settings.contacts 里的「协作经历」是 collaboration history,属另一个语义,英文源不含独立 Collaboration 一词时不判违规。
+ - 豁免范围:`desktop:settings.contacts.`
+- **Collapse** — 中文用「收起」(现状 29:7),与反义词「展开」(Expand,29/30 已统一)配对。ccAgent 与 rightSidebar 内部各自「收起 / 折叠」混用,是同模块自相矛盾。条件禁用:「折叠」在别处可能是正常中文,只在英文源含 Collapse 时判违规。
- **Credits** — 计费点数用「点数」。清理前中文「额度」同时对应 Balance / Credits / Quota 三个英文概念,是计费面板里最容易误导用户的一处:同一个 billing 页面里「点数」和「额度」并存,而「额度」在别处又指配额。裁决把三者拆开——Credits =「点数」、Quota =「配额」、Balance =「余额」,「额度」整体退出。第三方原生 credits 与 reset credits 属不同概念,走 alsoAllowed。
+- **Directory** — Directory 用「目录」(现状 96:4),Folder 用「文件夹」(37:20),两个英文词在中文里也分开。**本条刻意不设 forbidden**:英文侧自己就在一句话里混用二者("not a folder. Choose a project directory."、"re-select the working directory and wait for the folder badge"),而条件禁用是句子级匹配,区分不了句内哪个中文词对应哪个英文词——实测 4 处命中全是假阳性,那 4 条中文其实译得完全正确。要真正管住这对词,得先清理英文侧的 path / folder / directory 混用。此条目保留为文档指引,供人查阅。
+- **Dismiss** — 中文用「关闭」(现状 6:4)。同一个 chat 模块里,errorBanner 写「关闭错误提示」、interruptedBanner 写「忽略此中断提示」。条件禁用:「忽略」是 Ignore 的正确译法、「知道了」是 Got it 的正确译法,只在英文源为 Dismiss 时才算违规。
- **Effort** — 模型的推理投入档位(low/medium/high/…)。用「推理强度」有三重依据:①同类工具 i18n 里断层第一(GitHub 代码搜索共现量级 1452,第二名「思考强度」431);②OpenAI 简中帮助中心即用此词;③跨 provider 中立——Cindy 的 create_worker 用一个 effort 同时映射 Codex reasoning effort 与 Claude thinking 预算,而 Anthropic 官方简中叫「努力程度」、OpenAI 叫「推理强度」,需要不偏向任一方的词。禁用项各有硬理由:「思考深度」「推理深度」会与国内产品普遍的「深度思考」开关撞车,且语义错误(低 effort 是想得少,不是想得浅);「努力程度」在中文里强烈指向人的绩效评价;「推理等级/级别」未入禁用但不推荐——Cindy 已有 model tier 概念,「等级」易被读成模型档位。
-- **Issue** — 保留英文(2026-07 裁决)。现状「工单」32 /「议题」4 是既有 bug 的来源:列表按钮写「新建议题」、点进去页面标题写「新建工单」。「问题」不入 forbidden——它在「修复问题和失败」这类泛指语境下是正常中文,不是 Issue 的误译。checkCase 关闭:issue 同时是常用英语单词,prompt 模板里的 "fix the issue" 是正常用法,做大小写约束会制造 9 处假阳性。
+- **Issue** — 保留英文(2026-07 裁决)。现状「工单」32 /「议题」4 是既有 bug 的来源:列表按钮写「新建议题」、点进去页面标题写「新建工单」。「问题」不入 forbidden——它在「修复问题和失败」这类泛指语境下是正常中文,不是 Issue 的误译。checkCase 关闭:issue 同时是常用英语单词,prompt 模板里的 "fix the issue" 是正常用法,做大小写约束会制造 9 处假阳性。(2026-07 修正:ko 原声明 Issue 仅 3 处,实测 이슈 45 处才是主流,改随本语言主流;ja 的 Issue 43:2 保持不变。)
- **Plugin** — 中文一律「插件」,不保留英文原词(现状 94:4)。历史上 Ghost / Plugin 两种叫法并存,对外统一为「插件」。
- **Project** — 中文一律「项目」(现状 119:15)。同一个侧边栏里筛选叫「项目」、批量操作提示叫「Project」是既有 bug。小写 project 不入 forbidden——它常出现在路径与文件名里(project.json)。
-- **Provider** — 中文用「供应商」(现状 36:18 领先简称)。全称「模型供应商」在需要消歧的位置仍可用。「提供商」「提供方」是同义漂移,禁用——设置页标题写「模型供应商」、它自己的表单写「提供商」是既有 bug。豁免 login.ssoVerificationSubtitle:那里的「身份提供方」是 SSO / SAML 领域 Identity Provider 的标准中文术语,与模型供应商是两个概念。
- - 豁免范围:`desktop:login.ssoVerificationSubtitle`
+- **Provider** — 中文用「供应商」(现状 36:18 领先简称)。全称「模型供应商」在需要消歧的位置仍可用。「提供商」「提供方」是同义漂移,禁用——设置页标题写「模型供应商」、它自己的表单写「提供商」是既有 bug。豁免 ssoVerificationSubtitle:那里的「身份提供方」是 SSO / SAML 领域 Identity Provider 的标准中文术语,与模型供应商是两个概念。该文案在 desktop locale 与 mobile 影子 catalog 各有一份副本,两处都要豁免。(2026-07 修正:ko 原声明 제공업체 仅 6 处,实测 제공자 32 处为主流,改随主流。)
+ - 豁免范围:`desktop:login.ssoVerificationSubtitle`、`mobile/loginMessages:ssoVerificationSubtitle`
- **Proxy** — 网络代理,中文保留英文原词(2026-07 裁决:Agent 与 Proxy 都不叫「代理」)。这条 forbidden 同时兜住 Agent / Subagent 的误译——「代理」在 zh-CN 文案里一律视为违规,无论它来自哪个英文词。ja / ko 沿用既有音译。不设 exempt:本条只禁中文「代理」,settings.remote 里的 ssh-agent 是英文、不会命中,加豁免只会平白削弱门禁。
-- **Quota** — 周期内的使用上限用「配额」(现状已有 3 处这么写)。与 credits 条目一起裁决:「额度」原先同时表示 Balance / Credits / Quota,三个概念在计费与限额提示里互相污染。「额度」的 forbidden 统一登记在 credits 条目下,不在这里重复——一个词只归属一个术语,否则同一处违规会被两个术语各报一次。
+- **Quota** — 周期内的使用上限用「配额」(现状已有 3 处这么写)。与 credits 条目一起裁决:「额度」原先同时表示 Balance / Credits / Quota,三个概念在计费与限额提示里互相污染。「额度」的 forbidden 统一登记在 credits 条目下,不在这里重复——一个词只归属一个术语,否则同一处违规会被两个术语各报一次。(2026-07 修正:ko 原声明 쿼터 在全仓零出现,属凭空造词;ja 原声明 クォータ 仅 desktop 用、mobile 用 残量。定为 ja クォータ / ko 할당량——残量 语义偏 Balance 会与 残高 混淆,而 ko 的 사용량 正是 Usage 的标准词,让 Quota 占用它会重演 zh「额度」三义合一的错误。)
+- **Running** — 状态标签用「运行中」(现状 16:9)。条件禁用是必需的——「进行中」是 In Progress 的正确译法、「执行中」在别处也可能对,无条件禁会大面积误伤。mobile/devices 的自动化面板上「运行中 / 执行中 / 重跑中」三种写法同屏出现。
- **Session** — 面向用户一律叫「对话」——「会话」太生硬难懂(2026-07 裁决)。代码与内部标识仍用 Session,本条只约束 UI 文案。Chat 合并到同一个词,见 chat 条目。落地时把 440 处「会话」+ 22 处「聊天」统一改为「对话」。ja / ko 沿用既有音译,不受本条约束。豁免的 4 处是同形异义的技术 session(登录态、WebSocket 语音连接),与产品对话无关——注意 login.errors 的「绑定会话」指账号绑定态,scheduler 的「绑定对话」才是产品对话,两者同名不同义,靠 key 精确区分。
- 豁免范围:`desktop:login.errors.INVALID_LOGIN_TICKET`、`desktop:login.errors.INVALID_BIND_TICKET`、`mobile/composer:voice.missingConnectionProvider`、`mobile/composer:voice.sessionExpiredOrForbidden`、`mobile/composer:voice.sessionNotConnected`
-- **Skill** — 中文用「技能」(现状 32:26 领先)。偶尔保留英文 Skill 是允许的,因此不设 forbidden——硬性禁用会逼出别扭的中文。SkillHub 作为产品名保留英文,单独登记在 skillhub 条目。
+- **Skill** — 中文用「技能」(现状 32:26 领先),偶尔保留英文 Skill 也允许,故 zh-CN 不设 forbidden——硬性禁用会逼出别扭的中文。ja / ko 则禁用 技能 / 기술:那是与 スキル / 스킬 并存的同义漂移,且只出现在 skillhub 内部(3 / 3 处)。ko 的 기술 是多义词(技术 / 记述 / 技能),两处非 Skill 义已按 key 豁免。SkillHub 作为产品名单独登记在 skillhub 条目。
+ - 豁免范围:`desktop:localDbFatal.details`、`desktop:issueTracker.create.descriptionPlaceholder`
- **SkillHub** — 产品名,四语一律保留英文原样(暂定保留,未来若做中文名再改)。注意与 skill 条目区分:侧边栏 tab 现在叫「技能」但实际指 SkillHub,创建面板的「技能」指 Skills——这是既有 bug,两者不是一个东西不该同名,清理存量时需一并处理。
- **Subagent** — Agent 的派生概念,中文跟随 Agent 保留英文原词,不译「子代理」——「代理」在中文 UI 已整体废弃。「子代理」含「代理」,由 proxy 条目的 forbidden 统一拦截,这里不重复登记。ja / ko 沿用既有音译。
- **Thread** — 全仓仅 8 处,按语境分四类,是「同一个词必须分场合翻译」的典型:①指产品内的对话 → 跟随 session 叫「对话」(已落地 3 处);②Codex 外部概念 → 保留 thread;③GitHub PR review thread →「review 评论」;④比喻用法 "persistent work thread" → 原译「工作线程」,中文有 OS 线程歧义,已改写为「持续推进的工作对话」。「线程」一律禁用。
- **Usage** — 中文用「用量」(现状 37:6 压倒性)。「使用情况」「使用表现」是同义漂移,禁用。注意 usage 在英文里也有「用法」义(如 CLI usage),那属于另一个概念,不在本条约束范围。
- **Worker** — Orca 协同角色名,四语统一保留英文。这里只钉大小写形态:首字母大写 Worker。小写 worker 由 guard 的大小写规则单独覆盖(desktop 26:13 混用、mobile 一律小写)。
+- **Worktree** — Git worktree 是外部工具的既定概念,四语一律保留英文小写原词(现状 21 处最多)。desktop:chat 一个模块里就有 worktree / 工作区 / 工作树 三种写法。特别要紧的是「工作区」——它同时被用于 worktree、Workspace、working tree 三个不同英文概念,必须让出来只表示 Workspace;working directory 用「工作目录」。条件禁用只在英文源含 Worktree 时生效,不影响 Workspace 的正常翻译。
## 待讨论术语
diff --git a/i18n/glossary.json b/i18n/glossary.json
index 22bf5ca2f0..c36bab774d 100644
--- a/i18n/glossary.json
+++ b/i18n/glossary.json
@@ -1,7 +1,12 @@
{
"$schema": "./glossary.schema.json",
"version": 1,
- "locales": ["en", "zh-CN", "ja", "ko"],
+ "locales": [
+ "en",
+ "zh-CN",
+ "ja",
+ "ko"
+ ],
"sourceLocale": "en",
"terms": [
{
@@ -10,13 +15,15 @@
"en": "Agent",
"translations": {
"zh-CN": "Agent",
- "ja": "エージェント",
- "ko": "에이전트"
+ "ja": "Agent",
+ "ko": "Agent"
},
"forbidden": {
- "zh-CN": ["智能体"]
+ "zh-CN": [
+ "智能体"
+ ]
},
- "note": "产品一级概念,中文保留英文原词(现状 44:5 已是主流)。「代理」一词在中文 UI 里整体废弃——Agent 与 Proxy 都保留英文,不共用这个译名(2026-07 裁决);该词的 forbidden 规则统一登记在 proxy 条目下,避免同一处违规被两个术语重复报告。引入术语表时全仓仅 9 处「代理」,已全部清理为 Agent / Subagent / Proxy。ja / ko 沿用既有片假名 / 한글 音译,不受本条约束。豁免 settings.remote 整段:那里的 agent 指 ssh-agent(英文原文即 \"SSH agent\" / \"probe agent\"),是与产品 Agent 同形的另一个概念。",
+ "note": "产品一级概念,四语统一保留英文原词。zh-CN 现状 44:5 已是主流;ja / ko 实测拉丁 Agent 同样是主流(59:38 / 58:39),故三语一致(2026-07 修正:此前误按抽样声明为片假名 エージェント / 한글 에이전트,那是少数派)。「代理」一词在中文 UI 里整体废弃——Agent 与 Proxy 都保留英文,不共用这个译名;该词的 forbidden 统一登记在 proxy 条目下,避免同一处违规被两个术语重复报告。引入术语表时全仓仅 9 处「代理」,已全部清理为 Agent / Subagent / Proxy。豁免 settings.remote 整段:那里的 agent 指 ssh-agent(英文原文即 \"SSH agent\" / \"probe agent\"),是与产品 Agent 同形的另一个概念。",
"exempt": [
"desktop:settings.remote."
]
@@ -30,7 +37,11 @@
"ja": "サブエージェント",
"ko": "하위 에이전트"
},
- "forbidden": {},
+ "forbidden": {
+ "ko": [
+ "서브 에이전트"
+ ]
+ },
"note": "Agent 的派生概念,中文跟随 Agent 保留英文原词,不译「子代理」——「代理」在中文 UI 已整体废弃。「子代理」含「代理」,由 proxy 条目的 forbidden 统一拦截,这里不重复登记。ja / ko 沿用既有音译。"
},
{
@@ -43,7 +54,9 @@
"ko": "프록시"
},
"forbidden": {
- "zh-CN": ["代理"]
+ "zh-CN": [
+ "代理"
+ ]
},
"note": "网络代理,中文保留英文原词(2026-07 裁决:Agent 与 Proxy 都不叫「代理」)。这条 forbidden 同时兜住 Agent / Subagent 的误译——「代理」在 zh-CN 文案里一律视为违规,无论它来自哪个英文词。ja / ko 沿用既有音译。不设 exempt:本条只禁中文「代理」,settings.remote 里的 ssh-agent 是英文、不会命中,加豁免只会平白削弱门禁。"
},
@@ -57,7 +70,10 @@
"ko": "플러그인"
},
"forbidden": {
- "zh-CN": ["Plugin", "plugin"]
+ "zh-CN": [
+ "Plugin",
+ "plugin"
+ ]
},
"note": "中文一律「插件」,不保留英文原词(现状 94:4)。历史上 Ghost / Plugin 两种叫法并存,对外统一为「插件」。",
"exempt": []
@@ -72,7 +88,9 @@
"ko": "프로젝트"
},
"forbidden": {
- "zh-CN": ["Project"]
+ "zh-CN": [
+ "Project"
+ ]
},
"note": "中文一律「项目」(现状 119:15)。同一个侧边栏里筛选叫「项目」、批量操作提示叫「Project」是既有 bug。小写 project 不入 forbidden——它常出现在路径与文件名里(project.json)。",
"exempt": []
@@ -89,7 +107,6 @@
"forbidden": {},
"note": "Orca 协同角色名,四语统一保留英文。这里只钉大小写形态:首字母大写 Worker。小写 worker 由 guard 的大小写规则单独覆盖(desktop 26:13 混用、mobile 一律小写)。"
},
-
{
"id": "session",
"status": "decided",
@@ -101,7 +118,9 @@
},
"checkCase": false,
"forbidden": {
- "zh-CN": ["会话"]
+ "zh-CN": [
+ "会话"
+ ]
},
"note": "面向用户一律叫「对话」——「会话」太生硬难懂(2026-07 裁决)。代码与内部标识仍用 Session,本条只约束 UI 文案。Chat 合并到同一个词,见 chat 条目。落地时把 440 处「会话」+ 22 处「聊天」统一改为「对话」。ja / ko 沿用既有音译,不受本条约束。豁免的 4 处是同形异义的技术 session(登录态、WebSocket 语音连接),与产品对话无关——注意 login.errors 的「绑定会话」指账号绑定态,scheduler 的「绑定对话」才是产品对话,两者同名不同义,靠 key 精确区分。",
"exempt": [
@@ -123,7 +142,9 @@
},
"checkCase": false,
"forbidden": {
- "zh-CN": ["聊天"]
+ "zh-CN": [
+ "聊天"
+ ]
},
"note": "在本产品里 Chat 与 Session 指同一个东西,中文统一叫「对话」(2026-07 裁决),不再区分「聊天 / 会话 / 对话」三套说法。原先 22 处「聊天」(聊天正文、聊天区、聊天记录…)已一并改为「对话」。ja / ko 保留各自既有译法,两语没有中文这种三词混用问题。"
},
@@ -139,12 +160,20 @@
"checkCase": false,
"alsoAllowed": {
"zh-CN": [
- { "text": "thread", "when": "指 Codex 的 thread 这一外部系统概念时(导入历史、thread 上下文),保留英文" },
- { "text": "评论", "when": "指 GitHub PR 的 review thread 时,用「review 评论」" }
+ {
+ "text": "thread",
+ "when": "指 Codex 的 thread 这一外部系统概念时(导入历史、thread 上下文),保留英文"
+ },
+ {
+ "text": "评论",
+ "when": "指 GitHub PR 的 review thread 时,用「review 评论」"
+ }
]
},
"forbidden": {
- "zh-CN": ["线程"]
+ "zh-CN": [
+ "线程"
+ ]
},
"note": "全仓仅 8 处,按语境分四类,是「同一个词必须分场合翻译」的典型:①指产品内的对话 → 跟随 session 叫「对话」(已落地 3 处);②Codex 外部概念 → 保留 thread;③GitHub PR review thread →「review 评论」;④比喻用法 \"persistent work thread\" → 原译「工作线程」,中文有 OS 线程歧义,已改写为「持续推进的工作对话」。「线程」一律禁用。"
},
@@ -159,12 +188,25 @@
},
"alsoAllowed": {
"zh-CN": [
- { "text": "Skill", "when": "技术语境下指代具体的 skill 文件 / 目录结构时,可保留英文" }
+ {
+ "text": "Skill",
+ "when": "技术语境下指代具体的 skill 文件 / 目录结构时,可保留英文"
+ }
]
},
- "forbidden": {},
- "note": "中文用「技能」(现状 32:26 领先)。偶尔保留英文 Skill 是允许的,因此不设 forbidden——硬性禁用会逼出别扭的中文。SkillHub 作为产品名保留英文,单独登记在 skillhub 条目。",
- "exempt": []
+ "forbidden": {
+ "ja": [
+ "技能"
+ ],
+ "ko": [
+ "기술"
+ ]
+ },
+ "note": "中文用「技能」(现状 32:26 领先),偶尔保留英文 Skill 也允许,故 zh-CN 不设 forbidden——硬性禁用会逼出别扭的中文。ja / ko 则禁用 技能 / 기술:那是与 スキル / 스킬 并存的同义漂移,且只出现在 skillhub 内部(3 / 3 处)。ko 的 기술 是多义词(技术 / 记述 / 技能),两处非 Skill 义已按 key 豁免。SkillHub 作为产品名单独登记在 skillhub 条目。",
+ "exempt": [
+ "desktop:localDbFatal.details",
+ "desktop:issueTracker.create.descriptionPlaceholder"
+ ]
},
{
"id": "skillhub",
@@ -175,7 +217,14 @@
"ja": "SkillHub",
"ko": "SkillHub"
},
- "forbidden": {},
+ "forbidden": {
+ "ja": [
+ "スキルハブ"
+ ],
+ "ko": [
+ "스킬 허브"
+ ]
+ },
"note": "产品名,四语一律保留英文原样(暂定保留,未来若做中文名再改)。注意与 skill 条目区分:侧边栏 tab 现在叫「技能」但实际指 SkillHub,创建面板的「技能」指 Skills——这是既有 bug,两者不是一个东西不该同名,清理存量时需一并处理。"
},
{
@@ -185,13 +234,22 @@
"translations": {
"zh-CN": "Issue",
"ja": "Issue",
- "ko": "Issue"
+ "ko": "이슈"
},
"checkCase": false,
"forbidden": {
- "zh-CN": ["工单", "议题"]
+ "zh-CN": [
+ "工单",
+ "议题"
+ ],
+ "ja": [
+ "課題"
+ ]
},
- "note": "保留英文(2026-07 裁决)。现状「工单」32 /「议题」4 是既有 bug 的来源:列表按钮写「新建议题」、点进去页面标题写「新建工单」。「问题」不入 forbidden——它在「修复问题和失败」这类泛指语境下是正常中文,不是 Issue 的误译。checkCase 关闭:issue 同时是常用英语单词,prompt 模板里的 \"fix the issue\" 是正常用法,做大小写约束会制造 9 处假阳性。"
+ "note": "保留英文(2026-07 裁决)。现状「工单」32 /「议题」4 是既有 bug 的来源:列表按钮写「新建议题」、点进去页面标题写「新建工单」。「问题」不入 forbidden——它在「修复问题和失败」这类泛指语境下是正常中文,不是 Issue 的误译。checkCase 关闭:issue 同时是常用英语单词,prompt 模板里的 \"fix the issue\" 是正常用法,做大小写约束会制造 9 处假阳性。(2026-07 修正:ko 原声明 Issue 仅 3 处,实测 이슈 45 处才是主流,改随本语言主流;ja 的 Issue 43:2 保持不变。)",
+ "minorityByDesign": {
+ "ja": "ja 侧 Issue 43/63 本就是主流,此处无偏离;保留字段以说明与 ko 的 이슈 有意分道——各语言跟随本语言主流,不强求跨语言一致。"
+ }
},
{
"id": "provider",
@@ -200,19 +258,34 @@
"translations": {
"zh-CN": "供应商",
"ja": "プロバイダー",
- "ko": "제공업체"
+ "ko": "제공자"
},
"alsoAllowed": {
"zh-CN": [
- { "text": "模型供应商", "when": "首次出现或需要消歧时用全称,如设置页标题" }
+ {
+ "text": "模型供应商",
+ "when": "首次出现或需要消歧时用全称,如设置页标题"
+ }
]
},
"forbidden": {
- "zh-CN": ["提供方", "提供商"]
+ "zh-CN": [
+ "提供方",
+ "提供商"
+ ],
+ "ja": [
+ "提供元",
+ "事業者"
+ ],
+ "ko": [
+ "공급자",
+ "제공업체"
+ ]
},
- "note": "中文用「供应商」(现状 36:18 领先简称)。全称「模型供应商」在需要消歧的位置仍可用。「提供商」「提供方」是同义漂移,禁用——设置页标题写「模型供应商」、它自己的表单写「提供商」是既有 bug。豁免 login.ssoVerificationSubtitle:那里的「身份提供方」是 SSO / SAML 领域 Identity Provider 的标准中文术语,与模型供应商是两个概念。",
+ "note": "中文用「供应商」(现状 36:18 领先简称)。全称「模型供应商」在需要消歧的位置仍可用。「提供商」「提供方」是同义漂移,禁用——设置页标题写「模型供应商」、它自己的表单写「提供商」是既有 bug。豁免 ssoVerificationSubtitle:那里的「身份提供方」是 SSO / SAML 领域 Identity Provider 的标准中文术语,与模型供应商是两个概念。该文案在 desktop locale 与 mobile 影子 catalog 各有一份副本,两处都要豁免。(2026-07 修正:ko 原声明 제공업체 仅 6 处,实测 제공자 32 处为主流,改随主流。)",
"exempt": [
- "desktop:login.ssoVerificationSubtitle"
+ "desktop:login.ssoVerificationSubtitle",
+ "mobile/loginMessages:ssoVerificationSubtitle"
]
},
{
@@ -225,7 +298,17 @@
"ko": "추론 강도"
},
"forbidden": {
- "zh-CN": ["思考强度", "思考深度", "推理深度", "努力程度", "推理力度"]
+ "zh-CN": [
+ "思考强度",
+ "思考深度",
+ "推理深度",
+ "努力程度",
+ "推理力度"
+ ],
+ "ja": [
+ "推論レベル",
+ "推論の強度"
+ ]
},
"note": "模型的推理投入档位(low/medium/high/…)。用「推理强度」有三重依据:①同类工具 i18n 里断层第一(GitHub 代码搜索共现量级 1452,第二名「思考强度」431);②OpenAI 简中帮助中心即用此词;③跨 provider 中立——Cindy 的 create_worker 用一个 effort 同时映射 Codex reasoning effort 与 Claude thinking 预算,而 Anthropic 官方简中叫「努力程度」、OpenAI 叫「推理强度」,需要不偏向任一方的词。禁用项各有硬理由:「思考深度」「推理深度」会与国内产品普遍的「深度思考」开关撞车,且语义错误(低 effort 是想得少,不是想得浅);「努力程度」在中文里强烈指向人的绩效评价;「推理等级/级别」未入禁用但不推荐——Cindy 已有 model tier 概念,「等级」易被读成模型档位。"
},
@@ -241,12 +324,20 @@
"checkCase": false,
"alsoAllowed": {
"zh-CN": [
- { "text": "credits", "when": "指第三方服务自身的 credits(如 Codex / ChatGPT 订阅余量),保留其原生叫法" },
- { "text": "重置次数", "when": "reset credits——指可用的配额重置次数,与计费点数无关" }
+ {
+ "text": "credits",
+ "when": "指第三方服务自身的 credits(如 Codex / ChatGPT 订阅余量),保留其原生叫法"
+ },
+ {
+ "text": "重置次数",
+ "when": "reset credits——指可用的配额重置次数,与计费点数无关"
+ }
]
},
"forbidden": {
- "zh-CN": ["额度"]
+ "zh-CN": [
+ "额度"
+ ]
},
"note": "计费点数用「点数」。清理前中文「额度」同时对应 Balance / Credits / Quota 三个英文概念,是计费面板里最容易误导用户的一处:同一个 billing 页面里「点数」和「额度」并存,而「额度」在别处又指配额。裁决把三者拆开——Credits =「点数」、Quota =「配额」、Balance =「余额」,「额度」整体退出。第三方原生 credits 与 reset credits 属不同概念,走 alsoAllowed。"
},
@@ -257,11 +348,19 @@
"translations": {
"zh-CN": "配额",
"ja": "クォータ",
- "ko": "쿼터"
+ "ko": "할당량"
},
"checkCase": false,
- "forbidden": {},
- "note": "周期内的使用上限用「配额」(现状已有 3 处这么写)。与 credits 条目一起裁决:「额度」原先同时表示 Balance / Credits / Quota,三个概念在计费与限额提示里互相污染。「额度」的 forbidden 统一登记在 credits 条目下,不在这里重复——一个词只归属一个术语,否则同一处违规会被两个术语各报一次。"
+ "forbidden": {
+ "ja": [
+ "残量"
+ ]
+ },
+ "note": "周期内的使用上限用「配额」(现状已有 3 处这么写)。与 credits 条目一起裁决:「额度」原先同时表示 Balance / Credits / Quota,三个概念在计费与限额提示里互相污染。「额度」的 forbidden 统一登记在 credits 条目下,不在这里重复——一个词只归属一个术语,否则同一处违规会被两个术语各报一次。(2026-07 修正:ko 原声明 쿼터 在全仓零出现,属凭空造词;ja 原声明 クォータ 仅 desktop 用、mobile 用 残量。定为 ja クォータ / ko 할당량——残量 语义偏 Balance 会与 残高 混淆,而 ko 的 사용량 正是 Usage 的标准词,让 Quota 占用它会重演 zh「额度」三义合一的错误。)",
+ "minorityByDesign": {
+ "ja": "主流 残量 语义偏「余量」,会与 Balance 的 残高 混淆;クォータ 是 quota 的准确音译,desktop 已在用。",
+ "ko": "主流 사용량 正是 Usage 的标准词,让 Quota 占用它会重演 zh「额度」同时表示 Balance/Credits/Quota 的错误;할당량 是配额的标准韩语。"
+ }
},
{
"id": "balance",
@@ -282,18 +381,34 @@
"en": "Automation",
"translations": {
"zh-CN": "自动化",
- "ja": "オートメーション",
+ "ja": "自動化",
"ko": "자동화"
},
"alsoAllowed": {
"zh-CN": [
- { "text": "自动任务", "when": "指单条自动化实例(一个定时跑的任务)时" },
- { "text": "自动化任务", "when": "需要与模块名区分、强调它是一条任务时" },
- { "text": "自动操作", "when": "Computer Use 语境——「自动操作电脑 / 浏览器」,指代操控设备而非定时任务" }
+ {
+ "text": "自动任务",
+ "when": "指单条自动化实例(一个定时跑的任务)时"
+ },
+ {
+ "text": "自动化任务",
+ "when": "需要与模块名区分、强调它是一条任务时"
+ },
+ {
+ "text": "自动操作",
+ "when": "Computer Use 语境——「自动操作电脑 / 浏览器」,指代操控设备而非定时任务"
+ }
]
},
- "forbidden": {},
- "note": "模块名 / 能力名用「自动化」(现状 88 处主流);指单条实例时用「自动任务」,这是刻意保留的场景差异——一刀切会写出「查看你的自动化」这类别扭中文。特别注意 Automation 在本产品里指两个不同概念:scheduler 的定时任务,以及 settings.computerUse 的操控电脑能力;后者用「自动操作电脑 / 浏览器」,改成「自动化电脑」反而不通。因此不设 forbidden。"
+ "forbidden": {
+ "ja": [
+ "オートメーション"
+ ],
+ "ko": [
+ "오토메이션"
+ ]
+ },
+ "note": "模块名 / 能力名用「自动化」(现状 88 处主流);指单条实例时用「自动任务」,这是刻意保留的场景差异——一刀切会写出「查看你的自动化」这类别扭中文。特别注意 Automation 在本产品里指两个不同概念:scheduler 的定时任务,以及 settings.computerUse 的操控电脑能力;后者用「自动操作电脑 / 浏览器」,改成「自动化电脑」反而不通。因此不设 forbidden。(2026-07 修正:ja 原声明 オートメーション 仅 37/121,主流是 自動化;ko 的 자동화 75/121 本就正确。)"
},
{
"id": "usage",
@@ -305,9 +420,207 @@
"ko": "사용량"
},
"forbidden": {
- "zh-CN": ["使用情况", "使用表现"]
+ "zh-CN": [
+ "使用情况",
+ "使用表现"
+ ],
+ "ja": [
+ "使用状況",
+ "利用状況"
+ ],
+ "ko": [
+ "사용 현황"
+ ]
},
"note": "中文用「用量」(现状 37:6 压倒性)。「使用情况」「使用表现」是同义漂移,禁用。注意 usage 在英文里也有「用法」义(如 CLI usage),那属于另一个概念,不在本条约束范围。"
+ },
+ {
+ "id": "collapse",
+ "status": "decided",
+ "en": "Collapse",
+ "translations": {
+ "zh-CN": "收起",
+ "ja": "折りたたむ",
+ "ko": "접기"
+ },
+ "checkCase": false,
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "折叠",
+ "whenEn": "Collapse"
+ }
+ ]
+ },
+ "note": "中文用「收起」(现状 29:7),与反义词「展开」(Expand,29/30 已统一)配对。ccAgent 与 rightSidebar 内部各自「收起 / 折叠」混用,是同模块自相矛盾。条件禁用:「折叠」在别处可能是正常中文,只在英文源含 Collapse 时判违规。"
+ },
+ {
+ "id": "author",
+ "status": "decided",
+ "en": "Author",
+ "translations": {
+ "zh-CN": "作者",
+ "ja": "作成者",
+ "ko": "작성자"
+ },
+ "checkCase": false,
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "提交者",
+ "whenEn": "Author"
+ },
+ {
+ "text": "提出者",
+ "whenEn": "Author"
+ }
+ ]
+ },
+ "note": "中文用「作者」(现状 9:4)。典型的同模块自相矛盾:issueTracker 同一个页面里,assignee.labelAuthor 写「提交者」、list.filterAuthor 写「提出者」、visibility.onlyAuthorCanChange 写「作者」——同一个字段三种叫法。条件禁用避免误伤 Committer / Reporter 等其它英文词的正确译法。"
+ },
+ {
+ "id": "collaboration",
+ "status": "decided",
+ "en": "Collaboration",
+ "translations": {
+ "zh-CN": "协同",
+ "ja": "協同",
+ "ko": "협업"
+ },
+ "checkCase": false,
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "协作",
+ "whenEn": "Collaboration"
+ }
+ ]
+ },
+ "note": "Orca 多 Agent 功能名,中文用「协同」(现状 21:2)。可见 bug:设置导航项写「协作」,点进去页面标题写「协同」。条件禁用:settings.contacts 里的「协作经历」是 collaboration history,属另一个语义,英文源不含独立 Collaboration 一词时不判违规。",
+ "exempt": [
+ "desktop:settings.contacts."
+ ]
+ },
+ {
+ "id": "running",
+ "status": "decided",
+ "en": "Running",
+ "translations": {
+ "zh-CN": "运行中",
+ "ja": "実行中",
+ "ko": "실행 중"
+ },
+ "checkCase": false,
+ "alsoAllowed": {
+ "zh-CN": [
+ {
+ "text": "正在运行",
+ "when": "完整句子里作谓语时(\"Agent 正在运行\"),不是状态标签"
+ }
+ ]
+ },
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "执行中",
+ "whenEn": "Running"
+ },
+ {
+ "text": "进行中",
+ "whenEn": "Running"
+ }
+ ]
+ },
+ "note": "状态标签用「运行中」(现状 16:9)。条件禁用是必需的——「进行中」是 In Progress 的正确译法、「执行中」在别处也可能对,无条件禁会大面积误伤。mobile/devices 的自动化面板上「运行中 / 执行中 / 重跑中」三种写法同屏出现。"
+ },
+ {
+ "id": "dismiss",
+ "status": "decided",
+ "en": "Dismiss",
+ "translations": {
+ "zh-CN": "关闭",
+ "ja": "閉じる",
+ "ko": "닫기"
+ },
+ "checkCase": false,
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "忽略",
+ "whenEn": "Dismiss"
+ },
+ {
+ "text": "知道了",
+ "whenEn": "Dismiss"
+ }
+ ]
+ },
+ "note": "中文用「关闭」(现状 6:4)。同一个 chat 模块里,errorBanner 写「关闭错误提示」、interruptedBanner 写「忽略此中断提示」。条件禁用:「忽略」是 Ignore 的正确译法、「知道了」是 Got it 的正确译法,只在英文源为 Dismiss 时才算违规。"
+ },
+ {
+ "id": "active",
+ "status": "decided",
+ "en": "Active",
+ "translations": {
+ "zh-CN": "活跃",
+ "ja": "アクティブ",
+ "ko": "활성"
+ },
+ "checkCase": false,
+ "alsoAllowed": {
+ "zh-CN": [
+ {
+ "text": "生效中",
+ "when": "计费语境(\"no active subscription\"→没有生效中的订阅),指订阅状态而非活跃度"
+ }
+ ]
+ },
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "活动",
+ "whenEn": "Active"
+ }
+ ]
+ },
+ "note": "对话 / 设备状态用「活跃」(现状 21:7)。mobile/devices 同一屏上筛选 chip 写「活跃」、指标磁贴写「活动」。条件禁用:「活动」是 Activity 的正确译法,无条件禁会误伤「活动记录」这类。"
+ },
+ {
+ "id": "worktree",
+ "status": "decided",
+ "en": "Worktree",
+ "translations": {
+ "zh-CN": "worktree",
+ "ja": "worktree",
+ "ko": "worktree"
+ },
+ "checkCase": false,
+ "forbidden": {
+ "zh-CN": [
+ {
+ "text": "工作树",
+ "whenEn": "Worktree"
+ },
+ {
+ "text": "工作区",
+ "whenEn": "Worktree"
+ }
+ ]
+ },
+ "note": "Git worktree 是外部工具的既定概念,四语一律保留英文小写原词(现状 21 处最多)。desktop:chat 一个模块里就有 worktree / 工作区 / 工作树 三种写法。特别要紧的是「工作区」——它同时被用于 worktree、Workspace、working tree 三个不同英文概念,必须让出来只表示 Workspace;working directory 用「工作目录」。条件禁用只在英文源含 Worktree 时生效,不影响 Workspace 的正常翻译。"
+ },
+ {
+ "id": "directory",
+ "status": "decided",
+ "en": "Directory",
+ "translations": {
+ "zh-CN": "目录",
+ "ja": "ディレクトリ",
+ "ko": "디렉터리"
+ },
+ "checkCase": false,
+ "forbidden": {},
+ "note": "Directory 用「目录」(现状 96:4),Folder 用「文件夹」(37:20),两个英文词在中文里也分开。**本条刻意不设 forbidden**:英文侧自己就在一句话里混用二者(\"not a folder. Choose a project directory.\"、\"re-select the working directory and wait for the folder badge\"),而条件禁用是句子级匹配,区分不了句内哪个中文词对应哪个英文词——实测 4 处命中全是假阳性,那 4 条中文其实译得完全正确。要真正管住这对词,得先清理英文侧的 path / folder / directory 混用。此条目保留为文档指引,供人查阅。"
}
]
}
diff --git a/i18n/glossary.schema.json b/i18n/glossary.schema.json
index 15ee271bdc..aa782c6507 100644
--- a/i18n/glossary.schema.json
+++ b/i18n/glossary.schema.json
@@ -68,16 +68,34 @@
},
"forbidden": {
"type": "object",
- "description": "各语言的禁用译法。命中即违规(decided 阻断 / proposed 警告)。",
+ "description": "各语言的禁用译法。命中即违规(decided 阻断 / proposed 警告)。数组元素有两种形态:字符串=无条件禁用;对象 { text, whenEn } =仅当该 key 的英文源匹配 whenEn 时才禁用。条件形态用于「同一个中文词是另一个英文词的正确译法」的场景——例如 Directory 该译「目录」,但不能无条件禁「文件夹」,否则会误伤 Folder 的正确翻译。",
"additionalProperties": {
"type": "array",
- "items": { "type": "string" }
+ "items": {
+ "oneOf": [
+ { "type": "string" },
+ {
+ "type": "object",
+ "required": ["text", "whenEn"],
+ "additionalProperties": false,
+ "properties": {
+ "text": { "type": "string", "description": "禁用的译法" },
+ "whenEn": { "type": "string", "description": "英文源需匹配的词(按词边界、大小写不敏感匹配)" }
+ }
+ }
+ ]
+ }
}
},
"note": {
"type": "string",
"description": "裁决理由。必填——没有理由的术语裁决会被后人反复推翻。"
},
+ "minorityByDesign": {
+ "type": "object",
+ "description": "显式声明「该语言的译法有意偏离现状主流」及理由。单测会校验:凡是声明的译法在现状中占比不足 35%,就必须在这里给出理由,否则判定为凭抽样拍脑袋(引入术语表时 ja/ko 有 5 条栽在这上面,其中 ko 的 쿼터 全仓零出现)。合法的偏离理由通常是「主流译法与另一个术语撞车」。",
+ "additionalProperties": { "type": "string" }
+ },
"checkCase": {
"type": "boolean",
"description": "是否检查大小写形态,默认 true。对同时是常用英语单词的术语(Issue、Session、Chat)必须设 false:英文句子里的 \"fix the issue\" 是正常用法,强行要求大写会在 prompt 模板和英文文案里制造大批假阳性。只有 Worker、Agent 这类「在文案里出现即指产品概念」的词才适合做大小写约束。"
diff --git a/packages/maker-scheduler/src/builtin-templates.ts b/packages/maker-scheduler/src/builtin-templates.ts
index 15bf9901f9..4484a0b810 100644
--- a/packages/maker-scheduler/src/builtin-templates.ts
+++ b/packages/maker-scheduler/src/builtin-templates.ts
@@ -31,10 +31,10 @@ export const BUILTIN_TEMPLATES: ScheduleTemplate[] = [
{
id: 'nightly-test-heal',
name: '夜间自愈测试',
- description: '每晚跑测试,失败项在隔离工作区尝试最小修复',
+ description: '每晚跑测试,失败项在隔离 worktree 尝试最小修复',
category: 'dev-automation',
source: 'builtin',
- prompt: `运行项目的测试套件,如果有失败项,在隔离工作区尝试给出最小修复。
+ prompt: `运行项目的测试套件,如果有失败项,在隔离 worktree 尝试给出最小修复。
约束:
- 先按仓库文档或 package 脚本确定标准测试命令,再完整运行
- 只修复有明确失败证据的问题,采用影响面最小的改法,避免顺手重构
diff --git a/scripts/__tests__/glossary-rules.test.mjs b/scripts/__tests__/glossary-rules.test.mjs
index 5cc87c6668..ef6f3f96f7 100644
--- a/scripts/__tests__/glossary-rules.test.mjs
+++ b/scripts/__tests__/glossary-rules.test.mjs
@@ -204,21 +204,79 @@ test('glossary.json: forbidden 不能与自己的标准译法冲突', () => {
for (const [locale, words] of Object.entries(term.forbidden ?? {})) {
const standard = term.translations?.[locale];
if (!standard) continue;
+ const texts = words.map((w) => (typeof w === 'string' ? w : w.text));
assert.ok(
- !words.includes(standard),
+ !texts.includes(standard),
`术语 ${term.id} 在 ${locale} 把标准译法「${standard}」同时列为禁用,规则自相矛盾`,
);
}
}
});
+test('glossary.json: 声明的译法必须是现状主流,否则要写明为何有意偏离', () => {
+ // 引入术语表时踩过的坑:ja/ko 的译法凭抽样几个 key 就定,结果 5 条是少数派,
+ // 其中 quota 的 ko「쿼터」全仓零出现——纯属凭空造词。更糟的是 automation 的 ja
+ // 把少数派同时写进 translations 与 forbidden,guard 于是输出「X 是禁用译法,应为 X」。
+ // 这条断言把「你凭什么违反数据」显式化:占比不足 35% 就必须给理由。
+ const MIN_RATIO = 0.35;
+ const load = (locale) => {
+ const out = new Map();
+ const flatten = (obj, prefix) => {
+ for (const [k, v] of Object.entries(obj)) {
+ const kp = prefix ? `${prefix}.${k}` : k;
+ if (v && typeof v === 'object' && !Array.isArray(v)) flatten(v, kp);
+ else if (typeof v === 'string') out.set(kp, v);
+ }
+ };
+ flatten(
+ JSON.parse(fs.readFileSync(path.join(ROOT, `apps/desktop/src/renderer/i18n/locales/${locale}/common.json`), 'utf8')),
+ '',
+ );
+ return out;
+ };
+
+ const corpus = Object.fromEntries(glossary.locales.map((l) => [l, load(l)]));
+ const problems = [];
+
+ for (const term of glossary.terms) {
+ if (term.status !== 'decided') continue;
+ const escaped = term.en.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ const re = new RegExp(`(?<![A-Za-z0-9_-])${escaped}s?(?![A-Za-z0-9_-])`, 'i');
+ const keys = [...corpus[glossary.sourceLocale]].filter(([, v]) => re.test(v)).map(([k]) => k);
+ if (keys.length < 8) continue; // 样本太小,占比没有统计意义
+
+ for (const locale of glossary.locales) {
+ if (locale === glossary.sourceLocale) continue;
+ const declared = term.translations?.[locale];
+ if (!declared) continue;
+ // alsoAllowed 是同一裁决下的合法变体(Running 作谓语时用「正在运行」),
+ // 计算主流度时必须算进来,否则分场合译法越多、越会被误判成"声明不是主流"。
+ const accepted = [declared, ...(term.alsoAllowed?.[locale] ?? []).map((v) => v.text)];
+ const hit = keys.filter((k) => {
+ const value = corpus[locale].get(k);
+ return value && accepted.some((a) => value.includes(a));
+ }).length;
+ const ratio = hit / keys.length;
+ if (ratio >= MIN_RATIO) continue;
+ if (term.minorityByDesign?.[locale]?.trim()) continue;
+ problems.push(
+ `${term.id}/${locale}: 声明「${declared}」只覆盖 ${hit}/${keys.length} ` +
+ `(${Math.round(ratio * 100)}%),既非主流又没写 minorityByDesign 理由`,
+ );
+ }
+ }
+
+ assert.deepEqual(problems, [], `\n${problems.join('\n')}`);
+});
+
test('glossary.json: 同一 locale 下 forbidden 词不跨术语重复', () => {
// 重复会让同一处违规被两个术语各报一次,baseline 也会存两条指纹。
// 一个词只归属一个术语,其余条目在 note 里交叉引用(如「代理」统一登记在 proxy 下)。
const owner = new Map();
for (const term of glossary.terms) {
for (const [locale, words] of Object.entries(term.forbidden ?? {})) {
- for (const word of words) {
+ for (const entry of words) {
+ const word = typeof entry === 'string' ? entry : entry.text;
const slot = `${locale}\t${word}`;
const prev = owner.get(slot);
assert.equal(
diff --git a/scripts/check-i18n-glossary.mjs b/scripts/check-i18n-glossary.mjs
index a90f2e67b8..b15065b1ba 100644
--- a/scripts/check-i18n-glossary.mjs
+++ b/scripts/check-i18n-glossary.mjs
@@ -162,11 +162,28 @@ for (const term of glossary.terms) {
for (const locale of locales) {
const entries = corpus.get(locale);
- // 规则 1:禁用译法
- for (const bad of term.forbidden?.[locale] ?? []) {
+ // 规则 1:禁用译法。
+ // 条目为字符串时无条件禁用;为 { text, whenEn } 时只在该 key 的**英文源**匹配
+ // whenEn 才禁——因为同一个中文词往往是另一个英文词的正确译法(Directory 该译
+ // 「目录」,但无条件禁「文件夹」会误伤 Folder;Running 禁「进行中」会误伤
+ // In Progress)。没有这个条件,这类术语根本没法进表。
+ for (const entry of term.forbidden?.[locale] ?? []) {
+ const bad = typeof entry === 'string' ? entry : entry.text;
+ const whenEn = typeof entry === 'string' ? null : entry.whenEn;
+ const sourceRe = whenEn
+ ? new RegExp(
+ `(?<![A-Za-z0-9_-])${whenEn.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}s?(?![A-Za-z0-9_-])`,
+ 'i',
+ )
+ : null;
+
for (const [key, value] of entries) {
if (isExempt(key)) continue;
if (!occursIn(stripNonProse(value), bad)) continue;
+ if (sourceRe) {
+ const source = corpus.get(glossary.sourceLocale)?.get(key);
+ if (!source || !sourceRe.test(source)) continue;
+ }
const expected = term.translations?.[locale] || term.en;
violations.push(
makeViolation({
@@ -175,7 +192,9 @@ for (const term of glossary.terms) {
rule: 'forbidden-term',
detail: `${term.id}:${bad}`,
severity,
- hint: `「${bad}」是 ${term.en} 的禁用译法,应为「${expected}」`,
+ hint:
+ `「${bad}」是 ${term.en} 的禁用译法,应为「${expected}」` +
+ (whenEn ? `(仅当英文源含 ${whenEn} 时)` : ''),
}),
);
}
diff --git a/scripts/shared/glossary-doc.mjs b/scripts/shared/glossary-doc.mjs
index b4a79f6184..be74474e04 100644
--- a/scripts/shared/glossary-doc.mjs
+++ b/scripts/shared/glossary-doc.mjs
@@ -27,6 +27,12 @@ function renderTranslation(term, locale) {
return value;
}
+/** 禁用词条目可能是字符串(无条件)或 { text, whenEn }(仅当英文源匹配时禁用)。 */
+function forbiddenLabel(entry) {
+ if (typeof entry === 'string') return entry;
+ return `${entry.text}(仅当英文含 ${entry.whenEn})`;
+}
+
export function renderGlossaryDoc(glossary) {
const terms = sortTerms(glossary.terms);
const decided = terms.filter((t) => t.status === 'decided');
@@ -62,7 +68,7 @@ export function renderGlossaryDoc(glossary) {
for (const term of decided) {
const cells = locales.map((l) => cell(renderTranslation(term, l)));
const forbidden = Object.entries(term.forbidden ?? {})
- .flatMap(([loc, words]) => words.map((w) => `${loc}: ${w}`))
+ .flatMap(([loc, words]) => words.map((w) => `${loc}: ${forbiddenLabel(w)}`))
.join(';');
lines.push(`| **${cell(term.en)}** | ${cells.join(' | ')} | ${cell(forbidden) || '—'} |`);
}
@@ -118,7 +124,7 @@ export function renderGlossaryDoc(glossary) {
lines.push('');
lines.push(term.note);
const forbidden = Object.entries(term.forbidden ?? {})
- .flatMap(([loc, words]) => words.map((w) => `\`${w}\`(${loc})`))
+ .flatMap(([loc, words]) => words.map((w) => `\`${forbiddenLabel(w)}\`(${loc})`))
.join('、');
if (forbidden) {
lines.push('');