Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Localization Example

Demonstrates localizing Flutter ARB (Application Resource Bundle) files with the Lingo.dev CLI (@lingo.dev/cli) push/pull flow. Message strings — including ICU plurals and placeholders — are translated, while metadata (@/@@ keys, description, placeholders) is preserved and @@locale is rewritten to each target.

Full walkthrough: lingo.dev/en/guides/mobile-app

What's inside

  • lib/l10n/en.arb — source ARB (English)
  • l10n.yaml — Flutter gen_l10n configuration
  • .lingo/config.json — Lingo.dev CLI configuration (flutter format)

Note on file naming: this example uses locale-as-filename ARB files (en.arb, es.arb, …) rather than Flutter's default app_en.arb. That keeps the locale the last path segment, which is how the CLI derives target paths. l10n.yaml sets template-arb-file: en.arb so flutter gen-l10n picks it up.

Quick start

# 1. Install the CLI (or prefix commands with `npx`)
npm install -g @lingo.dev/cli

# 2. Authenticate and link this repo to your engine
lingo login
lingo link

# 3. Translate changed source into every locale
lingo push --wait

Translations are committed next to the source as lib/l10n/<locale>.arb. This repo ships fully translated. After you edit en.arb, lingo push --wait translates only the delta. To bootstrap a brand-new locale, add it to .lingo/config.json and run lingo push --backfill-missing.

How it works

lingo push parses the ARB, diffs it against .lingo/lock.json, and translates only the message strings through your linked engine. Metadata is preserved: @key objects (description, placeholders), placeholder tokens like {name}, and ICU plural structures ({count, plural, …}) stay intact — only the human-readable text changes. The @@locale global is rewritten to each target locale, and @@/@-prefixed keys otherwise pass through untouched. Results are written to lib/l10n/<locale>.arb.

Run flutter gen-l10n afterward to regenerate the typed AppLocalizations Dart classes from the translated ARB files.

Automate in CI (optional)

Want translations on every push or PR without running the CLI yourself? See the CI/CD Workflows guide — the Lingo.dev GitHub App translates automatically once installed.

Locales

  • Source: en
  • Targets: es, fr, de

Links

About

Demonstrates localizing Flutter ARB files with the Lingo.dev CLI push/pull flow

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors