How to Add Localization in Flutter: Multi-Language Apps

How to add localization in Flutter with gen-l10n: ARB files, l10n.yaml, runtime language switching, plurals, and gen-l10n vs easy_localization.

Every app that grows beyond one market hits the same wall: hardcoded English strings scattered across widgets. Retrofitting translations later is painful — which is why learning how to add localization in flutter early, with the official gen-l10n tooling, pays for itself many times over. This is a complete flutter localization tutorial using the modern, official approach: ARB files as the source of truth, l10n.yaml for configuration, generated type-safe Dart code, a runtime language switcher with persistence, and ICU plurals. We will also settle the gen-l10n vs easy_localization question so you can pick with confidence. What you&#x27;ll learn The official gen-l10n pipeline: flutter_localizations , intl , and generate: true Writing ARB files: @@locale , string keys, descriptions, and placeholders Configuring code generation with l10n.yaml Wiring MaterialApp : delegates, supportedLocales , and locale resolution Flutter change language programmatically — a runtime language switcher that persists ICU plurals in ARB files ( flutter localization plural ) gen-l10n vs easy_localization : which to choose Troubleshooting: flutter gen l10n not working and locale resolution failures How to Add Localization in Flutter: The Full Setup, Step by Step The official pipeline has five moving parts. We will build each one in order, and by Step 5 the app will switch languages at runtime. Step 1 — Dependencies and the generate flag Add the SDK&#x27;s localization package and the intl package: flutter pub add flutter_localizations --sdk=flutter flutter pub add intl Then enable code generation in pubspec.yaml : dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter intl: any flutter: uses-material-design: true generate: true # <-- tells the flutter tool to run gen-l10n on build…

Explore