intl4x 0.13.0 copy "intl4x: ^0.13.0" to clipboard
intl4x: ^0.13.0 copied to clipboard

A lightweight modular library for internationalization (i18n) functionality.

package:intl4x Pub package publisher

A lightweight modular library for internationalization (i18n) functionality.

Features #

  • Formatting for dates, numbers, and lists.
  • Collation.
  • Display names.

Status - experimental #

We're actively iterating on the API for this package (please provide feedback via our issue tracker).

Number format List format Date format Collation Display names Plural Rules Case mapping
ECMA402 (web) ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
ICU4X (web/native) ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️

Implementation and Goals #

  • Wraps around ICU4X on native or web platforms.
  • Wraps around the built-in browser functionalities on the web.
    • Select which locales you want to use the browser for through an ``.

Example #

The functionalities are called through getters on an Intl instance, i.e.

import 'package:intl4x/ecma_policy.dart';
import 'package:intl4x/intl4x.dart';
import 'package:intl4x/number_format.dart';

void main() {
  final numberFormat = Intl(
    : const AlwaysEcma(),
    locale: Locale.parse('en-US'),
  ).numberFormat(NumberFormatOptions.percent());

  print(numberFormat.format(0.5)); // prints 50%
}
copied to clipboard

Installation #

The easiest setup is

dart pub add intl4x
dart run ...
copied to clipboard

This will download the binaries from Github

16
likes
160
points
471
downloads

Publisher

verified publisherlabs.dart.dev

Weekly Downloads

2024.10.22 - 2025.09.16

A lightweight modular library for internationalization (i18n) functionality.

Repository (GitHub)
View/report issues
Contributing

Topics

#i18n

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

hooks, icu4x, meta, record_use

More

Packages that depend on intl4x