flutter-setup-localization
Skill8 starsChanged 7 days agoMITView on GitHub
Add `flutter_localizations` and `intl` dependencies, enable "generate true" in `pubspec.yaml`, and create an `l10n.yaml` configuration file. Use when initializing localization support for a new Flutter project.
4 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- zhouycheng/skillsword for word, first seen Oct 13, 2026
- flutter/skillsword for word, first seen Oct 8, 2026
- deretame/Breezeedited, first seen Oct 8, 2026
- hjdspace/SpaceCodeword for word, first seen Jul 21, 2026
Other versions4 projects use a version of this.
Word for word · 3
- flutter/skills★ 3.2k100% same
- hjdspace/SpaceCode★ 4100% same
- zhouycheng/skills★ 1100% same
Edited · 1
- deretame/Breeze★ 3k100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- Control CenterAGENTS.md
- clean-ddd-hexagonalSkill
- design-taste-frontendSkill
- flutter-add-integration-testSkill
- flutter-add-widget-previewSkill
- flutter-add-widget-testSkill
- flutter-apply-architecture-best-practicesSkill
- flutter-build-responsive-layoutSkill
- flutter-fix-layout-issuesSkill
- flutter-implement-json-serializationSkill
- flutter-setup-declarative-routingSkill
- flutter-use-http-packageSkill
- full-output-enforcementSkill
- gpt-tasteSkill
- high-end-visual-designSkill
- imagegen-frontend-mobileSkill
- imagegen-frontend-webSkill
- image-to-codeSkill
- impeccableSkill
- minimalist-uiSkill
- redesign-existing-projectsSkill
- security-reviewSkill
- seo-aeo-best-practicesSkill
- seo-auditSkill
- translate-manualSkill
- unslop-textSkill
- version-bumpSkill
- impeccableSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Add the required localization packages to the project.
- Very specific: line 37
Verify your pubspec.yaml includes the following under dependencies:
- Very specific: line 55
Create a new file named l10n.yaml in the root directory of the Flutter project.
- Very specific: line 64
Import the generated localizations and the flutter_localizations library in your main.dart.
- Distinctive: line 88
Follow this workflow when adding or modifying localized content.
- Very specific: line 91
If creating NEW content: Add the base string to the template file (lib/l10n/app_en.arb).
- Very specific: line 103
Create corresponding files for other locales (e.g., app_es.arb):
- Distinctive: line 111
Run the following command to trigger code generation:
- Distinctive: line 126
Use placeholders for dynamic data, plurals, and conditional selects.
- Very specific: line 144
Use the plural syntax to handle quantity-based string variations.
- Very specific: line 159
Use the select syntax for conditional strings, such as gendered text.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Internationalizing Flutter Applications
Contents
- Core Concepts
- Setup Workflow
- Implementation Workflow
- Advanced Formatting
- Examples
Core Concepts
Flutter handles internationalization (i18n) and localization (l10n) via the flutter_localizations and intl packages. The standard approach uses App Resource Bundle (.arb) files to define localized strings, which are then compiled into a generated AppLocalizations class for type-safe access within the widget tree.
Setup Workflow
Copy and track this checklist when initializing internationalization in a Flutter project:
- Task Progress
- 1. Add dependencies to
pubspec.yaml. - 2. Enable the
generateflag. - 3. Create the
l10n.yamlconfiguration file. - 4. Configure
MaterialApporCupertinoApp.
- 1. Add dependencies to
1. Add Dependencies
Add the required localization packages to the project. Execute the following commands in the terminal:
flutter pub add flutter_localizations --sdk=flutter
flutter pub add intl:anyVerify your pubspec.yaml includes the following under dependencies:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: any2. Enable Code Generation
Open pubspec.yaml and enable the generate flag within the flutter section to automate localization tasks:
flutter:
generate: true3. Create Configuration File
Create a new file named l10n.yaml in the root directory of the Flutter project. Define the input directory, template file, and output file:
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
synthetic-package: true4. Configure the App Entry Point
Import the generated localizations and the flutter_localizations library in your main.dart. Inject the delegates and supported locales into your MaterialApp or CupertinoApp.
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; // Adjust path if synthetic-package is false
// ... inside build method
return MaterialApp(
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const [
Locale('en'), // English
Locale('es'), // Spanish
],
home: const MyHomePage(),
);Implementation Workflow
Follow this workflow when adding or modifying localized content.
1. Define ARB Files
- If creating NEW content: Add the base string to the template file (
lib/l10n/app_en.arb). Include a description for context. - If EDITING existing content: Locate the key in all supported
.arbfiles and update the values.
{
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "The conventional newborn programmer greeting"
}
}Create corresponding files for other locales (e.g., app_es.arb):
{
"helloWorld": "¡Hola Mundo!"
}2. Generate Localization Classes
Run the following command to trigger code generation:
flutter pub getFeedback Loop: Run validator -> review terminal output for ARB syntax errors -> fix missing commas or mismatched placeholders -> re-run flutter pub get.
3. Consume Localized Strings
Access the localized strings in your widget tree using AppLocalizations.of(context). Ensure the widget calling this is a descendant of MaterialApp.
Text(AppLocalizations.of(context)!.helloWorld)Advanced Formatting
Use placeholders for dynamic data, plurals, and conditional selects.
Placeholders
Define parameters within curly braces and specify their type in the metadata object.
"hello": "Hello {userName}",
"@hello": {
"description": "A message with a single parameter",
"placeholders": {
"userName": {
"type": "String",
"example": "Bob"
}
}
}Plurals
Use the plural syntax to handle quantity-based string variations. The other case is mandatory.
"nWombats": "{count, plural, =0{no wombats} =1{1 wombat} other{{count} wombats}}",
"@nWombats": {
"description": "A plural message",
"placeholders": {
"count": {
"type": "num",
"format": "compact"
}
}
}Selects
Use the select syntax for conditional strings, such as gendered text.
"pronoun": "{gender, select, male{he} female{she} other{they}}",
"@pronoun": {
"description": "A gendered message",
"placeholders": {
"gender": {
"type": "String"
}
}
}Examples
Complete l10n.yaml
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
synthetic-package: true
use-escaping: trueComplete Widget Implementation
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class GreetingWidget extends StatelessWidget {
final String userName;
final int notificationCount;
const GreetingWidget({
super.key,
required this.userName,
required this.notificationCount,
});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
return Column(
children: [
Text(l10n.hello(userName)),
Text(l10n.nWombats(notificationCount)),
],
);
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

