mcpbeat Sign in

I18n Helper Skill for Claude

国际化/本地化助手 — 扫描代码中的硬编码文本、生成 i18n 配置、批量翻译

589 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
722
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/laolaoshiren/claude-code-skills-zh --skill i18n-helper

The instruction itself

7 sections, as written by the author

🌍 i18n-helper — 国际化/本地化助手

触发条件

当用户要求以下操作时激活此技能:

  • 扫描代码中的硬编码中文/英文文本
  • 为项目添加国际化支持(i18n)
  • 批量提取和翻译语言文件
  • 检查翻译完整性(缺失 key 检测)

工作流程

1. 项目分析

  • 检测项目类型(React/Vue/Angular/Node.js/Python/Java 等)
  • 识别已使用的 i18n 框架(react-intl, vue-i18n, i18next, gettext 等)
  • 扫描源代码目录结构

2. 硬编码文本扫描

  • .js/.jsx/.ts/.tsx/.vue/.py/.java/.go 等文件中搜索硬编码字符串
  • 排除:变量名、URL、正则表达式、import 路径、日志调试信息
  • 标记:用户可见的 UI 文本、错误提示、通知消息

3. 语言文件生成

根据项目框架生成对应格式:

  • JSON (i18next/react-intl): { "key": "value" }
  • YAML (vue-i18n): key: value
  • PO/POT (gettext): 标准格式
  • Properties (Java): key=value

4. 代码替换

  • 将硬编码文本替换为 i18n 函数调用
  • 保持原有格式和变量插值
  • 示例:
  // 替换前
  alert('保存成功');
  // 替换后
  alert(t('alert.saveSuccess'));

5. 完整性检查

  • 对比主语言文件与翻译文件的 key 差异
  • 输出缺失翻译的 key 列表
  • 统计翻译完成度百分比

输出格式

## 📊 i18n 扫描报告

### 硬编码文本
| 文件 | 行号 | 内容 | 建议 key |
|------|------|------|----------|
| src/App.tsx | 42 | '欢迎使用' | page.welcome |

### 语言文件
已生成 `locales/zh-CN.json` 和 `locales/en-US.json`

### 翻译完整性
- zh-CN: 45/45 (100%) ✅
- en-US: 42/45 (93.3%) ⚠️ 缺少 3 个 key

支持的 i18n 框架

  • react-intl / FormatJS
  • vue-i18n
  • i18next / react-i18next / next-i18next
  • Angular @ngx-translate
  • Python gettext / Flask-Babel
  • Java ResourceBundle / Spring MessageSource
  • Go go-i18n

注意事项

  • 不要翻译技术术语(API、SDK、HTTP 等)
  • 保留变量占位符 {name} {{count}} %s 等格式
  • 复数形式和性别变体需要特殊处理
  • 日期、数字、货币格式需使用 locale 感知的格式化函数

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take laolaoshiren/i18n-helper from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.