flutter-localization

Implements Flutter app localization using the gen-l10n pipeline with ARB message files.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill flutter-localization-22teikk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-localization
Source: https://github.com/22Teikk/22Teikk-Agent-Skills-Hub/tree/main/packs/flutter/skills/flutter-localization
Command: npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill flutter-localization-22teikk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding multi-language support to a Flutter app involves many error-prone details: pubspec dependency pinning, ARB message syntax, ICU plurals, delegate wiring, and localized widget testing. This Skill provides the complete official gen-l10n workflow so nothing is missed. ## Core Features & Use Cases - gen-l10n Setup: Configures pubspec.yaml with flutter_localizations and intl: any, plus l10n.yaml with synthetic-package disabled and a committed output directory. - ARB Authoring: Creates template and per-locale ARB files with typed placeholders, ICU plural rules, and DateTime/number formats. - MaterialApp Wiring & Testing: Connects generated AppLocalizations delegates and supportedLocales, handles RTL locales, and writes widget tests that assert translated strings. - Use Case: You need to add Vietnamese and French to an English-only Flutter app. The Skill walks you through creating app_vi.arb and app_fr.arb, running flutter gen-l10n, and verifying each locale in a widget test. ## Quick Start Add localization to my Flutter app with English and Vietnamese using the official gen-l10n pipeline and wire it into MaterialApp.

Frequently Asked Questions about flutter-localization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add localization to a Flutter app?▼

Add flutter_localizations (sdk) and intl: any to pubspec.yaml, set flutter: generate: true, create an l10n.yaml pointing at your ARB directory, then run flutter gen-l10n. Wire the generated AppLocalizations delegates and supportedLocales into MaterialApp.

gen-l10n vs easy_localization for Flutter apps?▼

gen-l10n generates typed, compile-time-checked accessors from ARB files with IDE autocomplete and ICU plural support. easy_localization loads JSON at runtime with string-key tr() lookups that break silently on typos, so it suits prototypes only.

Why does flutter pub get fail with an intl version conflict?▼

The Flutter SDK exact-pins the intl version used by flutter_localizations, so declaring your own caret pin like intl: ^0.20.2 causes version solving to fail. Declare intl: any in pubspec.yaml instead.

How do I handle plurals in Flutter ARB files?▼

Use ICU MessageFormat syntax in the ARB value, such as {count, plural, =0{No items} other{{count} items}}, with a @key metadata block declaring the placeholder type. The generator compiles it to an Intl.plural call with correct per-locale rules.

How do I test localized Flutter widgets?▼

Wrap the widget under test in a MaterialApp that provides AppLocalizations.localizationsDelegates, supportedLocales, and an explicit locale. Assert against the translated string, not the English default, to prove the locale's ARB file actually resolves.

When should I not use gen-l10n for Flutter localization?▼

Do not use it for Android XML string resources, which belong to the native Android localization flow. It is also unnecessary for quick prototypes where runtime JSON loading is acceptable, though gen-l10n has similar setup cost.