Skip to content

Commit

Permalink
Update readme of intl4x
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Jul 13, 2023
1 parent 59206fa commit 522b34f
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions pkgs/intl4x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,32 @@
A lightweight modular library for internationalization (i18n) functionality.

## Features
* Formatting for dates, numbers, and lists. (TODO)
* Collation. (TODO)
* Formatting for dates, numbers, and lists.
* Collation.
* Display names.

## Implementation
* Wraps around [ICU4X](https://github.com/unicode-org/icu4x) on native or web platforms. (TODO)
* Wraps around [ICU4X](https://github.com/unicode-org/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 `EcmaPolicy`.
## Status
| | Number format | List format | Date format | Collation | Display names |
|---|:---:|:---:|:---:|:---:|:---:|
| **ECMA402 (web)** | :heavy_check_mark: | | | :heavy_check_mark: | |
| **ICU4X (web/native)** | | | | | |


## Example
The functionalities are called through getters on an `Intl` instance, i.e.
```dart
import 'package:intl4x/ecma_policy.dart';
import 'package:intl4x/intl4x.dart';
import 'package:intl4x/number_format.dart';
final numberFormat = Intl(
ecmaPolicy: const AlwaysEcma(),
locale: 'en_US',
).numberFormat;
print(numberFormat.percent().format(0.5)); //prints 50%
defaultLocale: 'en_US',
).numberFormat(NumberFormatOptions.percent());
print(numberFormat.format(0.5)); //prints 50%
```

0 comments on commit 522b34f

Please sign in to comment.