worldwide 1.14.1 → 1.14.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -1
  3. data/Gemfile.lock +1 -1
  4. data/data/cldr/paths.txt +4582 -0
  5. data/data/other/paths.txt +1529 -0
  6. data/data/regions/AE/ko.yml +1 -1
  7. data/data/regions/AR/el.yml +1 -1
  8. data/data/regions/AR/fi.yml +2 -2
  9. data/data/regions/AR/hr.yml +2 -2
  10. data/data/regions/AR/th.yml +1 -1
  11. data/data/regions/AR/zh-CN.yml +1 -1
  12. data/data/regions/AU/de.yml +2 -2
  13. data/data/regions/AU/el.yml +1 -1
  14. data/data/regions/AU/fr.yml +1 -1
  15. data/data/regions/AU/hi.yml +2 -2
  16. data/data/regions/AU/hr.yml +1 -1
  17. data/data/regions/AU/hu.yml +2 -2
  18. data/data/regions/AU/ja.yml +6 -6
  19. data/data/regions/AU/ko.yml +4 -4
  20. data/data/regions/AU/nl.yml +2 -2
  21. data/data/regions/AU/pl.yml +2 -2
  22. data/data/regions/AU/pt-BR.yml +3 -3
  23. data/data/regions/AU/pt-PT.yml +1 -1
  24. data/data/regions/AU/ru.yml +4 -4
  25. data/data/regions/AU/sl.yml +2 -2
  26. data/data/regions/AU/sv.yml +2 -2
  27. data/data/regions/AU/th.yml +3 -3
  28. data/data/regions/AU/vi.yml +3 -3
  29. data/data/regions/AU/zh-CN.yml +3 -3
  30. data/data/regions/BR/de.yml +2 -2
  31. data/data/regions/BR/el.yml +1 -1
  32. data/data/regions/BR/nl.yml +1 -1
  33. data/data/regions/BR/sv.yml +1 -1
  34. data/data/regions/BR/th.yml +1 -1
  35. data/data/regions/BR/vi.yml +2 -2
  36. data/data/regions/BR/zh-CN.yml +2 -2
  37. data/data/regions/BV.yml +1 -1
  38. data/data/regions/CA/el.yml +1 -1
  39. data/data/regions/CA/hr.yml +2 -2
  40. data/data/regions/CA/ko.yml +1 -1
  41. data/data/regions/CH/sv.yml +1 -1
  42. data/data/regions/CH/vi.yml +2 -2
  43. data/data/regions/CH/zh-CN.yml +2 -2
  44. data/data/regions/CN/el.yml +1 -1
  45. data/data/regions/CN/fi.yml +2 -2
  46. data/data/regions/CN/hr.yml +2 -2
  47. data/data/regions/CN/ja.yml +2 -2
  48. data/data/regions/CN/th.yml +1 -1
  49. data/data/regions/CN/zh-CN.yml +2 -2
  50. data/data/regions/CO/da.yml +2 -2
  51. data/data/regions/CO/de.yml +2 -2
  52. data/data/regions/CO/el.yml +1 -1
  53. data/data/regions/CO/hr.yml +2 -2
  54. data/data/regions/CO/hu.yml +2 -2
  55. data/data/regions/CO/ja.yml +2 -2
  56. data/data/regions/CO/th.yml +1 -1
  57. data/data/regions/CO/zh-CN.yml +1 -1
  58. data/data/regions/CR/el.yml +1 -1
  59. data/data/regions/CR/hr.yml +2 -2
  60. data/data/regions/DE/hi.yml +2 -2
  61. data/data/regions/DE/sv.yml +2 -2
  62. data/data/regions/DE/vi.yml +2 -2
  63. data/data/regions/DE/zh-CN.yml +2 -2
  64. data/data/regions/DK/hi.yml +2 -2
  65. data/data/regions/DK/sv.yml +1 -1
  66. data/data/regions/DK/vi.yml +2 -2
  67. data/data/regions/DK/zh-CN.yml +1 -1
  68. data/data/regions/DZ/el.yml +1 -1
  69. data/data/regions/DZ/fi.yml +2 -2
  70. data/data/regions/DZ/hr.yml +2 -2
  71. data/data/regions/DZ/ja.yml +2 -2
  72. data/data/regions/DZ/th.yml +1 -1
  73. data/data/regions/DZ/zh-CN.yml +1 -1
  74. data/data/regions/EG/de.yml +2 -2
  75. data/data/regions/EG/hi.yml +2 -2
  76. data/data/regions/EG/hr.yml +1 -1
  77. data/data/regions/EG/pt-BR.yml +2 -2
  78. data/data/regions/EG/ru.yml +2 -2
  79. data/data/regions/EG/sv.yml +2 -2
  80. data/data/regions/EG/zh-CN.yml +1 -1
  81. data/data/regions/ES/el.yml +1 -1
  82. data/data/regions/ES/fi.yml +2 -2
  83. data/data/regions/ES/hr.yml +2 -2
  84. data/data/regions/ES/ja.yml +2 -2
  85. data/data/regions/ES/sv.yml +1 -1
  86. data/data/regions/ES/th.yml +1 -1
  87. data/data/regions/ES/vi.yml +2 -2
  88. data/data/regions/ES/zh-CN.yml +2 -2
  89. data/data/regions/FI.yml +1 -1
  90. data/data/regions/GB/hi.yml +2 -2
  91. data/data/regions/GB/pt-BR.yml +2 -2
  92. data/data/regions/GB/th.yml +1 -1
  93. data/data/regions/GB/vi.yml +2 -2
  94. data/data/regions/GB/zh-CN.yml +1 -1
  95. data/data/regions/HK/cs.yml +2 -2
  96. data/data/regions/HK/fi.yml +2 -2
  97. data/data/regions/HK/fr.yml +2 -2
  98. data/data/regions/HK/ja.yml +4 -4
  99. data/data/regions/HK/ko.yml +2 -2
  100. data/data/regions/HK/ru.yml +2 -2
  101. data/data/regions/HK/tr.yml +2 -2
  102. data/data/regions/HK/zh-CN.yml +1 -1
  103. data/data/regions/HK/zh-TW.yml +2 -2
  104. data/data/regions/ID/el.yml +1 -1
  105. data/data/regions/ID/fi.yml +2 -2
  106. data/data/regions/ID/hr.yml +2 -2
  107. data/data/regions/ID/ja.yml +2 -2
  108. data/data/regions/ID/th.yml +1 -1
  109. data/data/regions/ID/zh-CN.yml +1 -1
  110. data/data/regions/IE/cs.yml +2 -2
  111. data/data/regions/IE/da.yml +2 -2
  112. data/data/regions/IE/fi.yml +2 -2
  113. data/data/regions/IE/hr.yml +1 -1
  114. data/data/regions/IE/ja.yml +2 -2
  115. data/data/regions/IE/ko.yml +2 -2
  116. data/data/regions/IE/ms.yml +2 -2
  117. data/data/regions/IE/nl.yml +2 -2
  118. data/data/regions/IE/pl.yml +1 -1
  119. data/data/regions/IE/pt-BR.yml +2 -2
  120. data/data/regions/IE/th.yml +1 -1
  121. data/data/regions/IE/tr.yml +2 -2
  122. data/data/regions/IE/zh-CN.yml +2 -2
  123. data/data/regions/IN/bg.yml +2 -2
  124. data/data/regions/IN/cs.yml +2 -2
  125. data/data/regions/IN/da.yml +2 -2
  126. data/data/regions/IN/de.yml +2 -2
  127. data/data/regions/IN/el.yml +1 -1
  128. data/data/regions/IN/fi.yml +2 -2
  129. data/data/regions/IN/fr.yml +2 -2
  130. data/data/regions/IN/it.yml +1 -1
  131. data/data/regions/IN/ja.yml +2 -2
  132. data/data/regions/IN/pt-BR.yml +2 -2
  133. data/data/regions/IN/ru.yml +2 -2
  134. data/data/regions/IN/sv.yml +2 -2
  135. data/data/regions/IN/th.yml +1 -1
  136. data/data/regions/IN/zh-CN.yml +3 -3
  137. data/data/regions/IN/zh-TW.yml +2 -2
  138. data/data/regions/IT/el.yml +1 -1
  139. data/data/regions/IT/fi.yml +2 -2
  140. data/data/regions/IT/hr.yml +2 -2
  141. data/data/regions/IT/hu.yml +2 -2
  142. data/data/regions/IT/ja.yml +2 -2
  143. data/data/regions/IT/sv.yml +1 -1
  144. data/data/regions/IT/th.yml +1 -1
  145. data/data/regions/IT/vi.yml +2 -2
  146. data/data/regions/IT/zh-CN.yml +2 -2
  147. data/data/regions/JP/el.yml +2 -2
  148. data/data/regions/JP/es.yml +2 -2
  149. data/data/regions/JP/hi.yml +4 -4
  150. data/data/regions/JP/hu.yml +2 -2
  151. data/data/regions/JP/ko.yml +2 -2
  152. data/data/regions/JP/pl.yml +2 -2
  153. data/data/regions/JP/tr.yml +4 -4
  154. data/data/regions/JP/zh-CN.yml +3 -3
  155. data/data/regions/KR/el.yml +1 -1
  156. data/data/regions/KR/hr.yml +2 -2
  157. data/data/regions/KR/ja.yml +2 -2
  158. data/data/regions/KR/zh-CN.yml +1 -1
  159. data/data/regions/KW/hr.yml +1 -1
  160. data/data/regions/LA/el.yml +1 -1
  161. data/data/regions/LA/hr.yml +2 -2
  162. data/data/regions/LA/ja.yml +2 -2
  163. data/data/regions/LA/zh-CN.yml +1 -1
  164. data/data/regions/MC/da.yml +2 -2
  165. data/data/regions/MC/hi.yml +2 -2
  166. data/data/regions/MC/lt.yml +2 -2
  167. data/data/regions/MC/pl.yml +2 -2
  168. data/data/regions/MC/ru.yml +2 -2
  169. data/data/regions/MO/cs.yml +2 -2
  170. data/data/regions/MO/fi.yml +1 -1
  171. data/data/regions/MO/it.yml +2 -2
  172. data/data/regions/MO/ja.yml +2 -2
  173. data/data/regions/MO/ru.yml +2 -2
  174. data/data/regions/MO/sl.yml +2 -2
  175. data/data/regions/MO/th.yml +1 -1
  176. data/data/regions/MX/el.yml +1 -1
  177. data/data/regions/MX/pl.yml +1 -1
  178. data/data/regions/MY/da.yml +2 -2
  179. data/data/regions/MY/el.yml +1 -1
  180. data/data/regions/MY/es.yml +2 -2
  181. data/data/regions/MY/hi.yml +2 -2
  182. data/data/regions/MY/ja.yml +2 -2
  183. data/data/regions/MY/ko.yml +2 -2
  184. data/data/regions/MY/nl.yml +2 -2
  185. data/data/regions/MY/pl.yml +2 -2
  186. data/data/regions/MY/pt-BR.yml +3 -3
  187. data/data/regions/MY/pt-PT.yml +1 -1
  188. data/data/regions/MY/sl.yml +2 -2
  189. data/data/regions/MY/vi.yml +2 -2
  190. data/data/regions/MY/zh-CN.yml +2 -2
  191. data/data/regions/NG/de.yml +2 -2
  192. data/data/regions/NG/el.yml +1 -1
  193. data/data/regions/NG/ja.yml +1 -1
  194. data/data/regions/NG/sv.yml +2 -2
  195. data/data/regions/NG/zh-CN.yml +1 -1
  196. data/data/regions/NL/sv.yml +1 -1
  197. data/data/regions/NL/zh-CN.yml +1 -1
  198. data/data/regions/NO/sv.yml +1 -1
  199. data/data/regions/NO/zh-CN.yml +1 -1
  200. data/data/regions/NZ/pt-PT.yml +2 -2
  201. data/data/regions/NZ/ru.yml +2 -2
  202. data/data/regions/NZ/sv.yml +2 -2
  203. data/data/regions/NZ/tr.yml +2 -2
  204. data/data/regions/NZ/zh-CN.yml +1 -1
  205. data/data/regions/RO/cs.yml +2 -2
  206. data/data/regions/RO/da.yml +2 -2
  207. data/data/regions/RO/de.yml +1 -1
  208. data/data/regions/RO/hr.yml +2 -2
  209. data/data/regions/RO/ja.yml +2 -2
  210. data/data/regions/RO/ko.yml +2 -2
  211. data/data/regions/RO/lt.yml +2 -2
  212. data/data/regions/RO/ms.yml +2 -2
  213. data/data/regions/RO/nl.yml +2 -2
  214. data/data/regions/RO/pl.yml +2 -2
  215. data/data/regions/RO/pt-BR.yml +2 -2
  216. data/data/regions/RO/tr.yml +2 -2
  217. data/data/regions/RO/zh-CN.yml +2 -2
  218. data/data/regions/SE/cs.yml +4 -4
  219. data/data/regions/SE/da.yml +1 -1
  220. data/data/regions/SE/de.yml +1 -1
  221. data/data/regions/SE/el.yml +1 -1
  222. data/data/regions/SE/es.yml +3 -3
  223. data/data/regions/SE/hi.yml +2 -2
  224. data/data/regions/SE/hr.yml +2 -2
  225. data/data/regions/SE/hu.yml +2 -2
  226. data/data/regions/SE/it.yml +2 -2
  227. data/data/regions/SE/ko.yml +2 -2
  228. data/data/regions/SE/lt.yml +2 -2
  229. data/data/regions/SE/ms.yml +2 -2
  230. data/data/regions/SE/nb.yml +1 -1
  231. data/data/regions/SE/nl.yml +2 -2
  232. data/data/regions/SE/pl.yml +2 -2
  233. data/data/regions/SE/pt-BR.yml +1 -1
  234. data/data/regions/SE/pt-PT.yml +2 -2
  235. data/data/regions/SE/ru.yml +2 -2
  236. data/data/regions/SE/sl.yml +2 -2
  237. data/data/regions/SE/sv.yml +3 -3
  238. data/data/regions/SE/th.yml +2 -2
  239. data/data/regions/SE/tr.yml +2 -2
  240. data/data/regions/SE/vi.yml +2 -2
  241. data/data/regions/SE/zh-CN.yml +4 -4
  242. data/data/regions/SV/da.yml +2 -2
  243. data/data/regions/SV/de.yml +1 -1
  244. data/data/regions/SV/lt.yml +2 -2
  245. data/data/regions/SV/nb.yml +1 -1
  246. data/data/regions/SV/th.yml +1 -1
  247. data/data/regions/SV/zh-CN.yml +1 -1
  248. data/data/regions/TH/el.yml +1 -1
  249. data/data/regions/TH/hr.yml +2 -2
  250. data/data/regions/TH/ja.yml +1 -1
  251. data/data/regions/TR/ja.yml +4 -4
  252. data/data/regions/TW/ja.yml +8 -8
  253. data/data/regions/US/el.yml +1 -1
  254. data/data/regions/US/ja.yml +3 -3
  255. data/data/regions/US/pt-PT.yml +1 -1
  256. data/data/regions/UY/de.yml +1 -1
  257. data/data/regions/UY/nb.yml +1 -1
  258. data/data/regions/UY/th.yml +1 -1
  259. data/data/regions/VA/fi.yml +1 -1
  260. data/data/regions/VA/nb.yml +1 -1
  261. data/data/regions/VA/pt-PT.yml +1 -1
  262. data/data/regions/VA/th.yml +1 -1
  263. data/data/regions/VA/vi.yml +1 -1
  264. data/data/regions/VN/ja.yml +7 -7
  265. data/data/regions/ZA/de.yml +2 -2
  266. data/data/regions/ZA/el.yml +1 -1
  267. data/data/regions/ZA/fi.yml +2 -2
  268. data/data/regions/ZA/hr.yml +2 -2
  269. data/data/regions/ZA/ja.yml +2 -2
  270. data/data/regions/ZA/ro.yml +1 -1
  271. data/data/regions/ZA/ru.yml +2 -2
  272. data/data/regions/ZA/sv.yml +2 -2
  273. data/data/regions/ZA/tr.yml +2 -2
  274. data/data/regions/ZA/zh-CN.yml +2 -2
  275. data/data/regions/_default/bg.yml +4 -1
  276. data/data/regions/_default/cs.yml +2 -0
  277. data/data/regions/_default/da.yml +3 -0
  278. data/data/regions/_default/de.yml +5 -3
  279. data/data/regions/_default/el.yml +6 -3
  280. data/data/regions/_default/en.yml +3 -0
  281. data/data/regions/_default/es.yml +4 -0
  282. data/data/regions/_default/fi.yml +3 -0
  283. data/data/regions/_default/fr.yml +3 -0
  284. data/data/regions/_default/hi.yml +5 -2
  285. data/data/regions/_default/hr.yml +2 -0
  286. data/data/regions/_default/hu.yml +4 -2
  287. data/data/regions/_default/id.yml +4 -2
  288. data/data/regions/_default/it.yml +6 -2
  289. data/data/regions/_default/ja.yml +39 -37
  290. data/data/regions/_default/ko.yml +2 -0
  291. data/data/regions/_default/lt.yml +2 -0
  292. data/data/regions/_default/ms.yml +5 -2
  293. data/data/regions/_default/nb.yml +8 -5
  294. data/data/regions/_default/nl.yml +4 -1
  295. data/data/regions/_default/pl.yml +4 -2
  296. data/data/regions/_default/pt-BR.yml +5 -3
  297. data/data/regions/_default/pt-PT.yml +4 -0
  298. data/data/regions/_default/ro.yml +5 -1
  299. data/data/regions/_default/ru.yml +3 -1
  300. data/data/regions/_default/sk.yml +3 -0
  301. data/data/regions/_default/sl.yml +3 -1
  302. data/data/regions/_default/sv.yml +5 -2
  303. data/data/regions/_default/th.yml +5 -3
  304. data/data/regions/_default/tr.yml +3 -1
  305. data/data/regions/_default/vi.yml +4 -2
  306. data/data/regions/_default/zh-CN.yml +3 -1
  307. data/data/regions/_default/zh-TW.yml +2 -0
  308. data/data/regions/paths.txt +1980 -0
  309. data/lib/worldwide/cldr/fallbacks.rb +15 -1
  310. data/lib/worldwide/config.rb +3 -3
  311. data/lib/worldwide/paths.rb +6 -0
  312. data/lib/worldwide/version.rb +1 -1
  313. metadata +5 -2
@@ -16,7 +16,8 @@ module Worldwide
16
16
 
17
17
  def descendants(locale)
18
18
  compute_all_ancestors
19
- self.select { |_loc, loc_ancestors| loc_ancestors.include?(locale.to_sym) }.keys
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
@@ -106,7 +106,7 @@ module Worldwide
106
106
  end
107
107
 
108
108
  def cldr_locale_paths(locale_set, components)
109
- Dir[File.join(Paths::CLDR_ROOT, "locales", "*", "*.{yml,rb}")].select do |path|
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
- Dir[File.join(Worldwide::Paths::OTHER_DATA_ROOT, "*", "*.{yml,rb}")].select do |path|
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
- Dir[File.join(Worldwide::Paths::REGIONS_ROOT, "*", "*.{yml}")].select do |path|
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "1.14.1"
4
+ VERSION = "1.14.4"
5
5
  end
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.1
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-08 00:00:00.000000000 Z
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