tree: 0d920ce7f32c33e7a34a40fa00a9a7f4902f16af [path history] [tgz]
  1. example/
  2. example_native/
  3. hook/
  4. lib/
  5. test/
  6. tool/
  7. analysis_options.yaml
  8. AUTHORS
  9. CHANGELOG.md
  10. dart_test.yaml
  11. LICENSE
  12. pubspec.yaml
  13. README.md
pkgs/intl4x/README.md

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 formatList formatDate formatCollationDisplay namesPlural RulesCase mapping
ECMA402 (web):heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:
ICU4X (web/native):heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark::heavy_check_mark:

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%
}