Skip to content
pubscout

flutter_i18n

0.37.1, released 11 months ago by an unverified publisher

I18n made easy for Flutter using JSON, XML, YAML or TOML files.

WASM-ready
$ flutter pub add flutter_i18n
Source repository

What it does

Simplifies the internationalization process in Flutter apps by allowing translations to be loaded from local files or network sources in formats like JSON, YAML, TOML, and XML. Supports runtime locale changes, plurals, and missing translation handlers.

AI-written summary of version 0.37.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to manage translations using simple JSON, YAML, TOML or XML files
  • You need runtime language switching and pluralization support
  • You want support for loading translation files from the network or device storage

Skip it when

  • You prefer type-safe generated translation keys (codegen approach)
  • You need a different localization format not supported by the loaders

Strengths

  • Supports multiple file formats (JSON, YAML, TOML, XML)
  • Offers various loaders including local, network, and namespace-based loaders
  • Provides built-in widgets like I18nText and I18nPlural for convenience

Weaknesses

  • No code generation for compile-time key safety
  • Requires manual setup of assets in pubspec.yaml

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
10

Configure assets folder in pubspec.yaml and add FlutterI18nDelegate to localizationsDelegates.

MaterialApp(
  localizationsDelegates: [
    FlutterI18nDelegate(
      translationLoader: FileTranslationLoader(
        basePath: 'assets/i18n',
        useCountryCode: false,
      ),
    ),
    GlobalMaterialLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate
  ],
)

Alternatives

Packages that do the same job and could replace flutter_i18n.

Works with

Packages commonly used together with flutter_i18n: ones it builds on, ones built on it, and its own family.