The Lingo.dev CLI translates your web app's resource files - JSON, YAML, XLIFF, PO, or PHP - through a configured localization engine. Set up i18n in your framework, point the CLI at your translation files, and run.
How It Works#
Every web framework has an i18n library that loads translations from resource files - JSON for React, XLIFF for Angular, PO for Django, and so on. The CLI translates those files directly, so the framework picks up translations without any code changes.
Set up i18n in your framework
Use your framework's official i18n library to add locale-aware routing, a translation function, and source-language resource files. Each framework section below links to the official setup guide.
Configure the CLI
Create an i18n.json file that tells the CLI where your translation files live and which locales to target. The bucket type matches your framework's resource format.
Run translations
Run npx lingo.dev@latest run and the CLI translates your resource files through the localization engine - glossary rules, brand voice, and model selection apply automatically.
Prerequisites#
Every CLI run sends content through a localization engine - the configuration that determines which LLM model, glossary, brand voice, and instructions apply. Create one in the Lingo.dev dashboard and generate an API key.
AI-assisted setup
The i18n MCP can scaffold your framework's entire i18n infrastructure automatically. Connect it to Claude Code, Cursor, or GitHub Copilot and prompt "Set up i18n" - the agent follows a 13-step checklist to configure routing, translation files, and a language switcher.
JavaScript Frameworks#
react-i18next loads translations from JSON files and provides a useTranslation hook that maps keys to translated strings at runtime.
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.15",
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"json": {
"include": ["public/locales/[locale]/translation.json"]
}
}
}Server-Side Frameworks#
Laravel ships with built-in localization that loads translations from PHP files organized by locale directory.
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.15",
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"php": {
"include": ["lang/[locale]/messages.php"]
}
}
}Running Translations#
With i18n.json configured, translate all resource files in one command:
npx lingo.dev@latest runThe CLI reads your source locale files, computes what changed since the last run using the lockfile, translates only the delta, and writes results to target locale files. Existing translations are preserved - the CLI only fills in missing or updated strings.
Target a specific locale or bucket when working on a subset:
npx lingo.dev@latest run --target-locale es
npx lingo.dev@latest run --bucket json