Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

flutter-setup-localization — Claude Code skill: Flutter localization

This skill automates initialization of multi-language support in Flutter projects. It adds dependencies, enables code generation, and creates a configuration file for .arb-based translations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add flutter/agent-plugins --skill flutter-setup-localization -a claude-code
Open on GitHub

What flutter-setup-localization does

The skill sets up localization infrastructure in a few steps: adds flutter_localizations and intl packages, enables the generate: true flag in pubspec.yaml, and creates l10n.yaml with compilation parameters. Afterward, the project is ready to define translations via .arb files and generate a type-safe AppLocalizations class.

It includes a complete workflow: from adding dependencies to configuring MaterialApp with localization delegates and supported locales. The skill covers both straightforward cases (plain strings) and advanced ones: placeholders, pluralization (plural), conditional selection (select) with .arb syntax examples.

The file structure is fixed: arb-dir: lib/l10n, template-arb-file: app_en.arb, synthetic-package: true. If your layout differs, you'll need to adjust the paths manually.

What it helps with

  • prepare a Flutter project for multi-language support
  • create a configuration structure for generating localized strings
  • add localization delegates and supported locales to the app entry point
  • configure .arb files with placeholders and pluralization rules
  • generate a type-safe AppLocalizations class for accessing translations

Example prompts for the agent

  • Initialize localization in a new Flutter project
  • Set up language support before the first release
  • Generate localization classes after adding `.arb` files

How to install flutter-setup-localization

1Skills CLI (Vercel)

npx skills add flutter/agent-plugins --skill flutter-setup-localization -a claude-code

2Manually: put the files in place

~/.claude/skills/flutter-setup-localization/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/flutter-setup-localization/

From the same set14

The whole set →
flutter-apply-architecture-best-practices flutter This skill structures Flutter apps around UI, Logic, and Data layers. Use it when starting a project or refactoring code for scale. Claude Code CX Codex Cursor +1 43,000installs flutter-build-responsive-layout flutter This skill guides coding agents to build adaptive Flutter UIs across mobile and desktop screens using LayoutBuilder and BoxConstraints. Claude Code CX Codex Cursor +1 42,300installs flutter-add-widget-test flutter A skill that teaches AI coders to write component-level Flutter tests using WidgetTester. Verifies how widgets render and respond to taps, scrolling, and text input. Claude Code CX Codex Cursor +1 39,000installs flutter-add-integration-test flutter Sets up the integration_test package for Flutter and turns MCP session interactions into repeatable end-to-end tests. Claude Code CX Codex Cursor +1 38,000installs flutter-setup-declarative-routing flutter Sets up Flutter routing with go_router, including URL-based screens, nested navigation, and deep links for web and mobile apps. Claude Code CX Codex Cursor +1 37,600installs flutter-implement-json-serialization flutter Teaches coding agents to build Dart models with fromJson and toJson methods using dart:convert. Useful for manual JSON mapping in simple Flutter data structures. Claude Code CX Codex Cursor +1 37,200installs flutter-add-widget-preview flutter Configures interactive Flutter widget previews with package:flutter/widget_previews.dart. Useful for testing UI components in isolation without launching the whole app. Claude Code CX Codex Cursor +1 36,600installs flutter-use-http-package flutter This skill shows how to send GET, POST, PUT, and DELETE requests with Flutter's http package and handle JSON responses. Use it when an app needs to read from or write to a REST API. Claude Code CX Codex Cursor +1 36,000installs

Similar

msstore-cli official github Manages Windows app publishing in Microsoft Store through msstore and Partner Center. Use it for submissions, release status checks, and CI/CD publishing. GitHub Copilot 7,000installs expo-module expo Complete reference for building native modules and view components in Swift, Kotlin, and TypeScript for Expo apps. Use when writing a new module or adding native functionality—camera, sensors, system APIs. Claude Code CX Codex Cursor +1 44,900installs firebase-ai-logic-basics Google LLC Integrates Firebase AI Logic into Android, iOS, Web, and Flutter client apps. Helps configure direct Gemini API calls, streaming, and multimodal inputs. Claude Code CX Codex Cursor +1 135,300installs react-native-design Seth Hobson This skill guides React Native styling, navigation, and Reanimated animations. Use it when building cross-platform mobile apps or platform-specific screens. Claude Code CX Codex Cursor 15,522installs vercel-react-native-skills vercel A rules pack for React Native and Expo work: lists, animations, navigation, native modules. Load it so your agent makes mobile changes the same way every time. Claude Code CX Codex Cursor +1 253,900installs animate-expo emilkowalski Builds React Native and Expo animations using Reanimated and Gesture Handler. Helps keep motion on the UI thread and avoid dropped frames on physical devices. Claude Code CX Codex Cursor +1 135,900installs mobile-native emilkowalski Strips the tells that give a web app away on a phone: sticky hover, tap highlight flash, the 100vh bug. Claude Code CX Codex Cursor +1 84,500installs aso coreyhaines31 Audits App Store and Google Play listings against store optimization standards. Helps uncover gaps in metadata, visual assets, and conversion. Claude Code CX Codex Cursor +1 74,900installs

Questions about flutter-setup-localization

How do I install flutter-setup-localization?

For Claude Code, run npx skills add flutter/agent-plugins --skill flutter-setup-localization -a claude-code, then open ~/.claude/skills/flutter-setup-localization/SKILL.md. For other platforms, change the -a flag to codex, cursor, gemini-cli, or opencode and use the corresponding skill file path.

What does flutter-setup-localization do?

The skill automates initial multi-language setup: it adds required packages, creates a config file, and shows how to wire localization into your app. After that, you fill in .arb files with translations and run code generation.

What do I need for this skill to work?

An active Flutter project with a pubspec.yaml file. The skill assumes a standard structure: lib/l10n/ for .arb files, though you can redefine paths in l10n.yaml.

Source text

SKILL.md · BSD-3-Clause
---
name: flutter-setup-localization
description: 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.
metadata:
  model: models/gemini-3.1-pro-preview
  last_modified: Tue, 21 Apr 2026 21:27:35 GMT
---
# Internationalizing Flutter Applications

## Contents
- [Core Concepts](#core-concepts)
- [Setup Workflow](#setup-workflow)
- [Implementation Workflow](#implementation-workflow)
- [Advanced Formatting](#advanced-formatting)
- [Examples](#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 `generate` flag.
  - [ ] 3. Create the `l10n.yaml` configuration file.
  - [ ] 4. Configure `MaterialApp` or `CupertinoApp`.

### 1. Add Dependencies
Add the required localization packages to the project. Execute the following commands in the terminal:
```bash
flutter pub add flutter_localizations --sdk=flutter
flutter pub add intl:any
```

Verify your `pubspec.yaml` includes the following under `dependencies`:
```yaml
dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  intl: any
```

### 2. Enable Code Generation
Open `pubspec.yaml` and enable the `generate` flag within the `flutter` section to automate localization tasks:
```yaml
flutter:
  generate: true
```

### 3. 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:
```yaml
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
synthetic-package: true
```

### 4. 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`.

```dart
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 `.arb` files and update the values.

```json
{
  "helloWorld": "Hello World!",
  "@helloWorld": {
    "description": "The conventional newborn programmer greeting"
  }
}
```

Create corresponding files for other locales (e.g., `app_es.arb`):
```json
{
  "helloWorld": "¡Hola Mundo!"
}
```

### 2. Generate Localization Classes
Run the following command to trigger code generation:
```bash
flutter pub get
```
*Feedback 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`.

```dart
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.
```json
"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.
```json
"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.
```json
"pronoun": "{gender, select, male{he} female{she} other{they}}",
"@pronoun": {
  "description": "A gendered message",
  "placeholders": {
    "gender": {
      "type": "String"
    }
  }
}
```

## Examples

### Complete `l10n.yaml`
```yaml
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
synthetic-package: true
use-escaping: true
```

### Complete Widget Implementation
```dart
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)),
      ],
    );
  }
}
```

© flutter · BSD-3-Clause · flutter/agent-plugins

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor