flutter-setup-localization

Configures Flutter localization with flutter_localizations, intl, and ARB-based code generation.

1|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/sohampawar1866/zeromile-go --skill flutter-setup-localization-sohampawar1866
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: flutter-setup-localization
Source: https://github.com/sohampawar1866/zeromile-go/tree/main/.agents/skills/flutter-setup-localization
Command: npx skills add https://github.com/sohampawar1866/zeromile-go --skill flutter-setup-localization-sohampawar1866

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up internationalization in a Flutter project involves several error-prone manual steps: adding the right dependencies, enabling code generation, creating the l10n.yaml configuration, and wiring delegates into the app entry point. This Skill provides a complete, checklist-driven workflow that gets localization working correctly the first time. ## Core Features & Use Cases - Guided Setup Workflow: Adds flutter_localizations and intl dependencies, enables the generate flag in pubspec.yaml, creates l10n.yaml, and configures MaterialApp or CupertinoApp with localization delegates. - ARB File Management: Defines localized strings in App Resource Bundle files with descriptions, placeholders, plurals, and select expressions, then generates a type-safe AppLocalizations class. - Use Case: You are starting a new Flutter app that must ship in English and Spanish. Use this Skill to scaffold the full localization pipeline, define your first strings in app_en.arb and app_es.arb, and render them via AppLocalizations.of(context) in your widgets. ## Quick Start Set up localization in my Flutter project with English and Spanish support and show me how to display a translated greeting string.

Frequently Asked Questions about flutter-setup-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 the flutter_localizations and intl packages to pubspec.yaml, set generate: true under the flutter section, and create an l10n.yaml file pointing to your ARB directory. Then register AppLocalizations.delegate and the global delegates in your MaterialApp.

How to use ARB files for Flutter translations?

Define strings as key-value pairs in a template ARB file like app_en.arb, with metadata entries prefixed by @ for descriptions and placeholders. Create matching files per locale such as app_es.arb, then run flutter pub get to generate the AppLocalizations class.

How do I handle plurals in Flutter localization?

Use ICU plural syntax inside the ARB value, such as {count, plural, =0{no items} other{{count} items}}, and declare the count placeholder with type num in the metadata. The other case is mandatory for the message to compile.

Why is AppLocalizations.of(context) returning null?

AppLocalizations.of(context) returns null when the calling widget is not a descendant of MaterialApp or when the localization delegates are not registered. Verify localizationsDelegates and supportedLocales are set, and run flutter pub get to regenerate the classes.

Does Flutter localization support dynamic placeholders in strings?

Yes, ARB files support placeholders using curly brace syntax like Hello {userName}, with the parameter type and example declared in the placeholders metadata object. The generated code produces a typed method accepting that parameter.