3 个版本 (破坏性更新)
0.4.0 | 2019 年 8 月 27 日 |
---|---|
0.3.0 | 2019 年 8 月 26 日 |
0.1.0 | 2019 年 8 月 26 日 |
#207 在 国际化 (i18n)
每月下载量 631 次
用于 3 个crate
30KB
482 行
Crate locale-types
此crate提供了一种 Locale
枚举、LocaleIdentifier
特性和一个 LocaleString
结构,可用于以标准兼容的方式解析和构造地区标识符。
它被 locale-codes
和 locale-settings
crate使用。
示例
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);
历史
- 0.4.0 - 将
LocaleIdentifier
接口更新为在构造函数错误时返回 LocaleError。 - 0.3.0 - 更新了模块结构。
- 0.1.0 - 从 simple-locale 中提取。
依赖关系
~2.1–3MB
~53K SLoC