Flutter l10n.yaml Generator

Build a correct l10n.yaml for Flutter's gen-l10n in seconds. Toggle the options you need, then copy or download a ready-to-use config. Everything runs in your browser — no signup, no upload.

Start from a preset:

Configuration

l10n.yaml

arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
preferred-supported-locales: [en]
nullable-getter: false
synthetic-package: false
format: true

Don't forget your pubspec.yaml

For gen-l10n to run automatically, your pubspec needs these entries:

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  intl: any

flutter:
  generate: true

Then run flutter gen-l10n (or just build the app) to generate AppLocalizations.

Tired of editing .arb files and configs by hand?

FlutterLocalisation manages your whole team's translations, auto-fills missing keys with AI, syncs to Git, and pushes updates over-the-air — no rebuild required.

Start Free →

What is l10n.yaml?

l10n.yaml is the configuration file Flutter's built-in gen-l10n tool reads to turn your .arb translation files into a typed Dart AppLocalizations class. You place it in your project root (next to pubspec.yaml) and Flutter regenerates your localizations on every build when generate: true is set under the flutter: section of pubspec.yaml.

Every l10n.yaml option explained

arbDirDirectory that holds your .arb translation files, relative to the project root. Default: lib/l10n
outputDirDirectory where the generated Dart localization files are written. Defaults to arb-dir when empty.
templateArbFileThe "source of truth" .arb file (usually your English file). Its keys define the generated API. Default: app_en.arb
outputClassName of the generated Dart class you call in your widgets. Default: AppLocalizations
outputLocalizationFileFile name for the generated Dart localizations. Default: app_localizations.dart
preferredSupportedLocalesComma-separated locales to prioritise (e.g. en, es). The first becomes the default fallback.
nullableGetterIf true, AppLocalizations.of(context) returns a nullable value. Set false to get a non-null getter (recommended for new apps).
syntheticPackageDeprecated. In Flutter 3.22+ the synthetic package is being phased out — set false and use an explicit output-dir to import the generated file directly.
useDeferredLoadingLoads each locale lazily via deferred imports. Useful for Flutter web to shrink the initial bundle.
useEscapingLets you escape ICU special characters (like { }) with single quotes in your messages.
relaxSyntaxRelaxes ICU parsing so plain text containing { is not treated as a placeholder.
requiredResourceAttributesForces every resource to have a matching @-attribute (description). Good for enforcing documentation.
formatRuns dart format on the generated files so they match your project style.
suppressWarningsSilences gen-l10n warnings. Use sparingly.
headerA header comment prepended to every generated file (e.g. a license notice).

Frequently asked questions

What is l10n.yaml in Flutter?

l10n.yaml is the configuration file Flutter's gen-l10n tool reads to generate localization code from your .arb files. You place it in your project root and run `flutter gen-l10n` (or `flutter pub get` / build) to generate the AppLocalizations class. It controls where your .arb files live, the generated class name, the output location, and behaviour like deferred loading.

Where do I put the l10n.yaml file?

Place l10n.yaml in the root of your Flutter project (the same folder as pubspec.yaml). The gen-l10n tool automatically picks it up.

Why is synthetic-package being removed?

Older Flutter versions generated localizations into a synthetic package you imported with `package:flutter_gen/gen_l10n/app_localizations.dart`. Flutter 3.22+ deprecates this in favour of generating into a real directory you control. Set synthetic-package: false and an explicit output-dir, then import the file by its real path.

Do I still need the intl package?

Yes. Add flutter_localizations (SDK) and intl to your dependencies, and enable generate: true under the flutter: section of pubspec.yaml so gen-l10n runs automatically.

How do I regenerate after editing an .arb file?

Run `flutter gen-l10n` manually, or simply run/build the app — with generate: true the localizations are regenerated automatically on each build.

Related Flutter localization tools