Translation keys

How translation keys work in Lingo.dev CLI

Introduction

A translation key is a unique identifier that connects a piece of content to its corresponding translations across different languages. When configuring certain types of buckets, you can use these keys to enable bucket-specific features, such as key locking or key ignoring.

User-defined keys

In some file formats, translation keys must be explicitly defined. For example, in the following JSON file, title, description, and version are the translation keys:

{
  "title": "Hello, world!",
  "description": "A simple demo app",
  "version": "1.0.0"
}

You have complete control over the naming of these keys.

Auto-generated keys

In some file formats, translation keys are auto-generated based on the structure of the file. These, for instance, are examples of auto-generated keys for an HTML file:

  • head/0/0
  • head/1#content
  • body/0/0
  • body/1/0
  • body/1/1/0

To identify an auto-generated key for a specific piece of content, browse the project's i18n.lock file.

Renaming keys

When you refactor your code and rename keys for better organization, Lingo.dev CLI automatically detects that the content is the same and preserves existing translations. This prevents unnecessary retranslation work when only the key identifier changes, not the actual content.

To learn more, see Key renaming.

Locking keys

Some content like technical identifiers, component names, or brand terms should remain identical across all languages. Key locking allows you to exclude specific keys from translation processing, copying the source values directly to all target files instead.

To learn more, see Key locking.

Ignoring keys

Development, testing, or internal content often doesn't need translation and shouldn't appear in production files. Key ignoring completely excludes these keys from translation processing, keeping them out of target files entirely.

To learn more, see Key ignoring.