๐ŸŽ‰ v1.0

Get started

  • Welcome
  • Documentation
  • Pricing
    Soon

Tools

  • I18n MCP
  • CLI
  • CI/CD Integrations
  • Compiler
    Alpha
  • Connect Your Engine

Resources

  • Languages
  • LLM Models
  • Guides

Company

  • Enterprise
  • CareersHiring!
Dashboard

Lingo.dev CLI

  • How it works
  • Setup

Configuration

  • Supported formats
  • i18n.json
  • i18n.lock

Features

  • Existing translations
  • Adding languages
  • Overrides
  • Translator Notes
  • Translation keys
    • Key renaming
    • Key locking
    • Key ignoring
    • Key preserving

Performance

  • Large projects
  • Parallel processing

Retranslation

  • Automatic Retranslation
  • Retranslation
  • Remove translations

i18n.json Configuration

Max PrilutskiyMax PrilutskiyยทUpdated 1 day agoยท4 min read

i18n.json is the configuration file that controls the Lingo.dev CLI and CI/CD integrations. It defines which languages to translate, where translatable content lives, and which translation backend to use.

Minimal example#

json
{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.15",
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "ja"]
  },
  "buckets": {
    "json": {
      "include": ["locales/[locale].json"]
    }
  }
}

The $schema field enables IDE autocompletion and validation. The version field tracks the schema version for automatic migration compatibility.

Locale#

The locale section defines the source and target languages:

json
{
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de", "ja"]
  }
}
FieldDescription
locale.sourceThe language your source content is written in. All translations flow from this locale.
locale.targetsArray of target languages. Each target produces a separate file (or section) depending on the bucket format.

Language codes follow the BCP 47 standard - en, en-US, es-ES, zh-Hans, and platform-specific formats like Android's en-rUS are all supported.

To list available locale codes:

bash
npx lingo.dev@latest show locale sources   # Available source languages
npx lingo.dev@latest show locale targets   # Available target languages

Buckets#

Buckets define file discovery patterns and processing rules. Each bucket key specifies a file format, and its value configures which files to include or exclude:

json
{
  "buckets": {
    "json": {
      "include": ["locales/[locale].json"],
      "exclude": ["locales/[locale]/internal.json"]
    },
    "markdown": {
      "include": ["docs/[locale]/*.md"]
    }
  }
}
FieldDescription
includeArray of file patterns with [locale] placeholder. Supports glob wildcards (*).
excludeOptional. Array of patterns to skip during processing.
lockedKeysOptional. Keys whose values are copied from source without translation. See Key Locking.
ignoredKeysOptional. Keys excluded from translation entirely - they don't appear in target files. See Key Ignoring.
preservedKeysOptional. Keys initialized once from source, then protected from automatic updates. See Key Preserving.
injectLocaleOptional. Keys where the target locale code is injected automatically.

Include patterns#

Include patterns use the [locale] placeholder, which resolves to your configured locale codes at runtime:

  • locales/[locale].json โ†’ locales/en.json, locales/es.json
  • docs/[locale]/*.md โ†’ docs/en/*.md, docs/es/*.md

Recursive glob patterns (**/*.json) are not supported. Use explicit directory paths instead.

Custom locale delimiters#

By default, locale codes in filenames use a dash (-) delimiter: en-US.json. To use underscores instead, pass an object with a delimiter field:

json
{
  "include": [
    "standard/[locale].json",
    { "path": "legacy/[locale].json", "delimiter": "_" }
  ]
}

This produces legacy/en_US.json instead of legacy/en-US.json.

Key path notation#

The lockedKeys, ignoredKeys, and preservedKeys arrays use forward slash (/) notation for nested keys and asterisk (*) for wildcards:

json
{
  "lockedKeys": ["brand/name", "config/*"]
}

For the full list of supported bucket types, see Supported Formats.

Provider#

The provider section configures a raw LLM provider for translation. This section is optional - when omitted, the CLI uses a localization engine on Lingo.dev.

json
{
  "provider": {
    "id": "openai",
    "model": "gpt-4o-mini",
    "prompt": "Translate the provided text from {source} to {target}."
  }
}
FieldDescription
provider.idProvider identifier: openai, anthropic, google, mistral, openrouter, or ollama.
provider.modelModel name from the provider (e.g., gpt-4o-mini, claude-3-haiku).
provider.promptSystem prompt. {source} and {target} are replaced with locale codes at runtime.
provider.baseUrlOptional. Custom API endpoint (required for Ollama: http://localhost:11434).

Engine connection#

To route translations through a specific localization engine, add the engineId field:

json
{
  "engineId": "eng_SxjMwMsfOIsvV1wh"
}

When engineId is set, every translation request applies your engine's brand voice, glossary, instructions, and model configuration automatically. If omitted and LINGO_API_KEY is set, the CLI uses the default engine in your organization.

For the full setup guide, see Connect Your Engine.

Environment variables#

VariableRequiredDescription
LINGO_API_KEYFor Lingo.dev EngineYour Lingo.dev API key.
LINGO_API_URLNoCustom API base URL (for self-hosted or staging).
OPENAI_API_KEYFor OpenAI providerOpenAI API key.
ANTHROPIC_API_KEYFor Anthropic providerAnthropic API key.
GOOGLE_API_KEYFor Google providerGoogle API key.
MISTRAL_API_KEYFor Mistral providerMistral API key.
OPENROUTER_API_KEYFor OpenRouter providerOpenRouter API key.

Full example#

json
{
  "$schema": "https://lingo.dev/schema/i18n.json",
  "version": "1.15",
  "locale": {
    "source": "en",
    "targets": ["es", "fr", "de", "ja"]
  },
  "buckets": {
    "json": {
      "include": ["locales/[locale].json"],
      "lockedKeys": ["brand/name", "brand/tagline"],
      "ignoredKeys": ["internal/*"]
    },
    "markdown": {
      "include": ["docs/[locale]/*.md"]
    }
  },
  "engineId": "eng_SxjMwMsfOIsvV1wh"
}

Version migration#

The CLI automatically migrates older i18n.json configurations to the latest schema version. It creates a backup of your current file, updates the schema, and preserves all settings. No manual intervention is required.

Next Steps#

Supported Formats
All bucket types and their configuration
i18n.lock
How the lockfile tracks translation state
Connect Your Engine
Route translations through your localization engine
Setup
Install the CLI and get started

Was this page helpful?