Generate i18n Translation Files from Your Codebase
Managing translation files by hand is a recipe for missing keys and stale strings — let Claude scan your codebase and generate them for you.
cat src/**/*.tsx | claude -p "Find all hardcoded user-facing strings in this code and generate a complete en.json i18n file with appropriate translation keys. Group related keys by feature."
Once you have the base locale file, ask Claude to generate translations for additional languages:
cat locales/en.json | claude -p "Translate all values in this JSON to Spanish (es) and French (fr). Return two separate JSON objects, keeping the same key structure and respecting any {placeholder} variables."
Claude handles nested key structures, placeholder variables like {name}, and pluralization rules correctly. You can also ask it to audit an existing locale file against your source code to surface orphaned keys or missing translations:
# Find keys in your source that have no translation entry
claude -p "Compare these two files: my source code and my en.json. List any user-facing strings in the source that are missing from the locale file."
The result is a consistent, well-structured i18n setup you'd normally spend hours maintaining by hand.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.