--- title: "Chinese (zh-CN) Localization" type: source tags: [] date: 2026-05-02 --- ## Source File - [[Agent/agency-agents/scripts/i18n/README.md]] ## Summary(用中文描述) - 核心主题:将 GitHub Copilot Agent 的 name 和 description 字段本地化为简体中文 - 问题域:AI Agent 在 Copilot Chat Agent 选择器中的中文用户本地化体验 - 方法/机制:通过 PowerShell 脚本读取 JSON 翻译映射表,自动替换 YAML frontmatter 中的 name/description 字段 - 结论/价值:实现 Agent 界面的中文本地化,提升中文用户的使用体验;JSON 文件作为翻译的唯一数据源 ## Key Claims(用中文描述) - PowerShell 脚本 `localize-agents-zh.ps1` 读取 UTF-8 编码的 `agent-names-zh.json` 翻译映射表 - 脚本仅修改已安装副本(`~/.github/agents/` 和 `~/.copilot/agents/`),不修改源文件 - 仅替换 YAML frontmatter 中的 `name:` 和 `description:` 字段 - JSON 文件是翻译的唯一真实来源,新增 Agent 需先添加到 JSON 中 - 脚本采用纯 ASCII 编码(避免 PowerShell 编码问题),所有中文文本存储在 JSON 文件中 - 每次运行 `install.sh --tool copilot` 更新后需重新运行本地化脚本 ## Key Quotes > "Only modifies **installed copies** (in `~/.github/agents/`), not source files" — 关键约束:只修改安装副本 > "JSON file is the single source of truth for translations — add new agents there" — JSON 文件作为翻译唯一数据源的设计原则 > "Script is pure ASCII (avoids PowerShell encoding issues); all Chinese text lives in the JSON" — 纯 ASCII 脚本 + UTF-8 JSON 的分工设计 ## Key Concepts - [[Global-First-Architecture]]:国际化/本地化(i18n/l10n)作为产品架构的先天前提条件,而非上线后的补救措施 - [[YAML-Configuration]]:YAML frontmatter 配置格式,存储 Agent 的 name 和 description 元数据 ## Key Entities - [[The-Agency]]:开源多 Agent 框架,提供了 Copilot Agent 的安装脚本 `install.sh --tool copilot` - [[GitHub-Copilot]]:微软的 AI 编程助手,其 Chat 支持自定义 Agent,Agent 以 Markdown + YAML frontmatter 格式定义 ## Connections - [[Qwen Code Integration]] ← related_to ← [[i18n-readme]](均为 Agency Agents 的多工具集成功能) - [[i18n-readme]] ← extends ← [[GitHub-Copilot]](将英文 Copilot Agent 本地化为中文) ## Contradictions - 无明显冲突