icu_datagen crates.io

icu_datagen contains command-line tools to generate and process ICU4X data.

The tools include:

  1. icu4x-datagen: Read source data (CLDR JSON) and dump ICU4X-format data.
  2. icu4x-testdata-download: Download fresh CLDR JSON for testdata.
  3. icu4x-key-extract: Extract ResourceKey objects present in a compiled executable.

More details on each tool can be found by running --help.

Examples

Generate ICU4X Postcard blob (single file) for all keys and all locales:

```bash

Run from the icu4x project folder

$ cargo run --bin icu4x-datagen -- \ --cldr-tag 39.0.0 \ --all-keys \ --all-locales \ --format blob \ --out /tmp/icu4xdata/icu4xdata.postcard ```

Extract the keys used by an executable into a key file:

```bash

Run from the icu4x project folder

$ cargo build --example worklog --release $ cargo make icu4x-key-extract \ target/release/examples/worklog \ /tmp/icu4xdata/worklog+keys.txt $ cat /tmp/icu4xdata/worklog+keys.txt ```

Generate ICU4X JSON file tree from the key file for Spanish and German:

```bash

Run from the icu4x project folder

$ cargo run --bin icu4x-datagen -- \ --cldr-tag 39.0.0 \ --key-file /tmp/icu4xdata/worklog+keys.txt \ --locales es \ --locales de \ --out /tmp/icu4xdata/worklog_json ```

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.