Flutter ARB file format: example, plurals and placeholders, translated with AI

Flutter ARB files for gen-l10n: ICU plurals and selects, @key descriptions and placeholders, translated per locale.

.arbformat: arbone file per locale

What it is

ARB (Application Resource Bundle) is the localization format of Flutter's gen-l10n and the intl package. Each locale is one JSON file in lib/l10n (app_en.arb, app_es.arb, app_pt_BR.arb); every message is an ICU MessageFormat string, and an @key object beside it holds the description and placeholder types that flutter gen-l10n turns into a typed AppLocalizations class.

Example

lib/l10n/app_en.arb
{  "@@locale": "en",  "@@last_modified": "2026-11-12T09:00:00Z",  "helloUser": "Hello, {userName}!",  "@helloUser": {    "description": "Greeting on the home screen",    "placeholders": { "userName": { "type": "String", "example": "Ada" } }  },  "inboxCount": "{count, plural, =0{No messages} =1{1 message} other{{count} messages}}",  "@inboxCount": {    "description": "Inbox header",    "placeholders": { "count": { "type": "int" } }  },  "replied": "{gender, select, male{He replied} female{She replied} other{They replied}}",  "@replied": { "placeholders": { "gender": { "type": "String" } } },  "termsLink": "Read our <link>terms</link>"}

How Glossa handles it

Plurals
ICU plural and select messages are translated as one message, never split into keys. The model is told which plural categories the target language needs (Russian: one, few, many, other; Arabic: zero through other), and every draft is checked: =0 and =1 branches kept, select keys kept as written, every required category present.
Comments and context
The @key description becomes the string's context in every translation prompt and is written back unchanged in each target file.
Placeholders
Placeholders ({userName}, {count}) and tags (<link>) are protected and checked. A translation that renames {userName}, drops <link> or changes a select key is marked needs review with a review task, so gen-l10n never sees a broken message.
Round trip
Each target file gets its @@locale, the same @key metadata (placeholder types, examples, formats) and your other @@ attributes, so flutter gen-l10n reads the output without changes to l10n.yaml.

Which entries get translated

Every key that does not start with @ and holds a string is a message and is translated. @key objects are metadata: the description becomes context, and placeholders, types and examples are copied to every target file. @@ attributes such as @@last_modified are copied too, and @@locale is set to the target. A value that is not a string is skipped with a warning.

What a translated ARB file looks like

Pull writes app_es.arb next to the template with the same keys in the same order, the metadata from the template and the template's indentation. The Spanish plural gains the many category CLDR defines for Spanish (used for large round numbers such as un millón), because the draft check requires every category the language has.

lib/l10n/app_es.arb
{  "@@locale": "es",  "@@last_modified": "2026-11-12T09:00:00Z",  "helloUser": "¡Hola, {userName}!",  "@helloUser": {    "description": "Greeting on the home screen",    "placeholders": {      "userName": {        "type": "String",        "example": "Ada"      }    }  },  "inboxCount": "{count, plural, =0{No hay mensajes} =1{1 mensaje} one{{count} mensaje} many{{count} de mensajes} other{{count} mensajes}}",  "@inboxCount": {    "description": "Inbox header",    "placeholders": {      "count": {        "type": "int"      }    }  },  "replied": "{gender, select, male{Él respondió} female{Ella respondió} other{Respondieron}}",  "@replied": {    "placeholders": {      "gender": {        "type": "String"      }    }  },  "termsLink": "Lee nuestros <link>términos</link>"}

Plurals in languages with more forms

English needs one and other; Russian needs one, few and many as well, and Arabic six forms. A Russian draft with only one and other would pass gen-l10n and still say "2 сообщений", so Glossa rejects it with the missing categories named ("{count, plural} needs the few, many categories in ru") and files a review task instead of writing it. The accepted translation looks like this:

lib/l10n/app_ru.arb (excerpt)
"inboxCount": "{count, plural, =0{Нет сообщений} =1{1 сообщение} one{{count} сообщение} few{{count} сообщения} many{{count} сообщений} other{{count} сообщения}}"

Regional locales and file names

flutter gen-l10n reads the locale from @@locale and from the file name, splits it on underscores and stops with an error when the two disagree. Glossa therefore writes regional and script locales with underscores in both places: app_pt_BR.arb with "@@locale": "pt_BR", app_zh_Hant_TW.arb with "zh_Hant_TW". gen-l10n also needs the base language as a fallback, so translate into pt as well when you add pt-BR.

Keep it in sync from CI

Run sync after the template changes, then let Flutter generate the Dart code. sync pushes app_en.arb, waits for new strings to be translated and pulls every target ARB file into lib/l10n, so the pull request carries the translations with the code that needs them. Messages whose English changed are translated again (or kept for review, if the project turns retranslation off).

npx @meterapp/glossa sync lib/l10n/app_en.arb --project app --wait 10mflutter gen-l10ngit add lib/l10n

Translate it from the command line

Push the source-language file; strings are deduplicated against the rest of your workspace and queued for translation. Pull writes lib/l10n/app_es.arb back in the same format.

npx @meterapp/glossa loginnpx @meterapp/glossa push lib/l10n/app_en.arb --project appnpx @meterapp/glossa pull --project app --locale es,de,ja

Or ask an agent over MCP: “Push lib/l10n/app_en.arb to Glossa and pull Spanish.” It calls push_file and pull_file. See the CLI and MCP guides.

Questions

How do I translate Flutter ARB files with AI?
Push the template (npx @meterapp/glossa push lib/l10n/app_en.arb --project app). Glossa translates every message into the project's target languages with Claude, using each @key description as context, and pull writes app_es.arb, app_de.arb and so on into lib/l10n for flutter gen-l10n.
Will AI translation break my ICU plurals or select messages?
Every draft is parsed as ICU and compared with the source before it is stored: the same arguments, the =0 and =1 branches, the select keys as written and every plural category the target language needs. A draft that fails is marked needs review and goes to the review queue with the problem named.
What happens to @key metadata and placeholder types?
They are copied unchanged into every target file, so placeholder types, examples and number or date formats stay identical across locales. The description is also sent to the model as context.
Do I need to change l10n.yaml?
No. Target files are written next to the template, named after it (app_en.arb becomes app_es.arb, app_pt_BR.arb), which is where gen-l10n's arb-dir looks.

Other formats

Moving from Crowdin? Read the comparison.

Bring every translation you have

Glossa hosts every app free, for good. Import your files, connect your chatbot to audit them, and export the fixes back into your codebase.