I18n
Vue 3 项目的国际化工作流——扫描硬编码中文、抽取到 locale 文件并替换成 $t() 调用、审计各语言 key 的完整性。当用户说「国际化/i18n/做多语言/提取中文/这个页面还没翻译/locale 文件对不上/加一门语言」,或者在 Vue 项目里看到模板和 TS 里散着写死的中文需要收拢时使用。非 Vue 项目、或者只是要翻译一段文本,不用它。From its SKILL.md
npx -y skills add phoxiao/kivi-claude-skills --skill i18nAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 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
3.4 KB, as published. Nobody here has run it
/i18n — Vue 国际化工作流
Description
Internationalization workflow for Vue 3 projects. Scans, extracts, and audits i18n strings.
Instructions
Subcommands
/i18n scan— Scan for hardcoded Chinese strings in Vue/TS files/i18n extract— Extract strings to locale files and replace with$t()calls/i18n audit— Check key completeness across all locale files
/i18n scan
-
Search for hardcoded Chinese characters in:
src/**/*.vue— template and script sectionssrc/**/*.ts— TypeScript files- Exclude:
src/locales/,node_modules/,dist/
-
Pattern to detect Chinese:
[\u4e00-\u9fff] -
Output format:
## Hardcoded Chinese Strings Found ### src/views/Dashboard.vue - Line 15: `<h1>仪表盘</h1>` → suggested key: `dashboard.title` - Line 28: `placeholder="请输入搜索内容"` → suggested key: `dashboard.search_placeholder` ### src/components/UserCard.vue - Line 8: `'用户不存在'` → suggested key: `user.not_found` Total: 3 strings in 2 files
/i18n extract
-
Run scan first to identify strings
-
For each string:
- Generate a key following the naming convention:
page.section.description - Add the key and Chinese value to
src/locales/zh-CN.json - Add the key with empty string to
src/locales/en.json(for later translation) - Replace the hardcoded string with
$t('key')ort('key')in setup script
- Generate a key following the naming convention:
-
Handle different contexts:
- Template text:
<h1>{{ $t('dashboard.title') }}</h1> - Template attribute:
:placeholder="$t('dashboard.search_placeholder')" - Script string:
t('user.not_found')(requiresconst { t } = useI18n()) - Ensure
useI18n()import exists in<script setup>if not already present
- Template text:
/i18n audit
- Read all locale files in
src/locales/ - Compare keys across all files
- Report:
## i18n Audit Report ### Missing Keys - `en.json` missing: dashboard.title, user.not_found (2 keys) - `zh-CN.json` missing: none ### Empty Values - `en.json`: dashboard.title, dashboard.search_placeholder (2 keys) ### Unused Keys (not referenced in source) - `zh-CN.json`: old.deprecated_key Total keys: 45 Coverage: zh-CN 100%, en 93%
Key Naming Convention
- Format:
page.section.description - Use
snake_casefor multi-word segments - Examples:
dashboard.title— page titledashboard.search_placeholder— search input placeholderuser.form.email_label— form field labelcommon.confirm— shared across pageserror.network_error— error messages
Default Locale
- Primary:
zh-CN - Secondary:
en
Rules
- Never delete existing keys during extract — only add new ones
- Always preserve the existing structure and ordering of locale files
- Use flat key structure with dot notation, not nested objects
- If
vue-i18nis not installed, warn the user before proceeding