flutter-localization

Installation
Summary

Configure Flutter apps to support multiple languages and locales with proper i18n setup.

  • Manages dependency injection (flutter_localizations, intl), code generation configuration (l10n.yaml), and .arb translation file creation with support for placeholders, plurals, and regional variants
  • Configures root widget delegates (MaterialApp, CupertinoApp, or WidgetsApp) and handles isolated widgets like TextField and CupertinoTabBar that require explicit Localizations wrapping
  • Supports complex locales using Locale.fromSubtags for multi-script languages (e.g., Chinese zh_Hans_CN) and includes iOS Xcode project configuration for App Store locale exposure
  • Prevents common assertion errors by ensuring proper localization delegate hierarchy and validates generated code with flutter gen-l10n
SKILL.md

Flutter Localization Setup

Goal

Configures and implements internationalization (i18n) and localization (l10n) in a Flutter application. This skill manages dependency injection (flutter_localizations, intl), code generation configuration (l10n.yaml), root widget setup (MaterialApp, CupertinoApp, or WidgetsApp), .arb translation file management, and platform-specific configurations (iOS Xcode project updates). It ensures proper locale resolution and prevents common assertion errors related to missing localization delegates in specific widgets like TextField and CupertinoTabBar.

Decision Logic

  1. Determine App Root: Identify if the application uses MaterialApp, CupertinoApp, or WidgetsApp to inject the correct global delegates.
  2. Identify Target Platforms: If iOS is a target platform, Xcode project files (Info.plist / project.pbxproj) must be updated to expose supported locales to the App Store.
  3. Analyze Widget Tree: Check for isolated TextField or CupertinoTabBar widgets that might exist outside the root app's localization scope. If found, wrap them in explicit Localizations widgets.
  4. Determine Locale Complexity: If supporting languages with multiple scripts/regions (e.g., Chinese zh_Hans_CN), use Locale.fromSubtags instead of the default Locale constructor.

Instructions

  1. Configure Dependencies Update pubspec.yaml to include required packages and enable code generation.
    dependencies:
      flutter:
        sdk: flutter
      flutter_localizations:
    
Related skills
Installs
994
Repository
flutter/skills
GitHub Stars
1.9K
First Seen
Mar 4, 2026