i18n
Skill159 starsChanged 2 days agoMITView on GitHub
管理 dna-builder 的翻译文件(public/i18n/<locale>/translation.json)。当需要新增/覆盖/删除某条界面文案的翻译、按语言批量插键、查询某个 i18n 键在各语言下的值、按译文反查 key、导出与导入缺失翻译、或扫描代码里引用了但翻译文件缺失的键时使用本技能。触发场景:新增界面文案要补多语言、报「键名泄漏/界面还是中文」、i18n 检查、语言包漏翻、给某个 key 加 jp/kr/fr 译文、看到一句文案想找到它对应的 key。
50 other projects use a version of this.
Adopted by
Most recently taken up by
- elie222/inbox-zerotheir own version, first seen Nov 15, 2026
- filipe-campos/walphtheir own version, first seen Nov 15, 2026
- haxsd/haxsd-byoktheir own version, first seen Nov 15, 2026
- lobehub/lobehubtheir own version, first seen Nov 15, 2026
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Nov 12, 2026
- TheBeardedBearSAS/claude-crafttheir own version, first seen Nov 11, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
volovelySkillpr-fix
This skill should be used when the user asks to "fix PR comments", "address PR feedback", "resolve PR comments", provides a GitHub PR URL with intent to fix, or says "pr-fix". It reads all review comments on a PR, decides which need code fixes vs. replies, makes the fixes, and posts replies — all with explicit user approval before any GitHub action.
Also in 3 projects that use this
GitHubSkillstate-management
CoreAI Sandbox's TanStack Query + mock-JSON data layer. USE WHEN: editing data-fetching hooks (`app/hooks/use*.ts`), adding mock data in `app/data/`, or wiring a component to query state.
Also in 4 projects that use this
xfstudioSkillgraphql
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.
Also in 3 projects that use this
MicrosoftSkillbump-version
Bump the VoxelPic version to a user-specified value. USE FOR: setting or updating the project version across all files that embed it. Applies to requests like 'bump version to X.Y.Z', 'set version', or 'update version'.
Also in 4 projects that use this
- +2 more from CES-Ltd
Other versions50 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 50
- lobehub/lobe-chat★ 86ksame name
- lobehub/lobehub★ 86ksame name
- iOfficeAI/AionUi★ 34ksame name
- elie222/inbox-zero★ 13ksame name
- massCodeIO/massCode★ 7.1ksame name
- leookun/cursor-byok★ 3.2ksame name
- Pixeval/Pixeval★ 3.2ksame name
- akiver/cs-demo-manager★ 2ksame name
- d-kimuson/claude-code-viewer★ 1.3ksame name
- huoshen80/ReinaManager★ 737same name
40 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- admin-management-pageSkill
- build-creatorSkill
- bun-webview-testSkill
- charbuild-dps-ablationSkill
- db-styleSkill
- dob-skill-creatorSkill
- fmodel-unpackSkill
- orchestrated-deliverySkill
- perf-hotspot-profilingSkill
- shuorenhuaSkill
- tauri-cdpSkill
- video-productionSkill
- wt-review-prSkill
The file
Files
dna-builder i18n 工具
Overview
所有翻译文件操作统一走 bun i18n(= bun tools/i18n.ts),取代旧的 tools/i18n-tool.ts 与
tools/i18n-check.ts。不要手改 apps/web/public/i18n/*/translation.json:该文件必须整体按
localeCompare 排序,手工插入极易破坏顺序并在 commit 时被 hook 重排。
翻译文件共 6 个语言目录:en fr ja ko zh-CN zh-TW(zh-CN 是 fallbackLng)。
When to use
- 新增界面文案,需要为多个语言补译文 / 覆盖已有译文(默认补齐全部 6 语言、各语言书写)。
- 查询某个 i18n 键在 6 种语言下现有值(确认是否已翻、值是否对);可用
--lang cn,en只看部分。 - 按译文反查 key(看到界面上一句文案,想找到它对应的键再改):
bun i18n find <文本>。 - 删除某个废弃键。
- 导出缺失翻译表格交给翻译、翻好后导回。
- 排查「代码里
t("x")引用了但文件里没有」的漏配键。
Commands
add — 插入 / 覆盖(核心)
默认一次补齐全部 6 种语言,且每种语言用该语言本身书写(不要 6 个语言参数都塞中文原文, 否则模型会加漏或理解错意思):
# 例:新增「生成式AI」这条文案
bun i18n add setting.generative_ai \
-cn "生成式AI" -tw "生成式AI" -en "Generative AI" -jp "生成AI" -kr "생성형 AI" -fr "IA générative"- 语言参数用单横线短名,支持别名:
-cn/-zh→ zh-CN、-en→ en、-jp/-ja→ ja、-kr/-ko→ ko、-fr→ fr、-tw/-tc→ zh-TW。也接受双横线与目录名(--zh-CN), 以及-en=Value内联写法。完整别名表见bun i18n langs。 - 未指定的语言不写入,运行期由 i18next 的
fallbackLng(zh-CN)回落。 - ⚠ 完整度 warning(按实际文件内容判断):命令结束后检查该键在 6 个语言文件里是否都有值,
只要有一门缺就输出
⚠ warning: 键「x」缺少 N 种语言的译文:…。 只改一门语言的译文、但该键在文件里本就 6 门齐全的情况下不会告警——所以 「只想改中文」直接-cn "新值"即可,不会误报。 - 已存在且值相同 → 报「未变化」,不写文件;已存在但值不同 → 覆盖。
--dry-run只预览(也做完整性检查)不落盘;--flat强制写顶层扁平键。
其他子命令
bun i18n get <key> [--lang cn,en] [--json]
# 打印该键的值,默认全部 6 种语言;--lang 逗号过滤(别名可用)
bun i18n find <文本> [--lang cn,en] [--exact] [--limit N] [--json]
# 按译文反查 key(find/search 同义):默认 6 语言大小写不敏感子串匹配;
# --lang 限定语言,--exact 全字相等,--limit 最多展示数(默认 20)
bun i18n rm <key...> # 从所有语言删除一个或多个键(会清理因此变空的父命名空间)
bun i18n langs # 列出语言目录与全部别名
bun i18n export # 导出「zh-CN 有值、其它语言缺值」的键 → tools/i18n-diff.json
bun i18n import # 把 tools/i18n-diff.json 的译文写回并删除该文件
bun i18n check [--json] [--locale-gap] # 扫描代码静态引用但 zh-CN 未配置的键键的两种形式(决定 add 怎么写)
翻译文件里同时存在两类键,add 按 key 是否含 . 自动判定:
- 顶层扁平键(中文原文):
"编辑": "Edit"。游戏数据术语、属性名等。无点号 ⇒ 自动写顶层。 - 命名空间键(英文点号):
char-build.*、database.*、common.*等界面文案。 含.⇒ 自动按嵌套结构写入(char-build.foo→{"char-build":{"foo":...}})。
⚠️ 新键一律优先用命名空间键(<模块>.snake_case)。理由:$t("库名.键名") 形式会与顶层点号
扁平键冲突;纯中文原文键仅用于「游戏数据术语」这类本就以原文为键的场景。
顶层扁平键场景(前端自造展示名,直接中文做 key),同样补齐 6 门、各语言书写:
# 例:补「限时任务」这类上游没有、前端自己维护的展示名
bun i18n add "限时任务" \
-cn "限时任务" -tw "限時任務" -en "Limited-time Quest" -jp "期間限定クエスト" -kr "기간 한정 퀘스트" -fr "Quête à durée limitée"⚠️ 游戏术语(角色名 / 物品名 / 副本名等)已随数据包下发,不要用本工具往
public/i18n塞; 本工具只处理界面文案命名空间键与「前端自造展示名」这两类。
Hard rules / 坑
- 新增文案默认补齐 6 种语言,且每种用自己的语言书写(不要 6 个参数都填中文原文)。
漏了没关系:
add结束会按实际文件内容报⚠ warning指出缺哪几门。 - 落盘顺序 = 全文件递归
localeCompare排序 + 4 空格缩进 + 结尾换行,与.husky/update-version.js的sortJson一致。工具已保证;不要手工编辑该文件。 - 不要自己拼
writeFile写翻译文件,直接用bun i18n add,否则会打乱排序。 - 验证必须真跑:
bun i18n get <key>看到值、bun i18n check无缺失,才算完成。 - 数据包术语(角色名 / 物品名 / 副本名等)已由
packages/data/d/translations.data.ts随包下发, 不要往public/i18n塞这类中文键(见.agents/docs/dev-tools.md的「游戏文本包」); 只有「上游没有的前端自造展示名」才补进来(走tools/import-i18n-data.ts的SUPPLEMENTAL_TRANSLATIONS或直接bun i18n add顶层中文键)。 - 带插值的文案保留
{{var}}占位符,add会原样写入,不做转义。 - 属性名 / 属性说明由
pnpm iattr(tools/import-attr-i18n.ts)维护,不走本工具。
典型流程
新增一条界面文案(6 语言都填,推荐)
bun i18n add setting.generative_ai \
-cn "生成式AI" -tw "生成式AI" -en "Generative AI" -jp "生成AI" -kr "생성형 AI" -fr "IA générative"
bun i18n get setting.generative_ai # 确认 6 门都到位,无 warning只改一门语言的已有译文(其余门保持不动,不会 warning,因为文件里本就齐全)
# 假如要把 setting.ai 的中文再修订一版,只给 -cn 即可,其余 5 门不受影响
bun i18n add setting.ai -cn "AI 助手"
bun i18n get setting.ai --lang cn,en # 只看关心的语言新增时只先填部分语言(会 warning,属有意为之)
bun i18n add some-module.tip -cn "提示" -en "Tip"
# ⚠ warning: 键「some-module.tip」缺少 4 种语言的译文:fr, ja, ko, zh-TW翻译外包:导出 → 翻 → 导回
bun i18n export # 得到 tools/i18n-diff.json(键 → {en,fr,ja,ko,zh-CN,zh-TW})
# 交给翻译填值
bun i18n import # 写回并删除 diff 文件排查键名泄漏
bun i18n check --locale-gap # 主检测缺失键 + 各语言相对 zh-CN 的缺失计数按译文反查 key(先找键,再 add 改 / get 确认)
bun i18n find "生成式AI" # 6 语言子串匹配,命中键 + 各语言值一起打出
bun i18n find "生成式AI" --exact # 全字相等(子串命中太多时收窄)
bun i18n find "Generator" --lang en # 只在英文里查(看到英文文案找键时用)
bun i18n find "生成" --limit 5 --json # 命中多时只看前 5 个 / 输出结构化结果Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

