icu4x 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/Cargo.lock +119 -139
- data/README.md +3 -8
- data/ext/icu4x/Cargo.toml +10 -9
- data/ext/icu4x/src/data_generator.rs +1 -1
- data/ext/icu4x/src/datetime_format.rs +470 -19
- data/ext/icu4x/src/display_names.rs +3 -3
- data/ext/icu4x/src/lib.rs +1 -0
- data/ext/icu4x/src/list_format.rs +46 -9
- data/ext/icu4x/src/locale.rs +62 -4
- data/ext/icu4x/src/number_format.rs +85 -17
- data/ext/icu4x/src/parts_collector.rs +117 -0
- data/ext/icu4x/src/plural_rules.rs +62 -13
- data/ext/icu4x/src/relative_time_format.rs +58 -11
- data/ext/icu4x_macros/Cargo.toml +1 -1
- data/lib/icu4x/data_gem_task.rb +7 -1
- data/lib/icu4x/version.rb +1 -1
- data/lib/icu4x/yard_docs.rb +180 -6
- data/lib/icu4x.rb +44 -11
- data/sig/icu4x.rbs +45 -3
- metadata +19 -4
data/README.md
CHANGED
|
@@ -41,16 +41,11 @@ Prebuilt binary gems are available for x86_64-linux, aarch64-linux, x86_64-darwi
|
|
|
41
41
|
|
|
42
42
|
#### Option 1: Use Pre-built Data Gem (Quick Start)
|
|
43
43
|
|
|
44
|
-
Add a companion data gem
|
|
44
|
+
Add a companion data gem to your Gemfile:
|
|
45
45
|
|
|
46
46
|
```ruby
|
|
47
47
|
gem "icu4x"
|
|
48
|
-
gem "icu4x-data-recommended" # 164 locales, ~24MB
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
```ruby
|
|
52
|
-
require "icu4x"
|
|
53
|
-
require "icu4x/data/recommended" # Auto-configures default provider
|
|
48
|
+
gem "icu4x-data-recommended" # 164 locales, ~24MB, auto-configures default provider
|
|
54
49
|
```
|
|
55
50
|
|
|
56
51
|
Available data gems:
|
|
@@ -119,7 +114,7 @@ lf.format(%w[Apple Banana Cherry])
|
|
|
119
114
|
# Relative time formatting
|
|
120
115
|
rtf = ICU4X::RelativeTimeFormat.new(locale, provider:)
|
|
121
116
|
rtf.format(-3, :day)
|
|
122
|
-
# => "3日前"
|
|
117
|
+
# => "3 日前"
|
|
123
118
|
|
|
124
119
|
# Display names
|
|
125
120
|
dn = ICU4X::DisplayNames.new(locale, provider:, type: :language)
|
data/ext/icu4x/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "icu4x"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.10.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
publish = false
|
|
6
6
|
|
|
@@ -9,14 +9,15 @@ crate-type = ["cdylib"]
|
|
|
9
9
|
|
|
10
10
|
[dependencies]
|
|
11
11
|
magnus = "0.8"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
writeable = "0.6"
|
|
13
|
+
icu_locale = "2.2"
|
|
14
|
+
icu_provider = "2.2"
|
|
15
|
+
icu_provider_blob = { version = "2.2", features = ["alloc", "export"] }
|
|
16
|
+
icu_provider_source = { version = "2.2", features = ["networking", "unstable"] }
|
|
17
|
+
icu_provider_export = "2.2"
|
|
18
|
+
icu_provider_registry = "2.2"
|
|
19
|
+
icu_provider_adapters = "2.2"
|
|
20
|
+
icu = { version = "2.2", features = ["unstable"] }
|
|
20
21
|
fixed_decimal = "0.7"
|
|
21
22
|
tinystr = "0.8"
|
|
22
23
|
jiff = "0.2"
|
|
@@ -19,7 +19,7 @@ fn marker_lookup() -> &'static HashMap<&'static str, DataMarkerInfo> {
|
|
|
19
19
|
LOOKUP.get_or_init(|| {
|
|
20
20
|
let mut map = HashMap::new();
|
|
21
21
|
macro_rules! cb {
|
|
22
|
-
($($marker_ty:ty:$marker:ident,)+ #[
|
|
22
|
+
($($marker_ty:ty:$marker:ident,)+ #[unstable] $($emarker_ty:ty:$emarker:ident,)+) => {
|
|
23
23
|
$(
|
|
24
24
|
// Add both the full type name and the short marker name
|
|
25
25
|
map.insert(stringify!($marker_ty), <$marker_ty>::INFO);
|