🎉 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 Compiler

  • How it works
  • Setup

Framework Integration

  • Next.js
  • Vite + React

Configuration

  • Configuration Reference
  • Translation Providers
  • Build Modes

Features

  • Manual Overrides
  • Custom Locale Resolvers
  • Automatic Pluralization
  • Locale Switching

Development

  • Development Tools
  • Project Structure

Guides

  • Best Practices
  • Migration Guide
  • Troubleshooting

Manual Overrides

Max PrilutskiyMax Prilutskiy·Updated 5 days ago·2 min read

Alpha

The Lingo.dev Compiler is in alpha. It is unstable, not recommended for production use, and APIs may change between releases.

The data-lingo-override attribute gives you precise control over specific translations. When you need an exact translation for a brand name, legal text, or marketing headline, add the attribute to any JSX element and the compiler uses your provided translations instead of generating them with AI.

Basic usage#

Pass an object mapping locale codes to translations:

tsx
<h1 data-lingo-override={{ es: "Bienvenido", de: "Willkommen", fr: "Bienvenue" }}>
  Welcome
</h1>

The compiler uses the override value for each specified locale. For locales not listed in the override object, the compiler generates translations normally.

How overrides work#

1

Compiler encounters a JSX element with data-lingo-override

During the AST analysis phase, the compiler detects the data-lingo-override attribute on the element.

2

Override values are extracted

The locale-to-translation mapping is read from the attribute value.

3

Overrides take precedence

For each locale present in the override object, the compiler uses the provided translation. AI translation is skipped for those locales. Locales not in the override are translated normally.

Use cases#

Use caseWhy overrideExample
Brand namesAI may localize names that should stay consistent across languagesdata-lingo-override={{ es: "Lingo.dev", de: "Lingo.dev" }}
Marketing copySpecific phrasing crafted by a copywriterdata-lingo-override={{ es: "Tu motor de localizacion" }}
Legal textRegulatory requirements demand exact wordingdata-lingo-override={{ de: "Datenschutzerklarung" }}
Idioms and punsWordplay that requires human creativitydata-lingo-override={{ fr: "C'est la vie" }}
UI with strict character limitsAI translations may exceed space constraintsdata-lingo-override={{ ja: "OK" }}

Examples#

Paragraph text#

tsx
<p data-lingo-override={{ es: "Crea un motor de localizacion en Lingo.dev" }}>
  Create a localization engine on Lingo.dev
</p>

Attributes#

Overrides apply to the text content of the element. For translatable attributes like placeholder, alt, or aria-label, the compiler handles them separately through its standard attribute translation pipeline.

Partial overrides#

You do not need to provide overrides for every target locale. Supply only the locales that need manual control:

tsx
<h2 data-lingo-override={{ ja: "はじめに" }}>
  Getting Started
</h2>

In this example, Japanese uses the override while all other target locales receive AI-generated translations.

When to use overrides vs. other approaches#

ApproachWhen to use
data-lingo-overrideSpecific elements where you know the exact translation.
Glossary (Lingo.dev Engine)Terms that should be translated consistently across the entire app.
Brand Voice (Lingo.dev Engine)Tone and style preferences that apply to all translations.
Custom promptsGeneral translation instructions for all content.

Overrides are the most granular option - they apply to a single element. For project-wide consistency, use a glossary or brand voice through the Lingo.dev localization engine instead.

Next Steps#

Configuration Reference
All configuration options
Translation Providers
Custom prompts and locale-pair mapping
Glossaries
Project-wide term consistency
Best Practices
When and how to use overrides

Was this page helpful?