Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kazupon/unicode-locale-parser
The parser for Unicode Locale Identifiers.
https://github.com/kazupon/unicode-locale-parser
i18n internationalization locale parser unicode-id
Last synced: 6 days ago
JSON representation
The parser for Unicode Locale Identifiers.
- Host: GitHub
- URL: https://github.com/kazupon/unicode-locale-parser
- Owner: kazupon
- License: mit
- Created: 2023-12-29T13:42:22.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-10T14:58:17.000Z (10 months ago)
- Last Synced: 2024-10-25T10:44:41.606Z (21 days ago)
- Topics: i18n, internationalization, locale, parser, unicode-id
- Language: Rust
- Homepage:
- Size: 124 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# unicode-locale-parser
[![CI][ci-src]][ci-href]
[![crates.io][crate-io-src]][crate-io-href]The parser for [Unicode Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_locale_identifier)
## âī¸ Conformance
All code implements of [Unicode UTS #35 Language and Locale Identifiers](https://unicode.org/reports/tr35/#Identifiers).
## đ Usages
```rust
use unicode_locale_parser::parse_locale_id;fn main() {
// simple language
let locale = parse_locale_id("ja-JP");
println!("{:#?}", locale);// language & unicode locale extension
let locale = parse_locale_id("de-Latn-DE-u-ca-buddhist");
println!("{:#?}", locale);
}
```## đ¤ API
- `parse_locale_id`: parse [`unicode_locale_id`](https://unicode.org/reports/tr35/#unicode_locale_id)
- `parse_language_id`: parse [`unicode_language_id`](https://unicode.org/reports/tr35/#unicode_language_id)
- `parse_subdivision_id`: parse [`unicode_subdivision_id`](https://unicode.org/reports/tr35/#unicode_subdivision_id)
- `parse_measure_unit`: parse [`unicode_measure_unit`](https://unicode.org/reports/tr35/#unicode_measure_unit)## â TODO
- [ ] [Locale Id Canonicalization](https://unicode.org/reports/tr35/#LocaleId_Canonicalization)
- [ ] Split some packages with Cargo workspace
- [ ] Performance
- should optimize for string processor with using like [`TinyStr`](https://github.com/zbraniecki/tinystr)
- [ ] Add more convenient manipulation API for Locale
- [ ] Some Trait implementation
- `Eq`, `Clone`, `Default`, `Hash`, `PartialOrd` and `Ord`## Šī¸ License
[MIT](https://opensource.org/licenses/MIT)
[ci-src]: https://github.com/kazupon/unicode-locale-parser/actions/workflows/ci.yml/badge.svg
[ci-href]: https://github.com/kazupon/unicode-locale-parser/actions/workflows/ci.yml
[crate-io-src]: https://img.shields.io/crates/v/unicode-locale-parser.svg
[crate-io-href]: https://crates.io/crates/unicode-locale-parser