3 releases (breaking)

0.4.0 Aug 27, 2019
0.3.0 Aug 26, 2019
0.1.0 Aug 26, 2019

#359 in Internationalization (i18n)

Download history 130/week @ 2024-09-11 180/week @ 2024-09-18 50/week @ 2024-09-25 18/week @ 2024-10-02 138/week @ 2024-10-09 69/week @ 2024-10-16 9/week @ 2024-10-23 13/week @ 2024-10-30 16/week @ 2024-11-06 12/week @ 2024-11-13 20/week @ 2024-11-20 11/week @ 2024-11-27 34/week @ 2024-12-04 53/week @ 2024-12-11 17/week @ 2024-12-18 3/week @ 2024-12-25

108 downloads per month
Used in 3 crates

MIT license

30KB
482 lines

Crate locale-types

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

This crate provides a Locale enumeration, LocaleIdentifier trait, and a LocaleString structure are provided that may be used to parse and construct locale identifiers in a standards-conformant manner.

It is used by the locale-codes and locale-settings crates.

Example

use locale_types::{LocaleIdentifier, LocaleString};

let locale = LocaleString::new("en".to_string()).unwrap()
    .with_territory("US".to_string()).unwrap()
    .with_code_set("UTF-8".to_string()).unwrap()
    .with_modifier("collation=pinyin;currency=CNY".to_string()).unwrap();
println!("{}", locale);

History

  • 0.4.0 - updated the interface LocaleIdentifier to return LocaleError on constructor errors.
  • 0.3.0 - updated module structure.
  • 0.1.0 - extracted from simple-locale.

Dependencies

~2–3MB
~54K SLoC