Crate locale-codes

travis.ci crates.io docs.rs Minimum Rust Version mit License GitHub stars

This crate provides locale-related codes/identifiers and any standards-based information concerning them. For example, ISO-396 language identifiers, or ISO-3166 country identifiers.

Example

```rust use locale_codes::codes::{country, currency, region};

let mexico = country::lookup_country("MEX").unwrap(); println!("{:?}", mexico);

let mexicoregion = country::lookupregion(mexico.countrycode).unwrap(); println!("{:?}", mexicoregion);

let currencies = currency::currenciesforcountryname(mexicoregion.name.as_str()); println!("{:?}", currencies); ```

Pre-Build Process

The following describe two code generation steps that are executed outside the normal build process as the output is stored in Git and versioned based on external factors.

JSON Data Files

The script create-data-modules on the other hand is used to process files downloaded, or scraped, from standards web sites to create data used by the library. This data is generated as JSON files in the src/codes/data folder and read as a part of the build for codes modules using the Rust include! macro.

Currently data is generated for the following standards:

History

TODO