flutter_localisation 2.0.0 copy "flutter_localisation: ^2.0.0" to clipboard
flutter_localisation: ^2.0.0 copied to clipboard

A command-line tool for generating localization files for different flavors.

Flutter Localization Tool #

This project is a Dart-based localization tool tailored for Flutter Localization SaaS users. It handles ARB files and generates the corresponding Dart localization classes efficiently.

Features #

  • Parses ARB localization files
  • Generates strongly typed localization classes for Flutter
  • Supports flavor-based localization structure
  • Git integration (GitHub, GitLab, Bitbucket)

Installation #

  1. Activate the package globally:
dart pub global activate flutter_localisation
  1. Ensure the Dart bin directory is in your system’s PATH:

Add the following to your shell config file (e.g., .bashrc or .zshrc):

export PATH="$PATH":"$HOME/.pub-cache/bin"

Project Setup #

Before generating localization files:

  1. Link your project to a Git repository (GitHub, GitLab, or Bitbucket).
  2. Clone the ARB file repository into your Flutter project directory.

Usage #

Generate Localization Files #

Run the following command to generate localization code for a specific flavor:

flutter_localisation [arb_directory] [flavor]

Example:

flutter_localisation myArbs usa

Flutter Project Setup #

  1. Add dependencies:
flutter pub add flutter_localizations --sdk=flutter
flutter pub add intl:any
  1. Enable code generation in pubspec.yaml:
flutter: 
  generate: true

Integrate in Your Flutter App #

In your MaterialApp widget:

MaterialApp(
  title: 'Localizations Sample App',
  localizationsDelegates: AppLocalizations.localizationsDelegates,
  supportedLocales: AppLocalizations.supportedLocales,
)

Example usage in AppBar:

appBar: AppBar(
  title: Text(AppLocalizations.of(context)!.helloWorld),
),
1
likes
150
points
87
downloads

Publisher

unverified uploader

Weekly Downloads

A command-line tool for generating localization files for different flavors.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter, flutter_localizations, http, intl, logging, mockito, path, shared_preferences

More

Packages that depend on flutter_localisation