Documentation reviewed 23 November 2026.
Quick answer
Flutter localization uses the flutter_localizations and intl packages plus a code generator, gen_l10n. You write each string once in an ARB file (lib/l10n/app_en.arb), add one ARB file per language, set generate: true in pubspec.yaml, and Flutter generates a typed AppLocalizations class. You register its delegates on MaterialApp and read strings with AppLocalizations.of(context). Plurals and selects are written in ICU message syntax inside the ARB value, and dates, numbers and currency are formatted by intl from a format you declare on the placeholder. The work most guides leave out is what this one adds: right to left, text that grows, tests, CI, and how to check ARB files that a model translated.
What you will have at the end
This guide targets Flutter 3.50, the current stable release, and intl 0.20.3. By the end you will have:
- A Flutter app that reads every string from ARB files through a generated, typed class.
- Plurals that are correct in languages with four or six forms, not only in English.
- Dates, numbers and currency formatted per locale.
- A language switch inside the app and a layout that works right to left.
- Tests and a CI job that fail when a translation is missing or malformed.
- A repeatable way to translate ARB files with AI and check the result.
It is for developers who own the Flutter codebase. If you are deciding which languages to launch and how to review them, read how to localize a mobile app into 20 languages alongside it.

Part 1: set up gen_l10n
Add the dependencies
From the project root:
Then turn on code generation in pubspec.yaml:
generate: true is required. Since Flutter 3.32 the tool no longer creates the synthetic package:flutter_gen package, and the generated files are written into your source tree.
Older tutorials importpackage:flutter_gen/gen_l10n/app_localizations.dart. That import comes from the synthetic package Flutter replaced in 3.32. Import the generated file from its real location, for examplel10n/app_localizations.dart.
Configure l10n.yaml
Create l10n.yaml in the project root:
The first three lines are the documented defaults, written out so the next developer can see them. The options you are most likely to change:
| Option | What it does |
|---|---|
arb-dir | Folder that holds the template and the translated ARB files. Default lib/l10n. |
template-arb-file | The source language file. Default app_en.arb. |
output-dir | Where the generated Dart goes. Defaults to arb-dir. |
output-class | Name of the generated class. Default AppLocalizations. |
nullable-getter | Whether AppLocalizations.of(context) returns a nullable type. Default true. Set false to drop the !. |
untranslated-messages-file | Writes a JSON file listing the keys each locale is missing. |
preferred-supported-locales | Puts a locale first in the generated list, which is otherwise alphabetical. |
required-resource-attributes | Requires an @key entry for every message. |
use-escaping | Turns on single quote escaping, so '{' is a literal brace. |
use-deferred-loading | Loads locales lazily on Flutter web. No effect on mobile or desktop. |
use-named-parameters | Generates methods with named parameters. |
Write the first ARB files
ARB (Application Resource Bundle) is JSON. The template file carries the strings and their metadata:
The translated file needs only the strings:
Run flutter pub get or flutter run and the code is generated. flutter gen-l10n generates it without running the app.
Register the delegates
AppLocalizations.localizationsDelegates is the generated list: your own delegate plus the flutter_localizations delegates that translate Flutter's built-in widgets, such as date pickers and back button labels. AppLocalizations.supportedLocales is generated from the ARB files in the folder, so adding app_de.arb adds German without touching main.dart.
Use onGenerateTitle for the app title, not title. AppLocalizations is available only below MaterialApp, so calling it in the same build method that creates the app fails.
Reading a string anywhere below the app:
A message with placeholders becomes a method, and a message without becomes a getter. A missing argument or a misspelled key is a compile error.
One step on iOS
The Flutter documentation requires one manual step for iOS: open ios/Runner.xcodeproj in Xcode, select the Runner project, open the Info tab and add each supported language under Localizations. The App Store reads this list to decide which languages the app supports.
Part 2: ARB file anatomy
An ARB file has three kinds of entry.
| Entry | Example | Meaning |
|---|---|---|
| Global attribute | "@@locale": "en" | Applies to the whole file. The ARB specification also defines @@last_modified, @@context and @@author. |
| Message | "greeting": "Welcome back, {name}" | The key becomes the Dart method name. The value is always a string. |
| Message attribute | "@greeting": { ... } | Metadata for the message with the same key. Never shown to users. |
Inside a message attribute, three fields matter in Flutter:
description: a note for the translator. Write one for every string that is short or ambiguous. "Open" as a button and "Open" as a status are different words in most languages.placeholders: one entry per{variable}in the message, each with atype.example, inside a placeholder: a sample value that shows the translator what will be inserted.
Placeholder types and what they unlock:
type | format values | Formatted by |
|---|---|---|
String | None | Inserted as written |
int, double, num | compact, compactLong, decimalPattern, percentPattern, scientificPattern, and with optionalParameters: currency, simpleCurrency, compactCurrency, compactSimpleCurrency, decimalPatternDigits, decimalPercentPattern | NumberFormat from intl |
DateTime | The names of the DateFormat constructors, such as yMd or yMMMd | DateFormat from intl |
Metadata belongs in the template file. Translated files carry the message and@@locale. Nothing that starts with@is ever translated.
Part 3: plurals and selects in ICU syntax
Plurals
Flutter writes plurals in ICU message syntax inside the ARB value. Only other is required by the parser:
Call it with AppLocalizations.of(context).inboxCount(3). The generator accepts the cases =0, =1, =2, zero, one, two, few, many and other. A plural message always needs its @key entry with the placeholder declared.
English has two plural categories. Many languages have more, and the right form depends on the number, not on "one or many". The Unicode CLDR rules for a few common targets:
| Language | Categories | Example numbers |
|---|---|---|
| Japanese | other | All numbers use one form |
| English | one, other | 1, then everything else |
| Polish | one, few, many, other | 1, then 2 to 4, then 5 to 21, with other for fractions |
| Russian | one, few, many, other | 1 and 21, then 2 to 4, then 5 to 20 |
| Arabic | zero, one, two, few, many, other | 0, 1, 2, then 3 to 10, then 11 to 99, then 100 |
The same message in Polish carries four branches:
With that file, 1 prints "1 nowa wiadomość", 3 prints "3 nowe wiadomości" and 5 prints "5 nowych wiadomości". A Polish file with only one and other still compiles. It prints the wrong word for 3, and nothing warns you.

Selects
A select picks a branch by a string value:
The match is case sensitive: replyNotice('Male') falls through to other.
Put the whole sentence inside each branch. A message such as{count} {count, plural, one{file} other{files}} deletedforces every language into English word order. Write{count, plural, one{{count} file deleted} other{{count} files deleted}}.
Braces and apostrophes
A literal { in a message is read as the start of a placeholder. Set use-escaping: true in l10n.yaml and wrap literal text in single quotes. A doubled single quote prints one. This matters most in French and Italian, where apostrophes are frequent, so decide on escaping before you translate, not after.
Part 4: dates, numbers and currency
Do not build dates or prices with string concatenation. Declare a format on the placeholder and intl formats the value for the active locale:
The Flutter documentation gives the size of the difference: the yMd format prints 9 July 1959 as "7/9/1959" in US English and "9.07.1959" in Russian. For 1,200,000, compact prints "1.2M" and compactLong prints "1.2 million" in English.
Where you format outside a message, use intl directly and pass the locale:
Formatting a price is not converting it. The locale decides where the symbol and the separators go. The currency is a fact about the order, so pass the symbol or the ISO 4217 name yourself. TheintlREADME also lists two limits worth knowing:DateFormatdoes not support time zones, andDurationformatting is not implemented.
Part 5: locale resolution and switching at runtime
How Flutter picks a locale
At startup, and again when the user changes the device language, Flutter resolves a locale in this order:
localeListResolutionCallback, if you set it. It receives the user's full list of preferred locales.localeResolutionCallback, if the first is null or returns null. It receives only the first preferred locale.- The built-in algorithm. Without an exact match it uses the first supported locale with the same language code, and failing that, the first entry in
supportedLocales.
The third point is why the order of supportedLocales matters: the first entry is your fallback language. Use preferred-supported-locales in l10n.yaml to control it. For Chinese, declare the script (zh_Hans, zh_Hant) with Locale.fromSubtags, because the language code alone does not separate Simplified from Traditional.
Switch language inside the app
MaterialApp.locale overrides the device locale. Hold it in state above the app and rebuild when it changes:
Store the chosen language tag in whatever storage the app already uses and read it before runApp. To show one subtree in another language, for example a preview in a language picker, wrap it in Localizations.override(context: context, locale: const Locale('es'), child: ...). Localizations.localeOf(context) returns the active locale.
Part 6: right to left and text that grows
Right to left
With the flutter_localizations delegates registered, an Arabic or Hebrew locale sets the ambient text direction, and widgets that respect Directionality mirror themselves. What does not mirror is anything you positioned with left and right. Replace the physical classes with the directional ones:
| Physical (does not mirror) | Directional (mirrors) |
|---|---|
EdgeInsets.only(left: 16) | EdgeInsetsDirectional.only(start: 16) |
Alignment.centerLeft | AlignmentDirectional.centerStart |
Directionality.of(context) returns the current direction when you need to branch by hand, for example to flip a custom painted arrow. For user text of unknown direction inside a sentence, such as an Arabic username in an English notification, the intl package has BidiFormatter, which wraps the text in Unicode direction marks.
Text that grows
Translations are rarely the length of the English. German and Finnish labels run longer, and a fixed width that fits "Save" does not fit its translation. In Flutter:
- Put text in a
RowinsideFlexibleorExpanded, so it wraps instead of overflowing. - Avoid fixed
widthandheighton anything that contains text. - Where a single line is a real constraint, set
maxLines: 1andoverflow: TextOverflow.ellipsis, and accept that the user loses the end of the label. - Do not shrink the font to make a translation fit. Users who raise the system text size get the same overflow again.
Add one right to left language and one long language to the first batch. The layout work is the same for the next ten languages, and it is cheaper before the screens multiply.
Part 7: testing localized widgets
Pin the locale in a widget test
A widget test needs the same delegates as the app. A small helper keeps tests short:
Test the plural boundaries of the language with the most forms you ship. For Polish that is 1, 2, 5 and 22.
Catch overflow in every language
A layout overflow raises an exception in a widget test. Loop over the generated locale list on a small screen and the test fails for the language that does not fit:
Because the loop reads AppLocalizations.supportedLocales, a language added next month is tested without editing the file.
Long-string testing before translations exist
The Flutter internationalization page documents no built-in pseudolocale, so generate a padded file yourself. This script writes a fake German file in which every plain string is bracketed and about half as long again:
Run it on a throwaway branch, start the app in German and look for two things: text cut off before the closing bracket, and any English text without brackets, which is a string still hardcoded in a widget.
Part 8: translating ARB files with AI, and checking the result
A model translates interface text well enough to draft every language in one run. ARB is where the drafts break, because the file mixes prose with syntax. The failures are predictable:
| What breaks | Example | Effect |
|---|---|---|
| A placeholder is translated | {name} becomes {nombre} | The value is no longer inserted where the translator meant it |
| A placeholder is dropped | Hola de nuevo | Compiles. The name silently disappears |
| ICU keywords are translated | plural becomes pluriel, other becomes autre | gen-l10n fails to parse the message |
| The plural is flattened | {count} nowych wiadomości | Compiles. Wrong for 1 and for 2 to 4 |
| English plural shape is copied | Only one and other in Polish or Arabic | Compiles. Wrong for most numbers |
@ keys are translated | "@saludo", or a translated description | Orphan metadata, or a metadata key with no message |
| The key is translated | "save" becomes "guardar" | The string is reported untranslated |
| A brace is lost | {count, plural, one{...} other{...} | gen-l10n fails |
| Select case names are translated | male{...} becomes hombre{...} | Compiles. Every value falls through to other |
Three checks cover them.
1. Let the generator parse every file. flutter gen-l10n parses the ICU syntax of each locale and stops on a malformed message. It also writes the missing keys per locale to the untranslated-messages-file. When nothing is missing the file contains {}.
2. Compare each translation with the template. The generator does not notice a dropped placeholder or a flattened plural, because both are valid messages. This script does:
It reports keys that do not exist in the template, declared placeholders missing from a translation, and plural or select messages that came back as plain sentences. It relies on the placeholders metadata, which is one more reason to declare every placeholder.
3. Check plural categories per language. Neither check above knows that Polish needs few and many. Either test the boundary numbers in widget tests, as in Part 7, or use a translation tool that checks the categories against the CLDR rules for each language. Automated localization QA covers which checks can run without a person.
When you prompt a model yourself, send it the messages and the descriptions, never the whole file. Write the result back by key. Then the@entries, the keys and@@localecannot be translated, because the model never saw them as text to translate.

Part 9: keeping ARB files in sync, and CI
Translations go stale on the first commit that adds an English string. Three habits keep the files aligned:
- One source of truth. Only the template is edited by hand. Target files are written by translators or by a tool.
- Delete with the template. When a key leaves
app_en.arb, remove it from every other file in the same commit. The check script reports the leftovers. - Fail the build on a gap. A missing translation should stop a pull request, not reach a release.
A GitHub Actions job that enforces all three:
subosito/flutter-action is a community action, not a Flutter project. If your team translates after merge, not before, move the untranslated check to the release workflow so feature branches are not blocked on translators. Localization as code describes that trade in more detail.
The store listing is not in the ARB files
The app name, the description and the release notes on the stores are separate text with hard limits, and they are what a user reads before installing.
| Field | Limit |
|---|---|
| Google Play app name | 30 characters |
| Google Play short description | 80 characters |
| Google Play full description | 4,000 characters |
| App Store promotional text | 170 characters |
| App Store description | 4,000 characters |
| App Store keywords | 100 bytes |
| App Store "What's New" | 4,000 characters |
The App Store keyword limit is stated in bytes, not characters, so a keyword list in a script that takes more than one byte per character holds fewer characters than one in English. Write the short fields for each language instead of translating them word for word, and count before you submit.
gen_l10n and the alternatives, by fit
gen_l10n is the approach in Flutter's own documentation. It is not the only one.
| Approach | Files | How you read a string | Fits |
|---|---|---|---|
gen_l10n (Flutter SDK) | ARB | AppLocalizations.of(context).greeting('Ada'), generated and typed | Teams that want the documented path, ICU plurals and no third-party dependency |
| slang | JSON, YAML, CSV or ARB | t.login.success, generated and typed | Teams that want nested keys, typed access without a BuildContext, and a built-in dart run slang analyze for missing and unused keys |
| easy_localization | JSON in assets, with CSV, YAML and XML through a loader package | context.tr('title') or 'title'.tr(), looked up by string at runtime | Apps that want context.setLocale and a saved language choice without writing them, and accept keys that are not checked at compile time by default |
intl_translation | ARB extracted from Intl.message calls in Dart | Dart functions | Existing codebases already written this way |
Two questions decide it for most teams. Do you want a wrong key to be a compile error? Then pick a generated approach. Do translators or tools need a widely supported file format? ARB and plain JSON are read by most localization tools, so check the format list of any tool before you commit to a file layout. The alternatives were read on their package pages for this guide, not benchmarked.
Doing this with Transglot
Transglot is a continuous localization platform. It reads and writes Flutter ARB as the format flutter_arb. Glossa, its translation engine, translates the strings that changed, and four checks run on every string before it is written: placeholders, plural forms, glossary terms and length. A string that fails the placeholder, plural or glossary check is repaired once. If it still fails, it is refused and reported instead of written.
From the project root, with Node.js 22 or later installed:
init finds the ARB files, works out the source language, signs in through the browser, runs the first translation and writes transglot.json. For the layout in this guide the file looks like this:
After that, transglot push --wait uploads changed strings and waits for the translation, and transglot pull writes the target files. The configuration reference explains each field, and the GitHub Action runs the same round trip on every push to main.
Limits that matter for a Flutter project, from the Flutter ARB format page:
- Keep the template yours. Only
descriptionis read from@keymetadata.placeholdersdeclarations are not exported, so pull the target locales only, as the config above does, and editapp_en.arbby hand. - Name the plural variable
count. Plural keys are exported as{count, plural, ...}whatever the variable was called on import. - Use category names for plurals. A message with
oneandotheris stored as a plural key with one form per category the language needs. A message that uses exact selectors such as=0, and everyselectmessage, is stored as a plain string and written back as imported. - Untranslated keys are left out of an exported file, so the
gen-l10nuntranslated report still does its job. - No over-the-air updates for Flutter. The runtime SDKs are JavaScript only. A Flutter app ships its strings in the build.
- The command line starts on a paid plan. The Free plan works in the browser console. The CLI, the GitHub Action and the API start on Starter, at $19 a month for 300,000 translated words. Transglot is not self-hostable.
Store listings are handled by separate connectors for App Store Connect and Google Play. If you are comparing localization platforms, check each one's format list for ARB first.
Common mistakes
- Importing
package:flutter_gen. The synthetic package was replaced in Flutter 3.32. Import the generated file from your source tree. - Forgetting
generate: true. Without it nothing is generated andAppLocalizationsdoes not exist. - Calling
AppLocalizations.of(context)aboveMaterialApp. UseonGenerateTitlefor the title. - Building sentences from fragments.
'Hello ' + nameand"{count} " + labelcannot be reordered by a translator. - Copying the English plural shape.
oneandotherare not enough for Polish, Russian or Arabic. - Letting metadata reach the translator.
@keys and ICU keywords come back translated. - Formatting dates and prices by hand.
'$day/$month/$year'is wrong in most of the world. - Left and right in layout code. Use
startandend. - Skipping the Xcode localization list. The App Store then lists the app in one language.
- Treating the store listing as done. It is separate text with separate limits.
Checklist
Frequently asked questions
How do I add localization to a Flutter app?
Add flutter_localizations and intl, set generate: true in pubspec.yaml, create l10n.yaml, and write your strings in lib/l10n/app_en.arb. Flutter generates an AppLocalizations class. Register AppLocalizations.localizationsDelegates and AppLocalizations.supportedLocales on MaterialApp, then read strings with AppLocalizations.of(context).
What is an ARB file in Flutter?
ARB stands for Application Resource Bundle. It is a JSON file with one entry per string, plus optional @key entries that hold a description and the placeholder types. Flutter's gen_l10n tool reads one template ARB file and one file per translated language.
What is the difference between flutter_localizations and intl?
flutter_localizations translates Flutter's own widgets, such as date pickers and button labels, and supplies the delegates that MaterialApp needs. intl formats dates, numbers and currency and applies plural rules. A localized app uses both.
How do I change the language in a Flutter app without restarting?
Set the locale property of MaterialApp from state and rebuild. A ValueNotifier<Locale?> above the app is enough: assigning a new locale rebuilds the app in that language, and null goes back to the device language.
How do plurals work in Flutter?
Plurals are written in ICU message syntax in the ARB value, for example {count, plural, one{{count} item} other{{count} items}}, with count declared as an int placeholder. Each language file supplies the categories that language uses. Polish needs one, few, many and other. Arabic needs six.
Is easy_localization better than gen_l10n?
They fit different needs. gen_l10n is the documented Flutter approach and produces typed code, so a wrong key fails at compile time. easy_localization looks keys up by string at runtime and ships with locale switching and a saved language choice. This guide did not benchmark either.
Can I use AI to translate ARB files?
Yes, with checks. A model can translate placeholders, ICU keywords or @ metadata keys, and it tends to copy the English plural shape into languages that need more forms. Run flutter gen-l10n, compare placeholders against the template, and test plural boundaries before you ship.
Does Flutter support right to left languages?
Yes. With the flutter_localizations delegates registered, Arabic and Hebrew locales set the text direction, and widgets that respect Directionality mirror. Layout written with left and right does not mirror, so use EdgeInsetsDirectional and AlignmentDirectional.
How this guide was checked
- Setup,
l10n.yamloptions, ARB placeholders, number and date formats, plurals, selects, escaping, locale resolution and the iOS step follow the Flutter internationalization page for Flutter 3.50, linked under Sources. - The removal of
package:flutter_genfollows Flutter's breaking change notice. The generated memberslocalizationsDelegatesandsupportedLocales, the accepted plural cases and the{}content of an empty untranslated report were read in thegen_l10nsource on the Flutter stable branch. NumberFormat,DateFormatandBidiFormatterfollow theintl0.20.3 package documentation. Plural categories follow the Unicode CLDR plural rules chart.tool/check_arb.dartandtool/pseudo_arb.dartwere run with the Dart SDK against sample ARB files, including a broken Polish file, and behaved as described.- Not tested: the Flutter and widget test samples were written to the documentation and were not compiled against a Flutter project for this guide. The CI workflow was not run. Run them in your project before relying on them.
- slang and easy_localization were read on their pub.dev pages. They and the other platforms named were not benchmarked, so this guide makes no claim about which works best.
- Store limits are the ones Google and Apple publish on the linked pages. The App Store name and subtitle limits are not on the page that was read, so they are left out.
- Transglot statements follow the Transglot documentation.
Sources
- Flutter: Internationalizing Flutter apps
- Flutter: Localized messages are generated into source, not a synthetic package
- Flutter API: MaterialApp
- Flutter API: WidgetsApp.localeResolutionCallback
- Flutter API: Directionality
- Flutter API: EdgeInsetsDirectional
- Flutter API: AlignmentDirectional
- Flutter API: Text
- Flutter API: WidgetTester.takeException
- Flutter source: gen_l10n.dart on the stable branch
- intl package
- intl: NumberFormat class
- Application Resource Bundle specification
- Unicode CLDR: language plural rules
- slang on pub.dev
- easy_localization on pub.dev
- subosito/flutter-action
- Google Play: Create and set up your app listing
- App Store Connect: Platform version information
- Transglot: Flutter ARB format
- Transglot: quality checks
- Transglot: plural forms
- Transglot quickstart
- Transglot pricing