‹ 首页

i18n

@project-n-e-k-o · 收录于 昨天 · 上游提交 昨天

i18n (internationalization) toolkit for projects using i18next. Provides three main functions: (1) i18n-check - Detect hardcoded Chinese text in HTML/JS files, (2) i18n-fix - Replace hardcoded text with i18n markers, (3) i18n-sync - Align translation keys across multiple languages (zh-CN, zh-TW, en, ja, ko, ru, es, pt). Use when working on internationalization tasks, detecting untranslated strings, or syncing locale files.

适合你,如果经常需要为项目添加多语言支持,处理繁重的国际化改造任务

/ 通过 npx 安装 校验哈希
npx oh-my-skill add project-n-e-k-o/n.e.k.o/i18n
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- project-n-e-k-o/n.e.k.o/i18n
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify project-n-e-k-o/n.e.k.o/i18n
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
2258GitHub stars
~529最小装载
~1.3K含声明引用
~1.3K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 b0c3c15 · 表述以原文为准
它做什么

装上这个技能后,Claude 可以帮你完成三项 i18n 任务:检查前端文件中是否有硬编码的中文文本,将硬编码文本替换成 i18n 标记,以及在不同语言(简体中文、繁体中文、英语、日语、韩语、俄语、西班牙语、葡萄牙语)间同步翻译键。

什么时候触发

当你进行项目国际化工作,例如检测未翻译的中文字符串、替换硬编码文本或同步多语言文件时触发。也可以直接输入 /i18n-check、/i18n-fix 或 /i18n-sync 命令来使用。

装好后可以这样说
触发 i18n-check 命令。
替换硬编码并生成键。
执行 i18n-sync 命令。
技能原文 SKILL.md作者撰写 · Apache-2.0 · b0c3c15

i18n Toolkit

Complete i18n (internationalization) toolkit for projects using i18next.

Architecture
  • i18n library: i18next
  • Locale files: static/locales/ (zh-CN, zh-TW, en, ja, ko, ru, es, pt)
  • HTML attributes: data-i18n, data-i18n-placeholder, data-i18n-title, data-i18n-alt
  • JS function: window.t() or i18next.t()
  • Progress file: .claude/i18n-progress.json
Three Main Commands
1. i18n-check - Detect Issues

Check frontend files for hardcoded Chinese text.

/i18n-check <module> [options]

Modules: main, live2d, voice, steam, settings, chat, custom

Options: --status, --reset, --files=<path>, --html, --js, --strict

See [references/check-modules.md](references/check-modules.md) for module file mappings.

2. i18n-fix - Fix Issues

Replace hardcoded Chinese with i18n markers.

/i18n-fix <module> [--add-keys]

Fix patterns:

  • HTML: Add data-i18n="key" attributes
  • JS: Use window.t('key') with fallback

See [references/fix-patterns.md](references/fix-patterns.md) for examples.

3. i18n-sync - Sync Languages

Align translation keys across all languages.

uv run python scripts/i18n_sync.py          # Check status
uv run python scripts/i18n_sync.py --apply  # Apply changes
Quick Workflow
  1. Check: /i18n-check steam - Find hardcoded strings
  2. Fix: /i18n-fix steam - Replace with i18n markers
  3. Verify: /i18n-check steam - Confirm fixes
  4. Sync: /i18n-sync - Sync to other languages
Detection Rules
Check for:
  • HTML: Chinese text in elements or attributes
  • JS: Chinese strings not wrapped in window.t()
Skip:
  • Already has data-i18n* or window.t() wrapper
  • console.log/error/warn debug messages
  • Third-party libs (static/libs/)
  • Comments
  • Internal logic strings (e.g., includes('已离开'))
  • Data keys (e.g., data['档案名'])
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。