i18n-expert
This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages, and validating key parity, pluralization, and formatting.
Security Assessment
About i18n-expert
This skill delivers a complete internationalization and localization pass for UI codebases: it configures the i18n framework, replaces hard-coded user-facing strings with keys, ensures locale parity, and validates pluralization and formatting. It targets the common problem of partially or inconsistently localized apps where strings drift out of sync between locales, error messages leak raw internals to users, and accessibility labels go untranslated. Its default target locales are en-US and zh-CN, but it adapts to the frameworks and formats in scope.
It follows an audit-fix-validate workflow. It selects a framework-appropriate library (react-i18next, next-intl, vue-i18n), wires the provider at the app root, and establishes locale file layout and key namespaces. A bundled Python audit script (`scripts/i18n_audit.py`) extracts `t('key')` usage and compares it against locale JSON files to surface missing keys and parity gaps, which are treated as blockers. It uses ripgrep searches to find raw strings and untranslated aria-labels/titles/placeholders, replaces them with namespaced keys, handles plurals via count and _one/_other keys, and maps error codes to localized messages while logging only raw error details. Validation re-runs the audit to zero and checks JSON validity.
It is aimed at frontend engineers and teams standardizing i18n across React, Next.js, or Vue apps, including non-web surfaces like Electron dialogs and CLI prompts. Its guardrails are security-conscious: never expose raw error.message to the UI, don't add unrequested locales, preserve placeholders exactly, and keep certain brand/technical terms untranslated.
FAQ
What frameworks does it support?
React (react-i18next), Next.js (next-intl), and Vue (vue-i18n), plus non-web surfaces like Electron main-process dialogs and CLI prompts.
What does the bundled audit script do?
scripts/i18n_audit.py extracts t('key') usage from source and compares it against locale JSON files to report missing keys and locale parity gaps.
Which locales does it target by default?
en-US and zh-CN, though target locales are configurable; it deliberately avoids adding extra locales unless explicitly requested.
How does it handle error messages?
It maps error codes to localized keys and shows only localized UI strings, logging raw error details rather than exposing error.message to users.
How are pluralization and formatting validated?
Plurals use count plus _one/_other keys validated per locale rules, and Intl/app formatters handle dates, numbers, and lists; the audit is re-run until missing and parity issues reach zero.
Install i18n-expert
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
daymade/claude-code-skills