The Lingo.dev CLI translates static files in your repository - Markdown, MDX, Markdoc, JSON, YAML, subtitles, and more - through a configured localization engine. Point it at your content, run once, and get translated files alongside your source.
Supported Content Types#
| Content type | Format | CLI bucket | Example path |
|---|---|---|---|
| Documentation | Markdown | markdown | docs/[locale]/getting-started.md |
| Documentation | MDX | mdx | docs/[locale]/getting-started.mdx |
| Documentation | Markdoc | markdoc | docs/[locale]/getting-started.mdoc |
| Structured data | JSON | json | data/[locale].json |
| Structured data | YAML | yaml | data/[locale].yaml |
| Blog posts | Markdown / MDX | markdown / mdx | blog/[locale]/post-slug.md |
| Subtitles | SRT | srt | subs/[locale]/intro.srt |
| Subtitles | VTT | vtt | subs/[locale]/intro.vtt |
| Spreadsheets | CSV | csv-per-locale | data/[locale].csv |
| Config strings | Properties | properties | lang/[locale].properties |
| Config strings | Gettext PO | po | locale/[locale]/messages.po |
| Plain text | TXT | txt | content/[locale]/readme.txt |
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.
Documentation Sites#
Most documentation frameworks organize translated content in per-locale directories. The CLI's markdown, mdx, and markdoc buckets translate these files while preserving frontmatter, code blocks, and component syntax.
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.15",
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"markdown": {
"include": ["docs/[locale]/getting-started.md"]
},
"mdx": {
"include": ["docs/[locale]/setup.mdx"]
}
}
}Adjust the include pattern to match your framework's directory convention:
| Framework | Locale directory convention | Reference |
|---|---|---|
| Docusaurus | i18n/[locale]/docusaurus-plugin-content-docs/current/ | Docusaurus i18n guide |
| Nextra | Per-locale pages or JSON dictionaries | Nextra documentation |
| Hugo | content/[locale]/ | Hugo multilingual guide |
| Astro | src/content/[locale]/ or JSON dictionaries | Astro i18n guide |
| VitePress | [locale]/ directory prefix | VitePress i18n |
| MkDocs | Per-locale docs/ with i18n plugin | MkDocs i18n plugin |
MDX components
The mdx bucket preserves JSX component syntax during translation. Custom components like <Callout>, <Tabs>, and <CodeBlock> pass through unchanged - only the text content inside them is translated.
Structured Data#
JSON and YAML files translate with the json and yaml buckets. Use locked keys to prevent non-translatable values (IDs, URLs, configuration flags) from being modified.
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.15",
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"json": {
"include": ["content/[locale].json"],
"lockedKeys": ["id", "slug", "url"]
},
"yaml": {
"include": ["data/[locale].yaml"]
}
}
}For YAML files that use the locale code as the root key (common in Rails and Hugo), use the yaml-root-key bucket instead - it reads from the source locale key and writes to target locale keys within the same file.
Subtitles#
SRT and VTT subtitle files translate with the srt and vtt buckets. The CLI preserves all timing data, cue indices, and formatting tags - only the text content is translated.
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.15",
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"srt": {
"include": ["subs/[locale]/intro.srt"]
}
}
}Working with Large Content#
Static content repositories can contain thousands of files. The CLI handles this efficiently through three mechanisms:
| Mechanism | How it helps |
|---|---|
| Lockfile | Tracks SHA-256 fingerprints of source content. Only new or modified files trigger translation on subsequent runs. |
| Parallel processing | Distributes translation across concurrent workers. Configure with run --concurrency 20. |
| Targeted runs | Process a specific bucket or locale: run --bucket markdown or run --target-locale es. |
