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.

Manual i18n wrapping is error-prone: developers miss split sentences, break plurals with ternary operators, and leave hardcoded strings in edge cases. These bugs only surface after translation, when fixing them is 10x more expensive.

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.

Terminal
/i18n-review src/
/i18n-review src/ --framework=next-intl

What 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
The review command is completely read-only. Run it as often as you want during development or in CI/CD pipelines without risk of unintended changes.

/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.

Terminal
/i18n-wrap src/components/
/i18n-wrap src/ --framework=react-i18next

What 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
The wrap command validates every change by running your build and test suite. If anything fails, it rolls back automatically.

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.

FrameworkTranslation FunctionPlural Format
react-i18nextt()key_one / key_other
next-intlt()ICU {count, plural, ...}
vue-i18n$t()Pipe syntax | singular | plural
angular i18n$localizeICU {count, plural, ...}
svelte-i18n$_()ICU {count, plural, ...}
flutter intlS.of(context)Intl.plural()
djangogettext / _()ngettext()
rails i18nt()count key
laravel__() / @langtrans_choice()
swiftNSLocalizedString.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.

Terminal
mkdir -p .claude/commands
cp commands/i18n-review.md .claude/commands/
cp commands/i18n-wrap.md .claude/commands/
These are standard slash command files. They work in Claude Code out of the box and can be adapted for other AI coding assistants that support custom 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.

React Project
# 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.json

Django 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.

Django Project
# 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 updated

Try i18n Agent Now

Drop your translation file here

JSON, YAML, PO, XML, CSV, Markdown, Properties

or click to browse

Target languages

No signup requiredInstant estimate

Frequently Asked Questions