utsavsavani08/rain-skill-main/flutter-setup-localization

Claude Code and agent skill by utsavsavani08/rain-skill-main

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Flutter localization and internationalization (i18n/l10n) expert. Load for any Flutter localization work — ARB files, flutter_localizations, intl package, plurals, placeholders, language switching, and locale configuration. Triggers on: localization, localizations, intl, arb, flutter_localizations, l10n, i18n, AppLocalizations, translate, multi-language.

Install

npx vskill@latest install utsavsavani08/rain-skill-main/flutter-setup-localization

SKILL.md

The same SKILL.md was published earlier as utsavsavani08/rain-skill-main/flutter-setup-localization.

Flutter Localization — i18n & l10n Setup

Full internationalization support using flutter_localizations, intl, and ARB-based code generation.

Mandatory checkpoint (before any localization work)

🌐 LOCALIZATION CHECKPOINT:
Languages needed: [ list all ]
ARB dir exists: [ lib/l10n/ ]
generate flag set: [ pubspec.yaml → flutter.generate: true ]
l10n.yaml exists: [ project root ]
MaterialApp updated: [ delegates + supportedLocales ]

Setup workflow

Step 1 — Add dependencies
yaml
# pubspec.yaml
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.19.0
flutter:
generate: true # enables code generation
Step 2 — Create l10n.yaml at project root
yaml
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
Step 3 — Create ARB template file

lib/l10n/app_en.arb:

json
{
"@@locale": "en",
"appTitle": "My App",
"@appTitle": {
"description": "The application title"
},
"welcomeMessage": "Welcome, {name}!",
"@welcomeMessage": {
"description": "Welcome message with user name",
"placeholders": {
"name": {
"type": "String",
"example": "Alice"
}
}
},
"itemCount": "{count, plural, =0{No items} =1{One item} other{{count} items}}",
"@itemCount": {
"description": "Item count with plural support",
"placeholders": {
"count": {
"type": "int"
}
}
}
}
Step 4 — Configure MaterialApp
dart
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
MaterialApp(
title: 'My App',
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const [
Locale('en'),
Locale('es'),
Locale('fr'),
],
home: const HomeScreen(),
)
Step 5 — Use in widgets
dart
// Access localized strings
Text(AppLocalizations.of(context)!.appTitle)
Text(AppLocalizations.of(context)!.welcomeMessage('Alice'))
Text(AppLocalizations.of(context)!.itemCount(3))

Adding a new language

  1. Create lib/l10n/app_<locale>.arb (e.g., app_es.arb)
  2. Translate all keys — do not include @-prefixed metadata keys
  3. Add Locale('es') to supportedLocales
  4. Run flutter gen-l10n or flutter pub get to regenerate
json
{
"@@locale": "es",
"appTitle": "Mi Aplicación",
"welcomeMessage": "¡Bienvenido, {name}!",
"itemCount": "{count, plural, =0{Sin elementos} =1{Un elemento} other{{count} elementos}}"
}

Advanced patterns

Runtime locale switching
dart
// State management approach (Riverpod)
@riverpod
class LocaleNotifier extends _$LocaleNotifier {
@override
Locale build() => const Locale('en');
void setLocale(Locale locale) => state = locale;
}
// In MaterialApp
MaterialApp(
locale: ref.watch(localeNotifierProvider),
// ...
)
Locale-aware date/number formatting
dart
import 'package:intl/intl.dart';
// Date formatting
final formatter = DateFormat.yMMMMd(Localizations.localeOf(context).toString());
Text(formatter.format(DateTime.now()))
// Number formatting
final numFormatter = NumberFormat.currency(
locale: Localizations.localeOf(context).toString(),
symbol: '\$',
);
Text(numFormatter.format(1234.56))
Gender/select strings
json
{
"genderGreeting": "{gender, select, male{Hello Mr. {name}} female{Hello Ms. {name}} other{Hello {name}}}",
"@genderGreeting": {
"placeholders": {
"gender": { "type": "String" },
"name": { "type": "String" }
}
}
}

File structure

lib/
├── l10n/
│ ├── app_en.arb # template (source of truth)
│ ├── app_es.arb
│ └── app_fr.arb
├── flutter_gen/ # auto-generated — DO NOT edit
│ └── gen_l10n/
│ └── app_localizations.dart

Common errors and fixes

ErrorCauseFix
AppLocalizations not foundgenerate: true missingAdd to pubspec.yaml under flutter:
Null check on null from .of(context)!delegate not registeredAdd AppLocalizations.delegate to localizationsDelegates
Missing translation keyARB files out of syncAdd the key to all ARB files
flutter gen-l10n failsMalformed ARB JSONValidate JSON syntax in ARB files
Locale not switchinglocale: not wired to stateBind MaterialApp.locale to state notifier

Hard rules

  1. Never hardcode user-facing strings — every string goes in ARB.
  2. `app_en.arb` is the template — all other ARBs must have the same keys.
  3. Never edit generated files under flutter_gen/ — regenerate instead.
  4. Always provide `@metadata` for strings with placeholders/plurals.
  5. Use `Locale('en')` not `Locale('en', 'US')` unless country-specific variants are required.
  6. Run `flutter analyze` after generating to catch missing keys.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/utsavsavani08/rain-skill-main/flutter-setup-localization/badge)](https://verified-skill.com/skills/utsavsavani08/rain-skill-main/flutter-setup-localization)

Something wrong with this skill or its page? Tell us.