How this skill is triggered — by the user, by Claude, or both
Slash command
/i18n:i18nThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
帮助用户查询、集成多语言字符串到项目代码中。支持多个产品、多个平台、多种业务线。
帮助用户查询、集成多语言字符串到项目代码中。支持多个产品、多个平台、多种业务线。
来自 language MCP server:
不要硬编码产品或平台 ID。 使用
list-products和list-platforms工具动态查询。不同产品和平台的字符串 key 可能不同。同一条字符串在 Android/iOS/Web 上可能有不同的 key 名称。
当用户请求集成多语言字符串时,严格按以下步骤执行:
如果用户没有明确指定产品和平台:
记住用户选择的 product_id 和 platform_id,在后续步骤中使用。
不要假设多语言文件在 src/locales/。需要动态检测当前项目的 locale 目录:
i18n.ts、i18n.js、vue.config.* 等),确认 locale 文件路径**/{locales,locale,lang,i18n}/*.json 或类似模式ZhCn.json、EnUs.json、zh-CN.json 等)如果找不到或有多个候选目录,询问用户确认。
将检测到的路径记为 LOCALES_DIR,后续步骤使用。
$t() / t() / i18n.t() 等调用,确认命名模式和使用惯例{0} / {name} / %s 等)先在项目本地 locale 文件中搜索,检查是否已存在匹配的字符串:
使用 search-string 从远程平台查询:
product_id 使用第 0 步确认的值fuzzy: "0"精确匹配同时匹配 key 名和中文值。按以下优先级搜索:
cs_519b_selected_some),直接用 key 名精确搜索删除、上传图片)远程平台的占位符格式不统一,同一字符串在不同版本中可能是 %s、%d、{0},空格也可能不一致。
例如 cs_519b_selected_some 在远程各版本中分别存为:已选择%s条、已选择{0}条、已选择 {0} 条。
因此带参数的字符串不要用中文值精确搜索,应该用 key 名搜索。如果不知道 key 名:
fuzzy: "1") 定位候选结果write-locales 写入
locales_path 使用第 1 步检测到的 LOCALES_DIR 绝对路径product_id 使用第 0 步确认的值platform_id 使用第 0 步确认的值fuzzy: "0")Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub tianmuji/camscanner-plugins --plugin i18n