Skip to content
pubscout

intl

0.20.3, released 5 months ago by dart.dev

A Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.

Flutter FavoriteWASM-ready
$ flutter pub add intl
Source repository

What it does

It supplies core i18n utilities such as Intl, DateFormat, NumberFormat, and BidiFormatter. The library supports locale-aware formatting, message extraction, and runtime locale switching.

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

Use it when

  • You need to format dates, numbers, or currencies for multiple locales.
  • You require message translation with plural and gender support.
  • You want to change the app locale at runtime or per operation.

Skip it when

  • You only need basic string formatting without locale awareness.
  • You prefer a lightweight solution without async initialization.

Strengths

  • Comprehensive locale support via CLDR v48.
  • Async initialization keeps bundle size small.
  • Built-in plural, gender, and bidi handling.
  • Supports web, mobile, and desktop platforms.

Weaknesses

  • Requires async init for locale data.
  • Large dependency on CLDR data can increase bundle size if many locales used.
  • No code generation; messages must be manually extracted.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
3

Call `initializeDateFormatting()` and `initializeMessages()` asynchronously before using formatting. No build_runner needed.

```dart
import 'package:intl/intl.dart';

void main() {
  Intl.defaultLocale = 'fr';
  var formatter = DateFormat.yMd('fr');
  print(formatter.format(DateTime.now()));
}
```

Alternatives

Packages that do the same job and could replace intl.

  • intl4x

    A lightweight Dart library for locale‑sensitive formatting, collation, and plural rules.

  • flutter_libphonenumber

    Synchronous and asynchronous phone number formatting and parsing in Flutter apps.

  • i69n

    Simple internationalization tool based on YAML files and Dart source code generation.

  • numeral

    Composable number formatting and parsing for decimals, compact values, percentages, and locales.

Works with

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