icu4x 0.5.2 → 0.6.1
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 +16 -0
- data/README.md +22 -1
- data/ext/icu4x/src/data_generator.rs +86 -32
- data/lib/icu4x/data_gem_task.rb +133 -0
- data/lib/icu4x/rake_task.rb +77 -0
- data/lib/icu4x/version.rb +1 -1
- data/lib/icu4x/yard_docs.rb +22 -2
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28ab1937c0157603296c359e3ee392c9daf61ab75b88814bd59c0e448558d288
|
|
4
|
+
data.tar.gz: 6f867d51c15a78a9f8d52a1cc41fe6a85fe5195a78dc31f3d08168db77858e1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ab2852087c12adad3275197b50915e1d0c1b29111e3428c35c43d04864734e4d081b22700a6cf25408bfb74326964a6de38318f6bebddd2635b7978d516c449
|
|
7
|
+
data.tar.gz: 4293277c12231a11a52e6686874238d994b5cb438e2e780a66c26f8cdc906ec54bf6af1f4982c24ac1eb27474e980e7420bf84676096a16e8497f3ff4b396216
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.6.1] - 2026-01-02
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Re-release to publish companion data gems with Trusted Publisher configuration
|
|
8
|
+
|
|
9
|
+
## [0.6.0] - 2026-01-02
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Companion data gems**: `icu4x-data-full`, `icu4x-data-recommended`, `icu4x-data-modern` for bundled locale data
|
|
14
|
+
- Auto-configures default provider on require (e.g., `require "icu4x/data/recommended"`)
|
|
15
|
+
- **RakeTask**: `ICU4X::RakeTask` for integrating data generation into build workflows
|
|
16
|
+
- **Symbolic locale specifiers**: `DataGenerator.export` accepts `:full`, `:recommended`, `:modern`, `:moderate`, `:basic` symbols
|
|
17
|
+
- **Automatic 'und' locale**: `DataGenerator.export` automatically includes the `und` (undetermined) locale for fallback
|
|
18
|
+
|
|
3
19
|
## [0.5.2] - 2026-01-01
|
|
4
20
|
|
|
5
21
|
### Fixed
|
data/README.md
CHANGED
|
@@ -35,7 +35,28 @@ Add to your Gemfile:
|
|
|
35
35
|
gem "icu4x"
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
### Option 1: Use Pre-built Data Gem (Quick Start)
|
|
39
|
+
|
|
40
|
+
Add a companion data gem for instant setup:
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
gem "icu4x"
|
|
44
|
+
gem "icu4x-data-recommended" # 164 locales, ~24MB
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```ruby
|
|
48
|
+
require "icu4x"
|
|
49
|
+
require "icu4x/data/recommended" # Auto-configures default provider
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Available data gems:
|
|
53
|
+
- `icu4x-data-full` - All CLDR locales (700+)
|
|
54
|
+
- `icu4x-data-recommended` - Recommended locales (164)
|
|
55
|
+
- `icu4x-data-modern` - Modern coverage locales (103)
|
|
56
|
+
|
|
57
|
+
### Option 2: Generate Custom Data
|
|
58
|
+
|
|
59
|
+
For fine-grained control, generate only the locales you need:
|
|
39
60
|
|
|
40
61
|
```ruby
|
|
41
62
|
require "icu4x"
|
|
@@ -2,7 +2,7 @@ use crate::helpers;
|
|
|
2
2
|
use icu_provider::DataMarkerInfo;
|
|
3
3
|
use icu_provider_blob::export::BlobExporter;
|
|
4
4
|
use icu_provider_export::prelude::*;
|
|
5
|
-
use icu_provider_source::SourceDataProvider;
|
|
5
|
+
use icu_provider_source::{CoverageLevel, SourceDataProvider};
|
|
6
6
|
use magnus::{
|
|
7
7
|
Error, RArray, RClass, RHash, RModule, Ruby, Symbol, Value, function, prelude::*,
|
|
8
8
|
value::ReprValue,
|
|
@@ -44,14 +44,17 @@ impl DataGenerator {
|
|
|
44
44
|
/// Export ICU4X data to a blob file
|
|
45
45
|
///
|
|
46
46
|
/// # Arguments
|
|
47
|
-
/// * `locales` - Array of locale strings
|
|
47
|
+
/// * `locales` - Symbol (:full, :recommended, :modern, :moderate, :basic) or Array of locale strings
|
|
48
48
|
/// * `markers` - :all or Array of marker symbols (e.g., [:datetime, :number, :plurals])
|
|
49
49
|
/// * `format` - :blob (only blob format is supported)
|
|
50
50
|
/// * `output` - Pathname for the output file
|
|
51
51
|
fn export(ruby: &Ruby, kwargs: RHash) -> Result<(), Error> {
|
|
52
|
-
//
|
|
53
|
-
let
|
|
54
|
-
|
|
52
|
+
// Create the source data provider early (needed for coverage level locales)
|
|
53
|
+
let source_provider = SourceDataProvider::new();
|
|
54
|
+
|
|
55
|
+
// Extract locales - can be a Symbol or Array<String>
|
|
56
|
+
let locales_value: Value = kwargs
|
|
57
|
+
.fetch::<_, Value>(ruby.to_symbol("locales"))
|
|
55
58
|
.map_err(|_| {
|
|
56
59
|
Error::new(
|
|
57
60
|
ruby.exception_arg_error(),
|
|
@@ -59,30 +62,7 @@ impl DataGenerator {
|
|
|
59
62
|
)
|
|
60
63
|
})?;
|
|
61
64
|
|
|
62
|
-
let
|
|
63
|
-
let mut has_und = false;
|
|
64
|
-
for i in 0..locales_value.len() {
|
|
65
|
-
let locale_str: String = locales_value.entry(i as isize)?;
|
|
66
|
-
if locale_str == "und" {
|
|
67
|
-
has_und = true;
|
|
68
|
-
}
|
|
69
|
-
let family = DataLocaleFamily::with_descendants(locale_str.parse().map_err(|e| {
|
|
70
|
-
Error::new(
|
|
71
|
-
ruby.exception_arg_error(),
|
|
72
|
-
format!("Invalid locale '{}': {}", locale_str, e),
|
|
73
|
-
)
|
|
74
|
-
})?);
|
|
75
|
-
locale_families.push(family);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Warn if 'und' locale is not included
|
|
79
|
-
if !has_und {
|
|
80
|
-
let kernel: Value = ruby.eval("Kernel")?;
|
|
81
|
-
let _: Value = kernel.funcall(
|
|
82
|
-
"warn",
|
|
83
|
-
("ICU4X::DataGenerator.export: 'und' locale not included. Fallback may fail for unlisted locales.",),
|
|
84
|
-
)?;
|
|
85
|
-
}
|
|
65
|
+
let locale_families = Self::parse_locales(ruby, locales_value, &source_provider)?;
|
|
86
66
|
|
|
87
67
|
// Extract markers
|
|
88
68
|
let markers_value: Value = kwargs
|
|
@@ -180,9 +160,6 @@ impl DataGenerator {
|
|
|
180
160
|
})?;
|
|
181
161
|
}
|
|
182
162
|
|
|
183
|
-
// Create the source data provider (downloads CLDR data)
|
|
184
|
-
let source_provider = SourceDataProvider::new();
|
|
185
|
-
|
|
186
163
|
// Create the blob exporter
|
|
187
164
|
let file = File::create(&output_path).map_err(|e| {
|
|
188
165
|
Error::new(
|
|
@@ -231,6 +208,83 @@ impl DataGenerator {
|
|
|
231
208
|
}
|
|
232
209
|
Ok(array)
|
|
233
210
|
}
|
|
211
|
+
|
|
212
|
+
/// Parse locales from Ruby value (Symbol or Array)
|
|
213
|
+
fn parse_locales(
|
|
214
|
+
ruby: &Ruby,
|
|
215
|
+
locales_value: Value,
|
|
216
|
+
source_provider: &SourceDataProvider,
|
|
217
|
+
) -> Result<Vec<DataLocaleFamily>, Error> {
|
|
218
|
+
// Check if it's a symbol
|
|
219
|
+
if let Ok(symbol) = Symbol::try_convert(locales_value) {
|
|
220
|
+
let symbol_name = symbol.name()?;
|
|
221
|
+
match symbol_name.as_ref() {
|
|
222
|
+
"full" => Ok(vec![DataLocaleFamily::FULL]),
|
|
223
|
+
"modern" => Self::locales_from_coverage(ruby, source_provider, &[CoverageLevel::Modern]),
|
|
224
|
+
"moderate" => {
|
|
225
|
+
Self::locales_from_coverage(ruby, source_provider, &[CoverageLevel::Moderate])
|
|
226
|
+
}
|
|
227
|
+
"basic" => Self::locales_from_coverage(ruby, source_provider, &[CoverageLevel::Basic]),
|
|
228
|
+
"recommended" => Self::locales_from_coverage(
|
|
229
|
+
ruby,
|
|
230
|
+
source_provider,
|
|
231
|
+
&[
|
|
232
|
+
CoverageLevel::Modern,
|
|
233
|
+
CoverageLevel::Moderate,
|
|
234
|
+
CoverageLevel::Basic,
|
|
235
|
+
],
|
|
236
|
+
),
|
|
237
|
+
name => Err(Error::new(
|
|
238
|
+
ruby.exception_arg_error(),
|
|
239
|
+
format!(
|
|
240
|
+
"unknown locale specifier: :{}. Valid options are :full, :recommended, :modern, :moderate, :basic",
|
|
241
|
+
name
|
|
242
|
+
),
|
|
243
|
+
)),
|
|
244
|
+
}
|
|
245
|
+
} else if let Ok(array) = RArray::try_convert(locales_value) {
|
|
246
|
+
// Array of locale strings
|
|
247
|
+
let mut families = Vec::new();
|
|
248
|
+
for i in 0..array.len() {
|
|
249
|
+
let locale_str: String = array.entry(i as isize)?;
|
|
250
|
+
let family = DataLocaleFamily::with_descendants(locale_str.parse().map_err(|e| {
|
|
251
|
+
Error::new(
|
|
252
|
+
ruby.exception_arg_error(),
|
|
253
|
+
format!("Invalid locale '{}': {}", locale_str, e),
|
|
254
|
+
)
|
|
255
|
+
})?);
|
|
256
|
+
families.push(family);
|
|
257
|
+
}
|
|
258
|
+
Ok(families)
|
|
259
|
+
} else {
|
|
260
|
+
Err(Error::new(
|
|
261
|
+
ruby.exception_arg_error(),
|
|
262
|
+
"locales must be a Symbol (:full, :recommended, :modern, :moderate, :basic) or an Array of locale strings",
|
|
263
|
+
))
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/// Get locales from CLDR coverage levels
|
|
268
|
+
fn locales_from_coverage(
|
|
269
|
+
ruby: &Ruby,
|
|
270
|
+
source_provider: &SourceDataProvider,
|
|
271
|
+
levels: &[CoverageLevel],
|
|
272
|
+
) -> Result<Vec<DataLocaleFamily>, Error> {
|
|
273
|
+
let locales = source_provider
|
|
274
|
+
.locales_for_coverage_levels(levels.iter().copied())
|
|
275
|
+
.map_err(|e| {
|
|
276
|
+
let error_class = helpers::get_exception_class(ruby, "ICU4X::DataGeneratorError");
|
|
277
|
+
Error::new(
|
|
278
|
+
error_class,
|
|
279
|
+
format!("Failed to get locales for coverage levels: {}", e),
|
|
280
|
+
)
|
|
281
|
+
})?;
|
|
282
|
+
|
|
283
|
+
Ok(locales
|
|
284
|
+
.into_iter()
|
|
285
|
+
.map(DataLocaleFamily::with_descendants)
|
|
286
|
+
.collect())
|
|
287
|
+
}
|
|
234
288
|
}
|
|
235
289
|
|
|
236
290
|
pub fn init(ruby: &Ruby, module: &RModule) -> Result<(), Error> {
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "erb"
|
|
4
|
+
require "fileutils"
|
|
5
|
+
require "pathname"
|
|
6
|
+
require "rake"
|
|
7
|
+
require "rake/tasklib"
|
|
8
|
+
require "rubygems"
|
|
9
|
+
require "rubygems/package"
|
|
10
|
+
|
|
11
|
+
module ICU4X
|
|
12
|
+
# Rake task for generating ICU4X data companion gems.
|
|
13
|
+
#
|
|
14
|
+
# @example Basic usage
|
|
15
|
+
# require "icu4x/data_gem_task"
|
|
16
|
+
#
|
|
17
|
+
# ICU4X::DataGemTask.new
|
|
18
|
+
#
|
|
19
|
+
# This creates the following tasks:
|
|
20
|
+
# - +icu4x:data_gems:build+ - Build all data gems
|
|
21
|
+
# - +icu4x:data_gems:build:full+ - Build icu4x-data-full gem
|
|
22
|
+
# - +icu4x:data_gems:build:recommended+ - Build icu4x-data-recommended gem
|
|
23
|
+
# - +icu4x:data_gems:build:modern+ - Build icu4x-data-modern gem
|
|
24
|
+
# - +icu4x:data_gems:clean+ - Clean data gem build artifacts
|
|
25
|
+
class DataGemTask < ::Rake::TaskLib
|
|
26
|
+
VARIANTS = {
|
|
27
|
+
full: {locales: :full, description: "All CLDR locales (700+)"},
|
|
28
|
+
recommended: {locales: :recommended, description: "Recommended locales (164)"},
|
|
29
|
+
modern: {locales: :modern, description: "Modern coverage locales (103)"}
|
|
30
|
+
}.freeze
|
|
31
|
+
public_constant :VARIANTS
|
|
32
|
+
|
|
33
|
+
TEMPLATE_DIR = Pathname(__dir__).join("../../templates/data_gem")
|
|
34
|
+
public_constant :TEMPLATE_DIR
|
|
35
|
+
|
|
36
|
+
def initialize
|
|
37
|
+
super
|
|
38
|
+
define_tasks
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
private def define_tasks
|
|
42
|
+
namespace "icu4x:data_gems" do
|
|
43
|
+
desc "Build all data gems"
|
|
44
|
+
task build: VARIANTS.keys.map {|v| "build:#{v}" }
|
|
45
|
+
|
|
46
|
+
VARIANTS.each do |variant, config|
|
|
47
|
+
desc "Build icu4x-data-#{variant} gem"
|
|
48
|
+
task "build:#{variant}" => :compile do
|
|
49
|
+
build_gem(variant, config)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
desc "Clean data gem build artifacts"
|
|
54
|
+
task :clean do
|
|
55
|
+
VARIANTS.each_key {|v| FileUtils.rm_rf(tmp_dir(v)) }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
private def build_gem(variant, config)
|
|
61
|
+
gem_dir = prepare_gem_structure(variant, config)
|
|
62
|
+
generate_data_blob(gem_dir, variant, config[:locales])
|
|
63
|
+
package_gem(gem_dir, variant)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
private def prepare_gem_structure(variant, config)
|
|
67
|
+
gem_dir = tmp_dir(variant)
|
|
68
|
+
FileUtils.rm_rf(gem_dir)
|
|
69
|
+
gem_dir.mkpath
|
|
70
|
+
|
|
71
|
+
# Render templates
|
|
72
|
+
require "icu4x/version"
|
|
73
|
+
render_template(
|
|
74
|
+
"gemspec.erb",
|
|
75
|
+
gem_dir / "icu4x-data-#{variant}.gemspec",
|
|
76
|
+
variant:,
|
|
77
|
+
config:,
|
|
78
|
+
version: ICU4X::VERSION
|
|
79
|
+
)
|
|
80
|
+
render_template(
|
|
81
|
+
"README.md.erb",
|
|
82
|
+
gem_dir / "README.md",
|
|
83
|
+
variant:,
|
|
84
|
+
config:
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
lib_data_dir = gem_dir / "lib" / "icu4x" / "data"
|
|
88
|
+
lib_data_dir.mkpath
|
|
89
|
+
render_template(
|
|
90
|
+
"lib/icu4x/data/variant.rb.erb",
|
|
91
|
+
lib_data_dir / "#{variant}.rb",
|
|
92
|
+
variant:
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Copy LICENSE
|
|
96
|
+
FileUtils.cp("LICENSE.txt", gem_dir / "LICENSE.txt")
|
|
97
|
+
|
|
98
|
+
gem_dir
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
private def generate_data_blob(gem_dir, variant, locales)
|
|
102
|
+
data_dir = gem_dir / "data"
|
|
103
|
+
data_dir.mkpath
|
|
104
|
+
|
|
105
|
+
require "icu4x"
|
|
106
|
+
ICU4X::DataGenerator.export(
|
|
107
|
+
locales:,
|
|
108
|
+
markers: :all,
|
|
109
|
+
format: :blob,
|
|
110
|
+
output: data_dir / "#{variant}.postcard"
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
private def package_gem(gem_dir, variant)
|
|
115
|
+
Dir.chdir(gem_dir) do
|
|
116
|
+
spec = Gem::Specification.load("icu4x-data-#{variant}.gemspec")
|
|
117
|
+
gem_file = Gem::Package.build(spec)
|
|
118
|
+
pkg_dir = Pathname("../../pkg")
|
|
119
|
+
pkg_dir.mkpath
|
|
120
|
+
FileUtils.mv(gem_file, pkg_dir / gem_file)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
private def render_template(template_name, output_path, **locals)
|
|
125
|
+
template = ERB.new(TEMPLATE_DIR.join(template_name).read, trim_mode: "-")
|
|
126
|
+
binding_with_locals = binding
|
|
127
|
+
locals.each {|k, v| binding_with_locals.local_variable_set(k, v) }
|
|
128
|
+
output_path.write(template.result(binding_with_locals))
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
private def tmp_dir(variant) = Pathname("tmp/icu4x-data-#{variant}")
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rake"
|
|
4
|
+
require "rake/clean"
|
|
5
|
+
require "rake/tasklib"
|
|
6
|
+
|
|
7
|
+
module ICU4X
|
|
8
|
+
# Rake task for generating ICU4X data blobs.
|
|
9
|
+
#
|
|
10
|
+
# @example Basic usage
|
|
11
|
+
# require "icu4x/rake_task"
|
|
12
|
+
#
|
|
13
|
+
# ICU4X::RakeTask.new do |t|
|
|
14
|
+
# t.output = "data/icu4x.postcard"
|
|
15
|
+
# end
|
|
16
|
+
#
|
|
17
|
+
# @example Custom task name and locales
|
|
18
|
+
# ICU4X::RakeTask.new("myapp:generate_data") do |t|
|
|
19
|
+
# t.locales = %w[en ja de]
|
|
20
|
+
# t.output = "data/icu4x.postcard"
|
|
21
|
+
# end
|
|
22
|
+
class RakeTask < ::Rake::TaskLib
|
|
23
|
+
# @return [String] The name of the task
|
|
24
|
+
attr_reader :name
|
|
25
|
+
|
|
26
|
+
# @return [Symbol, Array<String>] Locale specifier or array of locale strings
|
|
27
|
+
# Defaults to +:recommended+
|
|
28
|
+
attr_accessor :locales
|
|
29
|
+
|
|
30
|
+
# @return [Symbol, Array<String>] Data markers to include
|
|
31
|
+
# Defaults to +:all+
|
|
32
|
+
attr_accessor :markers
|
|
33
|
+
|
|
34
|
+
# @return [Pathname, String] Output path relative to Rakefile
|
|
35
|
+
attr_accessor :output
|
|
36
|
+
|
|
37
|
+
# Creates a new RakeTask.
|
|
38
|
+
#
|
|
39
|
+
# @param name [String] Task name (default: "icu4x:data:generate")
|
|
40
|
+
# @yield [self] Configuration block
|
|
41
|
+
# @yieldparam task [RakeTask] The task instance for configuration
|
|
42
|
+
def initialize(name="icu4x:data:generate")
|
|
43
|
+
super()
|
|
44
|
+
@name = name
|
|
45
|
+
@locales = :recommended
|
|
46
|
+
@markers = :all
|
|
47
|
+
@output = nil
|
|
48
|
+
|
|
49
|
+
yield self if block_given?
|
|
50
|
+
|
|
51
|
+
raise ArgumentError, "output is required" if @output.nil?
|
|
52
|
+
|
|
53
|
+
define_tasks
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
private def define_tasks
|
|
57
|
+
output_path = Pathname(@output)
|
|
58
|
+
|
|
59
|
+
desc "Generate ICU4X data blob"
|
|
60
|
+
file output_path.to_s do
|
|
61
|
+
require "icu4x"
|
|
62
|
+
output_path.dirname.mkpath
|
|
63
|
+
ICU4X::DataGenerator.export(
|
|
64
|
+
locales: @locales,
|
|
65
|
+
markers: @markers,
|
|
66
|
+
format: :blob,
|
|
67
|
+
output: output_path
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
desc "Generate ICU4X data blob"
|
|
72
|
+
task @name => output_path.to_s
|
|
73
|
+
|
|
74
|
+
CLOBBER.include(output_path.to_s)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
data/lib/icu4x/version.rb
CHANGED
data/lib/icu4x/yard_docs.rb
CHANGED
|
@@ -112,7 +112,18 @@
|
|
|
112
112
|
# class DataGenerator
|
|
113
113
|
# # Exports locale data to a file.
|
|
114
114
|
# #
|
|
115
|
-
# #
|
|
115
|
+
# # The +locales+ parameter accepts either a Symbol for predefined locale sets
|
|
116
|
+
# # based on CLDR coverage levels, or an Array of locale identifier strings.
|
|
117
|
+
# # When using +with_descendants+, ancestor locales (including +und+) are
|
|
118
|
+
# # automatically included for fallback support.
|
|
119
|
+
# #
|
|
120
|
+
# # @param locales [Symbol, Array<String>] locale specification:
|
|
121
|
+
# # - +:full+ - all CLDR locales (700+)
|
|
122
|
+
# # - +:recommended+ - locales with basic, moderate, or modern coverage (164)
|
|
123
|
+
# # - +:modern+ - locales with modern coverage only (103)
|
|
124
|
+
# # - +:moderate+ - locales with moderate coverage only
|
|
125
|
+
# # - +:basic+ - locales with basic coverage only
|
|
126
|
+
# # - +Array<String>+ - explicit list of locale identifiers
|
|
116
127
|
# # @param markers [Symbol, Array<String>] data markers to include;
|
|
117
128
|
# # use +:all+ for all markers, or specify individual marker names
|
|
118
129
|
# # @param format [Symbol] output format, currently only +:blob+ is supported
|
|
@@ -128,7 +139,16 @@
|
|
|
128
139
|
# # output: Pathname.new("i18n_data.postcard")
|
|
129
140
|
# # )
|
|
130
141
|
# #
|
|
142
|
+
# # @example Export data for all modern coverage locales
|
|
143
|
+
# # ICU4X::DataGenerator.export(
|
|
144
|
+
# # locales: :modern,
|
|
145
|
+
# # markers: :all,
|
|
146
|
+
# # format: :blob,
|
|
147
|
+
# # output: Pathname.new("modern_data.postcard")
|
|
148
|
+
# # )
|
|
149
|
+
# #
|
|
131
150
|
# # @see .available_markers
|
|
151
|
+
# # @see https://cldr.unicode.org/index/cldr-spec/coverage-levels CLDR Coverage Levels
|
|
132
152
|
# #
|
|
133
153
|
# def self.export(locales:, markers:, format:, output:); end
|
|
134
154
|
#
|
|
@@ -138,7 +158,7 @@
|
|
|
138
158
|
# #
|
|
139
159
|
# # @example
|
|
140
160
|
# # markers = ICU4X::DataGenerator.available_markers
|
|
141
|
-
# # #=> ["
|
|
161
|
+
# # #=> ["CalendarJapaneseExtendedV1", "CalendarJapaneseModernV1", ...]
|
|
142
162
|
# #
|
|
143
163
|
# def self.available_markers; end
|
|
144
164
|
# end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: icu4x
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OZAWA Sakuro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dry-configurable
|
|
@@ -69,6 +69,8 @@ files:
|
|
|
69
69
|
- ext/icu4x_macros/Cargo.toml
|
|
70
70
|
- ext/icu4x_macros/src/lib.rs
|
|
71
71
|
- lib/icu4x.rb
|
|
72
|
+
- lib/icu4x/data_gem_task.rb
|
|
73
|
+
- lib/icu4x/rake_task.rb
|
|
72
74
|
- lib/icu4x/version.rb
|
|
73
75
|
- lib/icu4x/yard_docs.rb
|
|
74
76
|
- sig/icu4x.rbs
|