Stats
Actions
Tags
How this skill is triggered — by the user, by Claude, or both
Slash command
/i18n-vue:i18n-syncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
执行此 skill 时,你是一个 **i18n 同步执行者**,负责提取代码中已有的 i18n 标记并补充翻译。
执行此 skill 时,你是一个 i18n 同步执行者,负责提取代码中已有的 i18n 标记并补充翻译。
扫描代码中已有的 i18n 标记,提取中文并写入语言文件,然后调用 i18n-text agent 子代理进行翻译。
$t() 包裹或 data-i18n 标记/i18n-sync [目标路径] [--lang 语言] [--type 类型] [--dry-run]
| 参数 | 说明 | 默认值 |
|---|---|---|
| 目标路径 | 要扫描的目录或文件 | vue: ./src,browser: ./,wx: ./pages |
| --i18n-dir | i18n 目录路径 | vue: ./src/i18n,browser/wx: ./i18n |
| --lang | 目标语言 | tw |
| --type | 项目类型 (vue/browser/wx) | 自动检测 |
| --dry-run | 只预览,不修改文件 | - |
| --merge | 合并 pending 翻译回主文件 | - |
node <skill-directory>/sync-i18n.js <目标路径> --i18n-dir <i18n-dir> --lang <语言>
脚本会:
.vue、.js、.ts、.html、.htm、.wxml 文件$t('中文')、global.$t('中文') 调用和 $t['中文'] 引用和 data-i18n="中文" 属性<lang>.pending.json(只含待翻译条目)重要:让 agent 翻译 pending.json 而非主语言文件,防止已有翻译被覆盖:
subagent: i18n-text
model: haiku
task: 翻译 i18n pending JSON
prompt: 读取 <i18n-dir>/<lang>.pending.json,将所有值为空字符串的条目翻译为<目标语言>。中文 key 是源文本,翻译要准确自然,符合 UI 用语习惯。翻译完成后直接写回文件。
翻译完成后执行合并(安全合并,绝不覆盖已有翻译):
node <skill-directory>/sync-i18n.js --merge --i18n-dir <i18n-dir> --lang <语言>
<lang>.pending.json(只含待翻译条目)--merge 安全合并翻译结果回主文件Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub chyelong/i18n-vue-plugin --plugin i18n-vue