You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Rust implementation of fluent-locale library which is a part of Project Fluent.
13
13
14
-
The library allows for parsing of unicode locale identifiers into `Locale` objects, operating on them
15
-
and serializing the result back to locale identifier strings.
16
-
17
-
On top of that, it allows for simple operations like comparing `Locale` objects and
18
-
negotiating between lists of language tags.
19
-
14
+
The library uses [unic-langid](https://github.com/zbraniecki/unic-locale) and [unic-locale](https://github.com/zbraniecki/unic-locale) to retrieve and operate on Unicde Language and Locale Identifiers.
15
+
The library provides algorithm for negotiating between lists of locales.
20
16
21
17
Usage
22
18
-----
23
19
24
20
```rust
25
-
externcrate fluent_locale;
26
-
27
-
usefluent_locale::Locale;
21
+
usefluent_locale::negotiate::NegotiationStrategy;
28
22
usefluent_locale::negotiate_languages;
29
23
30
-
letloc=Locale::from("fr-CA");
31
-
println!("Language: {}", loc.get_language());
32
-
println!("Script: {}", loc.get_script());
33
-
println!("Region: {}", loc.get_region());
34
-
println!("Variants: {}", loc.get_variants());
35
-
println!("Extensions: {}", loc.get_extensions());
36
-
37
-
letloc2=Locale::new("fr-FR");
38
-
39
-
loc2.set_region("ca")?;
40
-
41
-
// The second and third parameters allow for range matching
0 commit comments