i18n Skills
AI Commands for Auditing & Wrapping i18n Strings
The Problem
Your codebase has 500 hardcoded strings scattered across components, templates, and views. Manual wrapping takes days of tedious find-and-replace work. Even after wrapping, you still miss split sentences that break in German, plural logic that fails in Arabic, and orphaned keys that bloat your locale files.
The Solution
Two AI slash commands that handle the entire i18n workflow. Run /i18n-review to audit your code read-only, then run /i18n-wrap to fix everything automatically. Both commands detect your framework, understand your locale file format, and validate changes before committing.
/i18n-review
Read-only audit that finds split sentences, broken plurals, unwrapped strings, and unused keys. Never modifies your code.
/i18n-wrap
Auto-wraps hardcoded strings with the correct translation function, generates semantic keys, updates locale files, and validates the build.
/i18n-review Command
The review command performs a read-only audit of your codebase. It scans every file for i18n issues and produces a prioritized report with exact file locations and fix suggestions. Your code is never modified.
/i18n-review src/
/i18n-review src/ --framework=next-intlWhat It Checks
- Split sentences: concatenated t() calls that break word order in other languages
- Over-wrapping: technical strings, CSS classes, URLs, and enum values incorrectly wrapped with t()
- Under-wrapping: visible UI strings like button labels, headings, and error messages left hardcoded
- Plural issues: ternary operators or === 1 checks instead of proper ICU plural syntax
- Unused keys: translation keys defined in locale files but never referenced in code
- Hardcoded format values: dates, currencies, and numbers not using Intl formatters
/i18n-wrap Command
The wrap command automatically wraps hardcoded strings with the correct translation function for your framework. It detects your i18n library, generates semantic keys grouped by component or feature, updates your locale files, and validates that the build still passes.
/i18n-wrap src/components/
/i18n-wrap src/ --framework=react-i18nextWhat It Does
- Framework detection: identifies your i18n library and its translation function (t, $t, $_, gettext, etc.)
- Semantic key generation: creates meaningful keys like nav.signIn and errors.notFound instead of generic labels
- Locale file updates: adds new keys to your source locale file in the correct format (JSON, YAML, PO, etc.)
- Build validation: runs your build, lint, and test commands after wrapping to catch any regressions
Supported Frameworks
Both commands auto-detect your framework from your project dependencies. You can also specify it explicitly with the --framework flag. Here are the 10 supported frameworks with their translation functions and plural formats.
| Framework | Translation Function | Plural Format |
|---|---|---|
| react-i18next | t() | key_one / key_other |
| next-intl | t() | ICU {count, plural, ...} |
| vue-i18n | $t() | Pipe syntax | singular | plural |
| angular i18n | $localize | ICU {count, plural, ...} |
| svelte-i18n | $_() | ICU {count, plural, ...} |
| flutter intl | S.of(context) | Intl.plural() |
| django | gettext / _() | ngettext() |
| rails i18n | t() | count key |
| laravel | __() / @lang | trans_choice() |
| swift | NSLocalizedString | .stringsdict |
Installation
Copy the command files to your .claude/commands/ directory. That's it — no dependencies, no configuration. The commands are plain Markdown files that any AI coding assistant can execute.
mkdir -p .claude/commands
cp commands/i18n-review.md .claude/commands/
cp commands/i18n-wrap.md .claude/commands/Usage Examples
React Project
Review a React app using react-i18next, then wrap all hardcoded strings. The commands detect react-i18next from your package.json and use the correct t() function and key_one/key_other plural format.
# Review a React project for i18n issues
/i18n-review src/ --framework=react-i18next
# Wrap all hardcoded strings automatically
/i18n-wrap src/components/ --framework=react-i18next
# Result: t() calls inserted, keys added to en/translation.jsonDjango Project
Audit Django templates and views for i18n issues, then wrap strings with gettext. The commands detect Django from your settings.py and use _() for simple strings and ngettext() for plurals.
# Review Django templates and views
/i18n-review myapp/ --framework=django
# Wrap hardcoded strings with gettext
/i18n-wrap myapp/templates/ --framework=django
# Result: _() calls inserted, .po file updatedRelated Framework Guides
Try i18n Agent Now
Drop your translation file here
JSON, YAML, PO, XML, CSV, Markdown, Properties
or click to browse
Target languages