Skip to content

flutter_l10n Free

A Mason brick for generating a Flutter localization package using Slang, with shared locale state management for scoped localization across features.

Version: 1.0.0

Variables

VariableTypeDefaultDescription
appNamestringMyAppApplication name for package naming
prefixstringAppPrefix for component naming
isForMonorepobooleantrueWhether this package will be part of a monorepo structure
includeGeneratedbooleanfalseWhether to include generated files in version control

Usage

Interactive

bash
archipelago generate flutter_l10n

Non-interactive (CI)

bash
archipelago generate flutter_l10n --config my_config.json

Config Template

json
{
  "@appName": "Application name for package naming",
  "appName": "MyApp",
  "@prefix": "Prefix for component naming",
  "prefix": "App",
  "@isForMonorepo": "Whether this package will be part of a monorepo structure",
  "isForMonorepo": true,
  "@includeGenerated": "Whether to include generated files in version control",
  "includeGenerated": false
}

Generated Structure

shared/
└── locale_core/
    ├── lib/
    │   ├── locale_core.dart               # Barrel file
    │   └── src/
    │       ├── {prefix}_locale.dart        # Locale definitions
    │       └── locale_state.dart           # Shared locale state management
    ├── analysis_options.yaml
    ├── pubspec.yaml
    └── README.md

Built by Banua Coder