#locale #unicode #management #api

unic-locale

API for managing Unicode Locale Identifiers

2 unstable releases

✓ Uses Rust 2018 edition

0.2.0 Jul 9, 2019
0.1.0 Jun 16, 2019

#61 in Internationalization (i18n)

15 downloads per month
Used in 1 crate

MIT/Apache

30KB
726 lines

unic-locale Build Status Coverage Status

unic-locale is an API for managing Unicode Locale Identifiers.

The crate provides a way to create a struct from a string, manipulate its fields, canonicalize it, and serialize into a string.

Usage

use unic_locale::{Locale, ExtensionType};

let loc = Locale::from_str("en-US-u-hc-h12");

assert_eq!(loc.get_language(), "en");
assert_eq!(loc.get_script(), None);
assert_eq!(loc.get_region(), Some("US"));

loc.set_extension(ExtensionType::Unicode, "calendar", "buddhist");

assert_eq!(&loc.to_string(), "en-US-u-ca-buddhist-hc-h12");

Status

The crate is providing fundamental blocks, but is very basic.

Get Involved

unic-locale is open-source, licensed under the Apache License, Version 2.0. We encourage everyone to take a look at our code and we'll listen to your feedback.

Dependencies