|
Knowledgebase
EnterprisePlatform
PlatformAPIReact (MCP)React (Lingo Compiler)
Alpha
CLI
Integrations
GuidesChangelog

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

Key Preserving

Max PrilutskiyMax Prilutskiy·Updated 13 days ago·1 min read

Preserved keys are initialized once with source values and then protected from automatic updates. The CLI never overwrites them - they serve as placeholders for content that requires manual translation, such as legal text, compliance copy, or marketing taglines.

Configuration#

Add preservedKeys to a bucket in i18n.json:

json
{
  "buckets": {
    "json": {
      "include": ["locales/[locale].json"],
      "preservedKeys": ["legal/privacy", "legal/terms"]
    }
  }
}

How it works#

Given this source file:

json
{
  "welcome": "Welcome to our platform",
  "legal": {
    "privacy": "We respect your privacy and protect your data.",
    "terms": "By using this service, you agree to our terms."
  }
}

On the first run, the CLI copies preserved keys as-is while translating everything else:

json
// locales/es.json (first run)
{
  "welcome": "Bienvenido a nuestra plataforma",
  "legal": {
    "privacy": "We respect your privacy and protect your data.",
    "terms": "By using this service, you agree to our terms."
  }
}

After you manually translate the legal section, subsequent CLI runs leave your translations intact.

Key Preserving vs. Key Locking#

Key PreservingKey Locking
Initial valueSource value as placeholderSource value (always)
Manual editsPreserved permanentlyOverwritten with source on each run
Use caseLegal, compliance, manual translationBrand names, technical IDs

Key path notation#

Use forward slash (/) for nested keys and asterisk (*) for wildcards:

json
{ "preservedKeys": ["legal/*", "marketing/tagline"] }

Next Steps#

Key Locking
Copy values without translation
Key Ignoring
Exclude keys from target files
Translation Keys
Overview of all key-level controls
Overrides
How manual edits are preserved

Was this page helpful?