worldwide 1.14.1 → 1.14.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/Gemfile.lock +1 -1
- data/data/cldr/paths.txt +4582 -0
- data/data/other/paths.txt +1529 -0
- data/data/regions/AE/ko.yml +1 -1
- data/data/regions/AR/el.yml +1 -1
- data/data/regions/AR/fi.yml +2 -2
- data/data/regions/AR/hr.yml +2 -2
- data/data/regions/AR/th.yml +1 -1
- data/data/regions/AR/zh-CN.yml +1 -1
- data/data/regions/AU/de.yml +2 -2
- data/data/regions/AU/el.yml +1 -1
- data/data/regions/AU/fr.yml +1 -1
- data/data/regions/AU/hi.yml +2 -2
- data/data/regions/AU/hr.yml +1 -1
- data/data/regions/AU/hu.yml +2 -2
- data/data/regions/AU/ja.yml +6 -6
- data/data/regions/AU/ko.yml +4 -4
- data/data/regions/AU/nl.yml +2 -2
- data/data/regions/AU/pl.yml +2 -2
- data/data/regions/AU/pt-BR.yml +3 -3
- data/data/regions/AU/pt-PT.yml +1 -1
- data/data/regions/AU/ru.yml +4 -4
- data/data/regions/AU/sl.yml +2 -2
- data/data/regions/AU/sv.yml +2 -2
- data/data/regions/AU/th.yml +3 -3
- data/data/regions/AU/vi.yml +3 -3
- data/data/regions/AU/zh-CN.yml +3 -3
- data/data/regions/BR/de.yml +2 -2
- data/data/regions/BR/el.yml +1 -1
- data/data/regions/BR/nl.yml +1 -1
- data/data/regions/BR/sv.yml +1 -1
- data/data/regions/BR/th.yml +1 -1
- data/data/regions/BR/vi.yml +2 -2
- data/data/regions/BR/zh-CN.yml +2 -2
- data/data/regions/BV.yml +1 -1
- data/data/regions/CA/el.yml +1 -1
- data/data/regions/CA/hr.yml +2 -2
- data/data/regions/CA/ko.yml +1 -1
- data/data/regions/CH/sv.yml +1 -1
- data/data/regions/CH/vi.yml +2 -2
- data/data/regions/CH/zh-CN.yml +2 -2
- data/data/regions/CN/el.yml +1 -1
- data/data/regions/CN/fi.yml +2 -2
- data/data/regions/CN/hr.yml +2 -2
- data/data/regions/CN/ja.yml +2 -2
- data/data/regions/CN/th.yml +1 -1
- data/data/regions/CN/zh-CN.yml +2 -2
- data/data/regions/CO/da.yml +2 -2
- data/data/regions/CO/de.yml +2 -2
- data/data/regions/CO/el.yml +1 -1
- data/data/regions/CO/hr.yml +2 -2
- data/data/regions/CO/hu.yml +2 -2
- data/data/regions/CO/ja.yml +2 -2
- data/data/regions/CO/th.yml +1 -1
- data/data/regions/CO/zh-CN.yml +1 -1
- data/data/regions/CR/el.yml +1 -1
- data/data/regions/CR/hr.yml +2 -2
- data/data/regions/DE/hi.yml +2 -2
- data/data/regions/DE/sv.yml +2 -2
- data/data/regions/DE/vi.yml +2 -2
- data/data/regions/DE/zh-CN.yml +2 -2
- data/data/regions/DK/hi.yml +2 -2
- data/data/regions/DK/sv.yml +1 -1
- data/data/regions/DK/vi.yml +2 -2
- data/data/regions/DK/zh-CN.yml +1 -1
- data/data/regions/DZ/el.yml +1 -1
- data/data/regions/DZ/fi.yml +2 -2
- data/data/regions/DZ/hr.yml +2 -2
- data/data/regions/DZ/ja.yml +2 -2
- data/data/regions/DZ/th.yml +1 -1
- data/data/regions/DZ/zh-CN.yml +1 -1
- data/data/regions/EG/de.yml +2 -2
- data/data/regions/EG/hi.yml +2 -2
- data/data/regions/EG/hr.yml +1 -1
- data/data/regions/EG/pt-BR.yml +2 -2
- data/data/regions/EG/ru.yml +2 -2
- data/data/regions/EG/sv.yml +2 -2
- data/data/regions/EG/zh-CN.yml +1 -1
- data/data/regions/ES/el.yml +1 -1
- data/data/regions/ES/fi.yml +2 -2
- data/data/regions/ES/hr.yml +2 -2
- data/data/regions/ES/ja.yml +2 -2
- data/data/regions/ES/sv.yml +1 -1
- data/data/regions/ES/th.yml +1 -1
- data/data/regions/ES/vi.yml +2 -2
- data/data/regions/ES/zh-CN.yml +2 -2
- data/data/regions/FI.yml +1 -1
- data/data/regions/GB/hi.yml +2 -2
- data/data/regions/GB/pt-BR.yml +2 -2
- data/data/regions/GB/th.yml +1 -1
- data/data/regions/GB/vi.yml +2 -2
- data/data/regions/GB/zh-CN.yml +1 -1
- data/data/regions/HK/cs.yml +2 -2
- data/data/regions/HK/fi.yml +2 -2
- data/data/regions/HK/fr.yml +2 -2
- data/data/regions/HK/ja.yml +4 -4
- data/data/regions/HK/ko.yml +2 -2
- data/data/regions/HK/ru.yml +2 -2
- data/data/regions/HK/tr.yml +2 -2
- data/data/regions/HK/zh-CN.yml +1 -1
- data/data/regions/HK/zh-TW.yml +2 -2
- data/data/regions/ID/el.yml +1 -1
- data/data/regions/ID/fi.yml +2 -2
- data/data/regions/ID/hr.yml +2 -2
- data/data/regions/ID/ja.yml +2 -2
- data/data/regions/ID/th.yml +1 -1
- data/data/regions/ID/zh-CN.yml +1 -1
- data/data/regions/IE/cs.yml +2 -2
- data/data/regions/IE/da.yml +2 -2
- data/data/regions/IE/fi.yml +2 -2
- data/data/regions/IE/hr.yml +1 -1
- data/data/regions/IE/ja.yml +2 -2
- data/data/regions/IE/ko.yml +2 -2
- data/data/regions/IE/ms.yml +2 -2
- data/data/regions/IE/nl.yml +2 -2
- data/data/regions/IE/pl.yml +1 -1
- data/data/regions/IE/pt-BR.yml +2 -2
- data/data/regions/IE/th.yml +1 -1
- data/data/regions/IE/tr.yml +2 -2
- data/data/regions/IE/zh-CN.yml +2 -2
- data/data/regions/IN/bg.yml +2 -2
- data/data/regions/IN/cs.yml +2 -2
- data/data/regions/IN/da.yml +2 -2
- data/data/regions/IN/de.yml +2 -2
- data/data/regions/IN/el.yml +1 -1
- data/data/regions/IN/fi.yml +2 -2
- data/data/regions/IN/fr.yml +2 -2
- data/data/regions/IN/it.yml +1 -1
- data/data/regions/IN/ja.yml +2 -2
- data/data/regions/IN/pt-BR.yml +2 -2
- data/data/regions/IN/ru.yml +2 -2
- data/data/regions/IN/sv.yml +2 -2
- data/data/regions/IN/th.yml +1 -1
- data/data/regions/IN/zh-CN.yml +3 -3
- data/data/regions/IN/zh-TW.yml +2 -2
- data/data/regions/IT/el.yml +1 -1
- data/data/regions/IT/fi.yml +2 -2
- data/data/regions/IT/hr.yml +2 -2
- data/data/regions/IT/hu.yml +2 -2
- data/data/regions/IT/ja.yml +2 -2
- data/data/regions/IT/sv.yml +1 -1
- data/data/regions/IT/th.yml +1 -1
- data/data/regions/IT/vi.yml +2 -2
- data/data/regions/IT/zh-CN.yml +2 -2
- data/data/regions/JP/el.yml +2 -2
- data/data/regions/JP/es.yml +2 -2
- data/data/regions/JP/hi.yml +4 -4
- data/data/regions/JP/hu.yml +2 -2
- data/data/regions/JP/ko.yml +2 -2
- data/data/regions/JP/pl.yml +2 -2
- data/data/regions/JP/tr.yml +4 -4
- data/data/regions/JP/zh-CN.yml +3 -3
- data/data/regions/KR/el.yml +1 -1
- data/data/regions/KR/hr.yml +2 -2
- data/data/regions/KR/ja.yml +2 -2
- data/data/regions/KR/zh-CN.yml +1 -1
- data/data/regions/KW/hr.yml +1 -1
- data/data/regions/LA/el.yml +1 -1
- data/data/regions/LA/hr.yml +2 -2
- data/data/regions/LA/ja.yml +2 -2
- data/data/regions/LA/zh-CN.yml +1 -1
- data/data/regions/MC/da.yml +2 -2
- data/data/regions/MC/hi.yml +2 -2
- data/data/regions/MC/lt.yml +2 -2
- data/data/regions/MC/pl.yml +2 -2
- data/data/regions/MC/ru.yml +2 -2
- data/data/regions/MO/cs.yml +2 -2
- data/data/regions/MO/fi.yml +1 -1
- data/data/regions/MO/it.yml +2 -2
- data/data/regions/MO/ja.yml +2 -2
- data/data/regions/MO/ru.yml +2 -2
- data/data/regions/MO/sl.yml +2 -2
- data/data/regions/MO/th.yml +1 -1
- data/data/regions/MX/el.yml +1 -1
- data/data/regions/MX/pl.yml +1 -1
- data/data/regions/MY/da.yml +2 -2
- data/data/regions/MY/el.yml +1 -1
- data/data/regions/MY/es.yml +2 -2
- data/data/regions/MY/hi.yml +2 -2
- data/data/regions/MY/ja.yml +2 -2
- data/data/regions/MY/ko.yml +2 -2
- data/data/regions/MY/nl.yml +2 -2
- data/data/regions/MY/pl.yml +2 -2
- data/data/regions/MY/pt-BR.yml +3 -3
- data/data/regions/MY/pt-PT.yml +1 -1
- data/data/regions/MY/sl.yml +2 -2
- data/data/regions/MY/vi.yml +2 -2
- data/data/regions/MY/zh-CN.yml +2 -2
- data/data/regions/NG/de.yml +2 -2
- data/data/regions/NG/el.yml +1 -1
- data/data/regions/NG/ja.yml +1 -1
- data/data/regions/NG/sv.yml +2 -2
- data/data/regions/NG/zh-CN.yml +1 -1
- data/data/regions/NL/sv.yml +1 -1
- data/data/regions/NL/zh-CN.yml +1 -1
- data/data/regions/NO/sv.yml +1 -1
- data/data/regions/NO/zh-CN.yml +1 -1
- data/data/regions/NZ/pt-PT.yml +2 -2
- data/data/regions/NZ/ru.yml +2 -2
- data/data/regions/NZ/sv.yml +2 -2
- data/data/regions/NZ/tr.yml +2 -2
- data/data/regions/NZ/zh-CN.yml +1 -1
- data/data/regions/RO/cs.yml +2 -2
- data/data/regions/RO/da.yml +2 -2
- data/data/regions/RO/de.yml +1 -1
- data/data/regions/RO/hr.yml +2 -2
- data/data/regions/RO/ja.yml +2 -2
- data/data/regions/RO/ko.yml +2 -2
- data/data/regions/RO/lt.yml +2 -2
- data/data/regions/RO/ms.yml +2 -2
- data/data/regions/RO/nl.yml +2 -2
- data/data/regions/RO/pl.yml +2 -2
- data/data/regions/RO/pt-BR.yml +2 -2
- data/data/regions/RO/tr.yml +2 -2
- data/data/regions/RO/zh-CN.yml +2 -2
- data/data/regions/SE/cs.yml +4 -4
- data/data/regions/SE/da.yml +1 -1
- data/data/regions/SE/de.yml +1 -1
- data/data/regions/SE/el.yml +1 -1
- data/data/regions/SE/es.yml +3 -3
- data/data/regions/SE/hi.yml +2 -2
- data/data/regions/SE/hr.yml +2 -2
- data/data/regions/SE/hu.yml +2 -2
- data/data/regions/SE/it.yml +2 -2
- data/data/regions/SE/ko.yml +2 -2
- data/data/regions/SE/lt.yml +2 -2
- data/data/regions/SE/ms.yml +2 -2
- data/data/regions/SE/nb.yml +1 -1
- data/data/regions/SE/nl.yml +2 -2
- data/data/regions/SE/pl.yml +2 -2
- data/data/regions/SE/pt-BR.yml +1 -1
- data/data/regions/SE/pt-PT.yml +2 -2
- data/data/regions/SE/ru.yml +2 -2
- data/data/regions/SE/sl.yml +2 -2
- data/data/regions/SE/sv.yml +3 -3
- data/data/regions/SE/th.yml +2 -2
- data/data/regions/SE/tr.yml +2 -2
- data/data/regions/SE/vi.yml +2 -2
- data/data/regions/SE/zh-CN.yml +4 -4
- data/data/regions/SV/da.yml +2 -2
- data/data/regions/SV/de.yml +1 -1
- data/data/regions/SV/lt.yml +2 -2
- data/data/regions/SV/nb.yml +1 -1
- data/data/regions/SV/th.yml +1 -1
- data/data/regions/SV/zh-CN.yml +1 -1
- data/data/regions/TH/el.yml +1 -1
- data/data/regions/TH/hr.yml +2 -2
- data/data/regions/TH/ja.yml +1 -1
- data/data/regions/TR/ja.yml +4 -4
- data/data/regions/TW/ja.yml +8 -8
- data/data/regions/US/el.yml +1 -1
- data/data/regions/US/ja.yml +3 -3
- data/data/regions/US/pt-PT.yml +1 -1
- data/data/regions/UY/de.yml +1 -1
- data/data/regions/UY/nb.yml +1 -1
- data/data/regions/UY/th.yml +1 -1
- data/data/regions/VA/fi.yml +1 -1
- data/data/regions/VA/nb.yml +1 -1
- data/data/regions/VA/pt-PT.yml +1 -1
- data/data/regions/VA/th.yml +1 -1
- data/data/regions/VA/vi.yml +1 -1
- data/data/regions/VN/ja.yml +7 -7
- data/data/regions/ZA/de.yml +2 -2
- data/data/regions/ZA/el.yml +1 -1
- data/data/regions/ZA/fi.yml +2 -2
- data/data/regions/ZA/hr.yml +2 -2
- data/data/regions/ZA/ja.yml +2 -2
- data/data/regions/ZA/ro.yml +1 -1
- data/data/regions/ZA/ru.yml +2 -2
- data/data/regions/ZA/sv.yml +2 -2
- data/data/regions/ZA/tr.yml +2 -2
- data/data/regions/ZA/zh-CN.yml +2 -2
- data/data/regions/_default/bg.yml +4 -1
- data/data/regions/_default/cs.yml +2 -0
- data/data/regions/_default/da.yml +3 -0
- data/data/regions/_default/de.yml +5 -3
- data/data/regions/_default/el.yml +6 -3
- data/data/regions/_default/en.yml +3 -0
- data/data/regions/_default/es.yml +4 -0
- data/data/regions/_default/fi.yml +3 -0
- data/data/regions/_default/fr.yml +3 -0
- data/data/regions/_default/hi.yml +5 -2
- data/data/regions/_default/hr.yml +2 -0
- data/data/regions/_default/hu.yml +4 -2
- data/data/regions/_default/id.yml +4 -2
- data/data/regions/_default/it.yml +6 -2
- data/data/regions/_default/ja.yml +39 -37
- data/data/regions/_default/ko.yml +2 -0
- data/data/regions/_default/lt.yml +2 -0
- data/data/regions/_default/ms.yml +5 -2
- data/data/regions/_default/nb.yml +8 -5
- data/data/regions/_default/nl.yml +4 -1
- data/data/regions/_default/pl.yml +4 -2
- data/data/regions/_default/pt-BR.yml +5 -3
- data/data/regions/_default/pt-PT.yml +4 -0
- data/data/regions/_default/ro.yml +5 -1
- data/data/regions/_default/ru.yml +3 -1
- data/data/regions/_default/sk.yml +3 -0
- data/data/regions/_default/sl.yml +3 -1
- data/data/regions/_default/sv.yml +5 -2
- data/data/regions/_default/th.yml +5 -3
- data/data/regions/_default/tr.yml +3 -1
- data/data/regions/_default/vi.yml +4 -2
- data/data/regions/_default/zh-CN.yml +3 -1
- data/data/regions/_default/zh-TW.yml +2 -0
- data/data/regions/paths.txt +1980 -0
- data/lib/worldwide/cldr/fallbacks.rb +15 -1
- data/lib/worldwide/config.rb +3 -3
- data/lib/worldwide/paths.rb +6 -0
- data/lib/worldwide/version.rb +1 -1
- metadata +5 -2
@@ -16,7 +16,8 @@ module Worldwide
|
|
16
16
|
|
17
17
|
def descendants(locale)
|
18
18
|
compute_all_ancestors
|
19
|
-
|
19
|
+
compute_all_descendants
|
20
|
+
@all_descendants[locale.to_sym] || []
|
20
21
|
end
|
21
22
|
|
22
23
|
def defined_parent_locales
|
@@ -57,6 +58,19 @@ module Worldwide
|
|
57
58
|
|
58
59
|
@all_ancestors_computed = true
|
59
60
|
end
|
61
|
+
|
62
|
+
def compute_all_descendants
|
63
|
+
return if @all_descendants
|
64
|
+
|
65
|
+
@all_descendants = {}
|
66
|
+
|
67
|
+
each do |locale, ancestors|
|
68
|
+
ancestors.each do |ancestor|
|
69
|
+
@all_descendants[ancestor] ||= []
|
70
|
+
@all_descendants[ancestor] << locale
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
60
74
|
end
|
61
75
|
end
|
62
76
|
end
|
data/lib/worldwide/config.rb
CHANGED
@@ -106,7 +106,7 @@ module Worldwide
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def cldr_locale_paths(locale_set, components)
|
109
|
-
|
109
|
+
Paths::CLDR_LOCALE_PATHS.select do |path|
|
110
110
|
match = path.match(CLDR_LOCALE_PATH_REGEX)
|
111
111
|
match && locale_set.include?(match[:locale]) && components.include?(match[:component])
|
112
112
|
end
|
@@ -119,14 +119,14 @@ module Worldwide
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def other_data_path(locale_set)
|
122
|
-
|
122
|
+
Paths::OTHER_DATA_PATHS.select do |path|
|
123
123
|
match = path.match(OTHER_LOCALE_PATH_REGEX)
|
124
124
|
match && locale_set.include?(match[:locale])
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
128
|
def regions_data_path(locale_set)
|
129
|
-
|
129
|
+
Paths::REGION_DATA_PATHS.select do |path|
|
130
130
|
match = path.match(REGIONS_LOCALE_PATH_REGEX)
|
131
131
|
match && locale_set.include?(match[:locale])
|
132
132
|
end
|
data/lib/worldwide/paths.rb
CHANGED
@@ -5,10 +5,16 @@ module Worldwide
|
|
5
5
|
GEM_ROOT = File.expand_path(File.join(__dir__, "../.."))
|
6
6
|
DATA_ROOT = File.join(GEM_ROOT, "data")
|
7
7
|
CLDR_ROOT = File.join(GEM_ROOT, "data/cldr")
|
8
|
+
CLDR_LOCALE_PATHS_FILE = File.join(CLDR_ROOT, "paths.txt")
|
9
|
+
CLDR_LOCALE_PATHS = File.read(CLDR_LOCALE_PATHS_FILE).lines.map { |path| File.join(GEM_ROOT, path.strip) }
|
8
10
|
OTHER_DATA_ROOT = File.join(GEM_ROOT, "data/other")
|
11
|
+
OTHER_DATA_PATHS_FILE = File.join(OTHER_DATA_ROOT, "paths.txt")
|
12
|
+
OTHER_DATA_PATHS = File.read(OTHER_DATA_PATHS_FILE).lines.map { |path| File.join(GEM_ROOT, path.strip) }
|
9
13
|
CURRENCY_MAPPINGS = File.join(OTHER_DATA_ROOT, "currency/mappings")
|
10
14
|
GENERATED_LOCALE_ROOT = File.join(OTHER_DATA_ROOT, "generated")
|
11
15
|
REGIONS_ROOT = File.join(DATA_ROOT, "regions")
|
16
|
+
REGION_DATA_PATHS_FILE = File.join(REGIONS_ROOT, "paths.txt")
|
17
|
+
REGION_DATA_PATHS = File.read(REGION_DATA_PATHS_FILE).lines.map { |path| File.join(GEM_ROOT, path.strip) }
|
12
18
|
TIME_ZONE_ROOT = File.join(OTHER_DATA_ROOT, "timezones")
|
13
19
|
end
|
14
20
|
end
|
data/lib/worldwide/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worldwide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -4671,6 +4671,7 @@ files:
|
|
4671
4671
|
- data/cldr/metazones.yml
|
4672
4672
|
- data/cldr/numbering_systems.yml
|
4673
4673
|
- data/cldr/parent_locales.yml
|
4674
|
+
- data/cldr/paths.txt
|
4674
4675
|
- data/cldr/rbnf_root.yml
|
4675
4676
|
- data/cldr/region_currencies.yml
|
4676
4677
|
- data/cldr/region_validity.yml
|
@@ -6119,6 +6120,7 @@ files:
|
|
6119
6120
|
- data/other/names/vi.yml
|
6120
6121
|
- data/other/names/zh-CN.yml
|
6121
6122
|
- data/other/names/zh-TW.yml
|
6123
|
+
- data/other/paths.txt
|
6122
6124
|
- data/other/territories/bg.yml
|
6123
6125
|
- data/other/territories/cs.yml
|
6124
6126
|
- data/other/territories/da.yml
|
@@ -8438,6 +8440,7 @@ files:
|
|
8438
8440
|
- data/regions/_default/vi.yml
|
8439
8441
|
- data/regions/_default/zh-CN.yml
|
8440
8442
|
- data/regions/_default/zh-TW.yml
|
8443
|
+
- data/regions/paths.txt
|
8441
8444
|
- data/top_locales.yml
|
8442
8445
|
- data/world.yml
|
8443
8446
|
- docs/address_format_strings.md
|