icu_datagen
is a library to generate data files that can be used in ICU4X data providers.
Data files can be generated either programmatically (i.e. in build.rs
), or through a
command-line utility.
build.rs
```rust use icu::locid::langid; use icu_datagen::*; use std::fs::File; use std::path::PathBuf;
fn main() { icudatagen::datagen( Some(&[langid!("de"), langid!("en-AU")]), &icudatagen::keys(&["list/and@1"]), &SourceData::default(), vec![Out::Blob(Box::new(File::create("data.postcard").unwrap()))], ) .unwrap(); } ```
The command line interface can be installed with the bin
feature.
```bash
$ cargo install icu_datagen --features bin
$ icu4x-datagen \
--all-keys \ --locales de,en-AU \ --format blob \ --out data.postcard ``
More details can be found by running
--help`.
For more information on development, authorship, contributing etc. please visit ICU4X home page
.