Pdlc i18n
国际化(i18n)From its SKILL.md
npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-i18nAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.7 KB, 524 tokens by cl100k_base, as published. Nobody here has run it
国际化(i18n)
<!-- @include templates/prompts/iron-law.md -->为指定的前端应用或后端服务添加国际化支持。
工作流程
- 扫描硬编码文本: 查找代码中所有硬编码的中文字符串
- 提取文本资源: 生成多语言资源文件
- 替换硬编码: 用 i18n 函数调用替换原有的硬编码文本
- 生成翻译清单: 输出待翻译的文本列表
前端(React/Vue)
- 资源文件位置:
src/locales/zh-CN.json、src/locales/en-US.json - 使用
react-i18next或vue-i18n - Key 命名规范:
模块.页面.组件.描述,如user.login.form.username
后端(Java/Go/Python/Node)
- 错误提示信息国际化
- API 响应消息国际化
- 根据请求头
Accept-Language返回对应语言
资源文件格式
{
"common": {
"confirm": "确认",
"cancel": "取消",
"save": "保存",
"delete": "删除"
},
"user": {
"login": {
"title": "用户登录",
"username": "用户名",
"password": "密码"
}
}
}
要求
- 默认语言为中文(zh-CN)
- Key 使用英文,值使用对应语言
- 先生成中文版本,英文版本标记
// TODO: 待翻译 - 日期、数字、货币使用 Intl API 格式化
目标: $ARGUMENTS
<!-- @include templates/prompts/handoff.md -->本命令的 handoff 输出:
✅ 国际化资源文件 完成
📦 产出:src/locales/<语言>.json
👉 下一步:(本次流程结束,无后续)
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most translation skills give in 524 tokens
Counted across 286 of the 304 authors here whose files we hold, read 2026-09-06
- Preserve all markdown formattingin 8 of 286, across 5 files
- Use ICU message format for complex stringsin 8 of 286
- Preserve all numbers, dates, and amounts exactlyin 7 of 286
- Use CSS logical properties for RTL layoutsin 7 of 286
- Format dates, numbers, and currencies with FormatStylein 7 of 286, across 6 files
- Use locale-aware formatters for dates, numbers, and currencyin 7 of 286
- Merge translated chunks in orderin 6 of 286, across 3 files
- Use logical CSS properties instead of physical onesin 6 of 286
- Use leading and trailing, never left and rightin 6 of 286, across 5 files
- Use time-limited SAS URLs for document translationin 5 of 286, across 2 files
- Split long content at markdown block boundariesin 5 of 286, across 2 files
- Run first-time setup before any translation when preferences missingin 5 of 286, across 2 files
Said here and by no other author read
- generate multilingual resource files
- replace hardcoded text with i18n calls
- output list of texts pending translation
- use English keys named module.page.component.description
- internationalize backend error messages
- internationalize API response messages
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.