worldwide 1.5.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (433) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/npm-release.yml +5 -1
  3. data/CHANGELOG.md +9 -2
  4. data/Gemfile.lock +2 -1
  5. data/README.md +9 -2
  6. data/db/data/regions/AE/fi.yml +2 -2
  7. data/db/data/regions/AE/ko.yml +2 -2
  8. data/db/data/regions/AE/ms.yml +2 -2
  9. data/db/data/regions/AE/zh-CN.yml +1 -1
  10. data/db/data/regions/AE.yml +5 -4
  11. data/db/data/regions/AT/bg.yml +0 -1
  12. data/db/data/regions/AT/cs.yml +0 -1
  13. data/db/data/regions/AT/da.yml +0 -1
  14. data/db/data/regions/AT/de.yml +0 -1
  15. data/db/data/regions/AT/el.yml +0 -1
  16. data/db/data/regions/AT/es.yml +0 -1
  17. data/db/data/regions/AT/fi.yml +0 -1
  18. data/db/data/regions/AT/fr.yml +0 -1
  19. data/db/data/regions/AT/hi.yml +0 -1
  20. data/db/data/regions/AT/hr.yml +0 -1
  21. data/db/data/regions/AT/hu.yml +0 -1
  22. data/db/data/regions/AT/id.yml +0 -1
  23. data/db/data/regions/AT/it.yml +0 -1
  24. data/db/data/regions/AT/ja.yml +0 -1
  25. data/db/data/regions/AT/ko.yml +0 -1
  26. data/db/data/regions/AT/lt.yml +0 -1
  27. data/db/data/regions/AT/ms.yml +0 -1
  28. data/db/data/regions/AT/nb.yml +0 -1
  29. data/db/data/regions/AT/nl.yml +0 -1
  30. data/db/data/regions/AT/pl.yml +0 -1
  31. data/db/data/regions/AT/pt-BR.yml +4 -5
  32. data/db/data/regions/AT/pt-PT.yml +0 -1
  33. data/db/data/regions/AT/ro.yml +0 -1
  34. data/db/data/regions/AT/ru.yml +0 -1
  35. data/db/data/regions/AT/sk.yml +0 -1
  36. data/db/data/regions/AT/sl.yml +0 -1
  37. data/db/data/regions/AT/sv.yml +1 -2
  38. data/db/data/regions/AT/th.yml +0 -1
  39. data/db/data/regions/AT/tr.yml +0 -1
  40. data/db/data/regions/AT/vi.yml +2 -3
  41. data/db/data/regions/AT/zh-CN.yml +2 -3
  42. data/db/data/regions/AT/zh-TW.yml +0 -1
  43. data/db/data/regions/BE.yml +5 -4
  44. data/db/data/regions/BR/pt-BR.yml +2 -2
  45. data/db/data/regions/BR.yml +9 -8
  46. data/db/data/regions/CA/bg.yml +0 -1
  47. data/db/data/regions/CA/cs.yml +0 -1
  48. data/db/data/regions/CA/da.yml +0 -1
  49. data/db/data/regions/CA/de.yml +0 -1
  50. data/db/data/regions/CA/el.yml +1 -2
  51. data/db/data/regions/CA/es.yml +0 -1
  52. data/db/data/regions/CA/fi.yml +0 -1
  53. data/db/data/regions/CA/fr.yml +0 -1
  54. data/db/data/regions/CA/hi.yml +0 -1
  55. data/db/data/regions/CA/hr.yml +1 -2
  56. data/db/data/regions/CA/hu.yml +0 -1
  57. data/db/data/regions/CA/id.yml +0 -1
  58. data/db/data/regions/CA/it.yml +0 -1
  59. data/db/data/regions/CA/ja.yml +2 -3
  60. data/db/data/regions/CA/ko.yml +1 -2
  61. data/db/data/regions/CA/lt.yml +0 -1
  62. data/db/data/regions/CA/ms.yml +0 -1
  63. data/db/data/regions/CA/nb.yml +0 -1
  64. data/db/data/regions/CA/nl.yml +0 -1
  65. data/db/data/regions/CA/pl.yml +0 -1
  66. data/db/data/regions/CA/pt-BR.yml +0 -1
  67. data/db/data/regions/CA/pt-PT.yml +0 -1
  68. data/db/data/regions/CA/ro.yml +0 -1
  69. data/db/data/regions/CA/ru.yml +0 -1
  70. data/db/data/regions/CA/sk.yml +0 -1
  71. data/db/data/regions/CA/sl.yml +0 -1
  72. data/db/data/regions/CA/sv.yml +0 -1
  73. data/db/data/regions/CA/th.yml +1 -2
  74. data/db/data/regions/CA/tr.yml +0 -1
  75. data/db/data/regions/CA/vi.yml +0 -1
  76. data/db/data/regions/CA/zh-CN.yml +1 -2
  77. data/db/data/regions/CA/zh-TW.yml +0 -1
  78. data/db/data/regions/CH/pt-BR.yml +2 -2
  79. data/db/data/regions/CL/bg.yml +0 -14
  80. data/db/data/regions/CL/cs.yml +0 -14
  81. data/db/data/regions/CL/da.yml +0 -13
  82. data/db/data/regions/CL/de.yml +0 -14
  83. data/db/data/regions/CL/el.yml +0 -16
  84. data/db/data/regions/CL/es.yml +0 -15
  85. data/db/data/regions/CL/fi.yml +0 -13
  86. data/db/data/regions/CL/fr.yml +0 -13
  87. data/db/data/regions/CL/hi.yml +0 -14
  88. data/db/data/regions/CL/hr.yml +0 -15
  89. data/db/data/regions/CL/hu.yml +0 -15
  90. data/db/data/regions/CL/id.yml +0 -13
  91. data/db/data/regions/CL/it.yml +0 -14
  92. data/db/data/regions/CL/ja.yml +0 -11
  93. data/db/data/regions/CL/ko.yml +0 -11
  94. data/db/data/regions/CL/lt.yml +0 -15
  95. data/db/data/regions/CL/ms.yml +0 -13
  96. data/db/data/regions/CL/nb.yml +0 -14
  97. data/db/data/regions/CL/nl.yml +0 -13
  98. data/db/data/regions/CL/pl.yml +0 -14
  99. data/db/data/regions/CL/pt-BR.yml +0 -13
  100. data/db/data/regions/CL/pt-PT.yml +0 -13
  101. data/db/data/regions/CL/ro.yml +0 -14
  102. data/db/data/regions/CL/ru.yml +0 -14
  103. data/db/data/regions/CL/sk.yml +0 -13
  104. data/db/data/regions/CL/sl.yml +0 -15
  105. data/db/data/regions/CL/sv.yml +0 -13
  106. data/db/data/regions/CL/th.yml +0 -12
  107. data/db/data/regions/CL/tr.yml +0 -12
  108. data/db/data/regions/CL/vi.yml +0 -12
  109. data/db/data/regions/CL/zh-CN.yml +0 -11
  110. data/db/data/regions/CL/zh-TW.yml +0 -11
  111. data/db/data/regions/CL.yml +9 -8
  112. data/db/data/regions/CO.yml +5 -4
  113. data/db/data/regions/CR/el.yml +1 -1
  114. data/db/data/regions/CR/hr.yml +1 -1
  115. data/db/data/regions/CR/ja.yml +2 -2
  116. data/db/data/regions/CR/zh-CN.yml +1 -1
  117. data/db/data/regions/CR.yml +5 -4
  118. data/db/data/regions/DE/pt-BR.yml +2 -2
  119. data/db/data/regions/DK/pt-BR.yml +2 -2
  120. data/db/data/regions/ES/pt-BR.yml +2 -2
  121. data/db/data/regions/ES.yml +5 -4
  122. data/db/data/regions/ID.yml +5 -4
  123. data/db/data/regions/IL.yml +5 -4
  124. data/db/data/regions/IT/pt-BR.yml +2 -2
  125. data/db/data/regions/JP.yml +1 -0
  126. data/db/data/regions/KW/hr.yml +1 -1
  127. data/db/data/regions/KW/zh-CN.yml +1 -1
  128. data/db/data/regions/KW.yml +5 -4
  129. data/db/data/regions/MX/bg.yml +0 -15
  130. data/db/data/regions/MX/cs.yml +0 -14
  131. data/db/data/regions/MX/da.yml +0 -13
  132. data/db/data/regions/MX/de.yml +2 -16
  133. data/db/data/regions/MX/el.yml +1 -16
  134. data/db/data/regions/MX/es.yml +0 -17
  135. data/db/data/regions/MX/fi.yml +0 -16
  136. data/db/data/regions/MX/fr.yml +0 -13
  137. data/db/data/regions/MX/hi.yml +0 -14
  138. data/db/data/regions/MX/hr.yml +0 -15
  139. data/db/data/regions/MX/hu.yml +0 -15
  140. data/db/data/regions/MX/id.yml +0 -13
  141. data/db/data/regions/MX/it.yml +0 -15
  142. data/db/data/regions/MX/ja.yml +0 -11
  143. data/db/data/regions/MX/ko.yml +0 -12
  144. data/db/data/regions/MX/lt.yml +0 -16
  145. data/db/data/regions/MX/ms.yml +0 -14
  146. data/db/data/regions/MX/nb.yml +0 -14
  147. data/db/data/regions/MX/nl.yml +0 -13
  148. data/db/data/regions/MX/pl.yml +0 -14
  149. data/db/data/regions/MX/pt-BR.yml +4 -17
  150. data/db/data/regions/MX/pt-PT.yml +0 -14
  151. data/db/data/regions/MX/ro.yml +0 -16
  152. data/db/data/regions/MX/ru.yml +0 -15
  153. data/db/data/regions/MX/sk.yml +0 -13
  154. data/db/data/regions/MX/sl.yml +0 -15
  155. data/db/data/regions/MX/sv.yml +3 -16
  156. data/db/data/regions/MX/th.yml +0 -12
  157. data/db/data/regions/MX/tr.yml +0 -12
  158. data/db/data/regions/MX/vi.yml +0 -14
  159. data/db/data/regions/MX/zh-CN.yml +2 -13
  160. data/db/data/regions/MX/zh-TW.yml +0 -11
  161. data/db/data/regions/MX.yml +9 -8
  162. data/db/data/regions/NL/pt-BR.yml +2 -2
  163. data/db/data/regions/NL.yml +5 -4
  164. data/db/data/regions/NO/pt-BR.yml +2 -2
  165. data/db/data/regions/PA.yml +5 -4
  166. data/db/data/regions/PE.yml +5 -4
  167. data/db/data/regions/PH/bg.yml +0 -15
  168. data/db/data/regions/PH/cs.yml +0 -14
  169. data/db/data/regions/PH/da.yml +0 -13
  170. data/db/data/regions/PH/de.yml +0 -14
  171. data/db/data/regions/PH/el.yml +0 -15
  172. data/db/data/regions/PH/es.yml +0 -17
  173. data/db/data/regions/PH/fi.yml +0 -14
  174. data/db/data/regions/PH/fr.yml +0 -13
  175. data/db/data/regions/PH/hi.yml +0 -14
  176. data/db/data/regions/PH/hr.yml +0 -15
  177. data/db/data/regions/PH/hu.yml +0 -17
  178. data/db/data/regions/PH/id.yml +0 -14
  179. data/db/data/regions/PH/it.yml +0 -15
  180. data/db/data/regions/PH/ja.yml +0 -11
  181. data/db/data/regions/PH/ko.yml +0 -12
  182. data/db/data/regions/PH/lt.yml +0 -15
  183. data/db/data/regions/PH/ms.yml +0 -14
  184. data/db/data/regions/PH/nb.yml +0 -14
  185. data/db/data/regions/PH/nl.yml +0 -13
  186. data/db/data/regions/PH/pl.yml +0 -14
  187. data/db/data/regions/PH/pt-BR.yml +0 -13
  188. data/db/data/regions/PH/pt-PT.yml +0 -13
  189. data/db/data/regions/PH/ro.yml +0 -16
  190. data/db/data/regions/PH/ru.yml +0 -14
  191. data/db/data/regions/PH/sk.yml +0 -13
  192. data/db/data/regions/PH/sl.yml +0 -15
  193. data/db/data/regions/PH/sv.yml +0 -14
  194. data/db/data/regions/PH/th.yml +0 -12
  195. data/db/data/regions/PH/tr.yml +0 -12
  196. data/db/data/regions/PH/vi.yml +0 -14
  197. data/db/data/regions/PH/zh-CN.yml +0 -11
  198. data/db/data/regions/PH/zh-TW.yml +0 -11
  199. data/db/data/regions/PH.yml +5 -4
  200. data/db/data/regions/SA.yml +5 -4
  201. data/db/data/regions/SE/pt-BR.yml +2 -2
  202. data/db/data/regions/TH/bg.yml +0 -1
  203. data/db/data/regions/TH/cs.yml +0 -1
  204. data/db/data/regions/TH/da.yml +0 -1
  205. data/db/data/regions/TH/de.yml +0 -1
  206. data/db/data/regions/TH/el.yml +1 -2
  207. data/db/data/regions/TH/es.yml +0 -1
  208. data/db/data/regions/TH/fi.yml +0 -1
  209. data/db/data/regions/TH/fr.yml +0 -1
  210. data/db/data/regions/TH/hi.yml +0 -1
  211. data/db/data/regions/TH/hr.yml +1 -2
  212. data/db/data/regions/TH/hu.yml +2 -3
  213. data/db/data/regions/TH/id.yml +0 -1
  214. data/db/data/regions/TH/it.yml +0 -1
  215. data/db/data/regions/TH/ja.yml +2 -3
  216. data/db/data/regions/TH/ko.yml +0 -1
  217. data/db/data/regions/TH/lt.yml +0 -1
  218. data/db/data/regions/TH/ms.yml +0 -1
  219. data/db/data/regions/TH/nb.yml +0 -1
  220. data/db/data/regions/TH/nl.yml +0 -1
  221. data/db/data/regions/TH/pl.yml +0 -1
  222. data/db/data/regions/TH/pt-BR.yml +0 -1
  223. data/db/data/regions/TH/pt-PT.yml +0 -1
  224. data/db/data/regions/TH/ro.yml +0 -1
  225. data/db/data/regions/TH/ru.yml +0 -1
  226. data/db/data/regions/TH/sk.yml +0 -1
  227. data/db/data/regions/TH/sl.yml +0 -1
  228. data/db/data/regions/TH/sv.yml +0 -1
  229. data/db/data/regions/TH/th.yml +0 -1
  230. data/db/data/regions/TH/tr.yml +0 -1
  231. data/db/data/regions/TH/vi.yml +0 -1
  232. data/db/data/regions/TH/zh-CN.yml +1 -2
  233. data/db/data/regions/TH/zh-TW.yml +2 -3
  234. data/db/data/regions/TR/bg.yml +0 -1
  235. data/db/data/regions/TR/cs.yml +0 -1
  236. data/db/data/regions/TR/da.yml +0 -1
  237. data/db/data/regions/TR/de.yml +0 -1
  238. data/db/data/regions/TR/el.yml +0 -1
  239. data/db/data/regions/TR/es.yml +0 -1
  240. data/db/data/regions/TR/fi.yml +0 -1
  241. data/db/data/regions/TR/fr.yml +0 -1
  242. data/db/data/regions/TR/hi.yml +0 -1
  243. data/db/data/regions/TR/hr.yml +0 -1
  244. data/db/data/regions/TR/hu.yml +0 -1
  245. data/db/data/regions/TR/id.yml +0 -1
  246. data/db/data/regions/TR/it.yml +0 -1
  247. data/db/data/regions/TR/ja.yml +0 -1
  248. data/db/data/regions/TR/ko.yml +0 -1
  249. data/db/data/regions/TR/lt.yml +0 -1
  250. data/db/data/regions/TR/ms.yml +0 -1
  251. data/db/data/regions/TR/nb.yml +0 -1
  252. data/db/data/regions/TR/nl.yml +0 -1
  253. data/db/data/regions/TR/pl.yml +0 -1
  254. data/db/data/regions/TR/pt-BR.yml +0 -1
  255. data/db/data/regions/TR/pt-PT.yml +0 -1
  256. data/db/data/regions/TR/ro.yml +0 -1
  257. data/db/data/regions/TR/ru.yml +0 -1
  258. data/db/data/regions/TR/sk.yml +0 -1
  259. data/db/data/regions/TR/sl.yml +0 -1
  260. data/db/data/regions/TR/sv.yml +0 -1
  261. data/db/data/regions/TR/th.yml +0 -1
  262. data/db/data/regions/TR/tr.yml +0 -1
  263. data/db/data/regions/TR/vi.yml +0 -1
  264. data/db/data/regions/TR/zh-CN.yml +0 -1
  265. data/db/data/regions/TR/zh-TW.yml +0 -1
  266. data/db/data/regions/TR.yml +5 -4
  267. data/db/data/regions/TW/bg.yml +0 -1
  268. data/db/data/regions/TW/cs.yml +0 -1
  269. data/db/data/regions/TW/da.yml +0 -1
  270. data/db/data/regions/TW/de.yml +0 -1
  271. data/db/data/regions/TW/el.yml +0 -1
  272. data/db/data/regions/TW/es.yml +0 -1
  273. data/db/data/regions/TW/fi.yml +0 -1
  274. data/db/data/regions/TW/fr.yml +0 -1
  275. data/db/data/regions/TW/hi.yml +0 -1
  276. data/db/data/regions/TW/hr.yml +0 -1
  277. data/db/data/regions/TW/hu.yml +0 -1
  278. data/db/data/regions/TW/id.yml +0 -1
  279. data/db/data/regions/TW/it.yml +0 -1
  280. data/db/data/regions/TW/ja.yml +0 -1
  281. data/db/data/regions/TW/ko.yml +0 -1
  282. data/db/data/regions/TW/lt.yml +0 -1
  283. data/db/data/regions/TW/ms.yml +0 -1
  284. data/db/data/regions/TW/nb.yml +0 -1
  285. data/db/data/regions/TW/nl.yml +0 -1
  286. data/db/data/regions/TW/pl.yml +0 -1
  287. data/db/data/regions/TW/pt-BR.yml +0 -1
  288. data/db/data/regions/TW/pt-PT.yml +0 -1
  289. data/db/data/regions/TW/ro.yml +0 -1
  290. data/db/data/regions/TW/ru.yml +0 -1
  291. data/db/data/regions/TW/sk.yml +0 -1
  292. data/db/data/regions/TW/sl.yml +0 -1
  293. data/db/data/regions/TW/sv.yml +0 -1
  294. data/db/data/regions/TW/th.yml +0 -1
  295. data/db/data/regions/TW/tr.yml +0 -1
  296. data/db/data/regions/TW/vi.yml +0 -1
  297. data/db/data/regions/TW/zh-CN.yml +0 -1
  298. data/db/data/regions/TW/zh-TW.yml +0 -1
  299. data/db/data/regions/TW.yml +9 -3
  300. data/db/data/regions/US/bg.yml +0 -2
  301. data/db/data/regions/US/cs.yml +0 -2
  302. data/db/data/regions/US/da.yml +0 -2
  303. data/db/data/regions/US/de.yml +4 -6
  304. data/db/data/regions/US/el.yml +1 -3
  305. data/db/data/regions/US/es.yml +0 -2
  306. data/db/data/regions/US/fi.yml +0 -2
  307. data/db/data/regions/US/fr.yml +0 -2
  308. data/db/data/regions/US/hi.yml +2 -4
  309. data/db/data/regions/US/hr.yml +0 -2
  310. data/db/data/regions/US/hu.yml +0 -2
  311. data/db/data/regions/US/id.yml +0 -2
  312. data/db/data/regions/US/it.yml +0 -2
  313. data/db/data/regions/US/ja.yml +1 -3
  314. data/db/data/regions/US/ko.yml +0 -2
  315. data/db/data/regions/US/lt.yml +2 -4
  316. data/db/data/regions/US/ms.yml +0 -2
  317. data/db/data/regions/US/nb.yml +0 -2
  318. data/db/data/regions/US/nl.yml +0 -2
  319. data/db/data/regions/US/pl.yml +0 -2
  320. data/db/data/regions/US/pt-BR.yml +0 -2
  321. data/db/data/regions/US/pt-PT.yml +1 -3
  322. data/db/data/regions/US/ro.yml +0 -2
  323. data/db/data/regions/US/ru.yml +0 -2
  324. data/db/data/regions/US/sk.yml +0 -2
  325. data/db/data/regions/US/sl.yml +0 -2
  326. data/db/data/regions/US/sv.yml +2 -4
  327. data/db/data/regions/US/th.yml +0 -2
  328. data/db/data/regions/US/tr.yml +0 -2
  329. data/db/data/regions/US/vi.yml +0 -2
  330. data/db/data/regions/US/zh-CN.yml +2 -4
  331. data/db/data/regions/US/zh-TW.yml +0 -2
  332. data/db/data/regions/UY/bg.yml +0 -1
  333. data/db/data/regions/UY/cs.yml +0 -1
  334. data/db/data/regions/UY/da.yml +2 -3
  335. data/db/data/regions/UY/de.yml +1 -2
  336. data/db/data/regions/UY/el.yml +0 -1
  337. data/db/data/regions/UY/es.yml +0 -1
  338. data/db/data/regions/UY/fi.yml +0 -1
  339. data/db/data/regions/UY/fr.yml +0 -1
  340. data/db/data/regions/UY/hi.yml +0 -1
  341. data/db/data/regions/UY/hr.yml +0 -1
  342. data/db/data/regions/UY/hu.yml +0 -1
  343. data/db/data/regions/UY/id.yml +0 -1
  344. data/db/data/regions/UY/it.yml +0 -1
  345. data/db/data/regions/UY/ja.yml +0 -1
  346. data/db/data/regions/UY/ko.yml +0 -1
  347. data/db/data/regions/UY/lt.yml +2 -3
  348. data/db/data/regions/UY/ms.yml +0 -1
  349. data/db/data/regions/UY/nb.yml +1 -2
  350. data/db/data/regions/UY/nl.yml +0 -1
  351. data/db/data/regions/UY/pl.yml +0 -1
  352. data/db/data/regions/UY/pt-BR.yml +0 -1
  353. data/db/data/regions/UY/pt-PT.yml +0 -1
  354. data/db/data/regions/UY/ro.yml +0 -1
  355. data/db/data/regions/UY/ru.yml +0 -1
  356. data/db/data/regions/UY/sk.yml +0 -1
  357. data/db/data/regions/UY/sl.yml +0 -1
  358. data/db/data/regions/UY/sv.yml +0 -1
  359. data/db/data/regions/UY/th.yml +1 -2
  360. data/db/data/regions/UY/tr.yml +0 -1
  361. data/db/data/regions/UY/vi.yml +0 -1
  362. data/db/data/regions/UY/zh-CN.yml +1 -2
  363. data/db/data/regions/UY/zh-TW.yml +0 -1
  364. data/db/data/regions/VN/bg.yml +0 -2
  365. data/db/data/regions/VN/cs.yml +0 -2
  366. data/db/data/regions/VN/da.yml +0 -2
  367. data/db/data/regions/VN/de.yml +0 -2
  368. data/db/data/regions/VN/el.yml +0 -2
  369. data/db/data/regions/VN/es.yml +0 -3
  370. data/db/data/regions/VN/fi.yml +0 -3
  371. data/db/data/regions/VN/fr.yml +0 -2
  372. data/db/data/regions/VN/hi.yml +0 -2
  373. data/db/data/regions/VN/hr.yml +0 -2
  374. data/db/data/regions/VN/hu.yml +0 -2
  375. data/db/data/regions/VN/id.yml +0 -2
  376. data/db/data/regions/VN/it.yml +0 -2
  377. data/db/data/regions/VN/ja.yml +0 -2
  378. data/db/data/regions/VN/ko.yml +0 -2
  379. data/db/data/regions/VN/lt.yml +0 -3
  380. data/db/data/regions/VN/ms.yml +0 -2
  381. data/db/data/regions/VN/nb.yml +0 -2
  382. data/db/data/regions/VN/nl.yml +0 -2
  383. data/db/data/regions/VN/pl.yml +0 -2
  384. data/db/data/regions/VN/pt-BR.yml +0 -2
  385. data/db/data/regions/VN/pt-PT.yml +0 -2
  386. data/db/data/regions/VN/ro.yml +0 -2
  387. data/db/data/regions/VN/ru.yml +0 -4
  388. data/db/data/regions/VN/sk.yml +0 -2
  389. data/db/data/regions/VN/sl.yml +0 -3
  390. data/db/data/regions/VN/sv.yml +0 -2
  391. data/db/data/regions/VN/th.yml +0 -2
  392. data/db/data/regions/VN/tr.yml +0 -2
  393. data/db/data/regions/VN/vi.yml +0 -2
  394. data/db/data/regions/VN/zh-CN.yml +0 -2
  395. data/db/data/regions/VN/zh-TW.yml +0 -2
  396. data/db/data/regions/VN.yml +5 -4
  397. data/db/data/regions/_default/bg.yml +1 -73
  398. data/db/data/regions/_default/cs.yml +2 -77
  399. data/db/data/regions/_default/da.yml +2 -71
  400. data/db/data/regions/_default/de.yml +2 -73
  401. data/db/data/regions/_default/el.yml +1 -78
  402. data/db/data/regions/_default/es.yml +2 -82
  403. data/db/data/regions/_default/fi.yml +2 -72
  404. data/db/data/regions/_default/fr.yml +3 -77
  405. data/db/data/regions/_default/hi.yml +6 -72
  406. data/db/data/regions/_default/hr.yml +4 -78
  407. data/db/data/regions/_default/hu.yml +4 -80
  408. data/db/data/regions/_default/id.yml +2 -72
  409. data/db/data/regions/_default/it.yml +5 -83
  410. data/db/data/regions/_default/ja.yml +4 -57
  411. data/db/data/regions/_default/ko.yml +2 -56
  412. data/db/data/regions/_default/lt.yml +4 -83
  413. data/db/data/regions/_default/ms.yml +4 -74
  414. data/db/data/regions/_default/nb.yml +3 -73
  415. data/db/data/regions/_default/nl.yml +6 -74
  416. data/db/data/regions/_default/pl.yml +2 -74
  417. data/db/data/regions/_default/pt-BR.yml +72 -149
  418. data/db/data/regions/_default/pt-PT.yml +0 -73
  419. data/db/data/regions/_default/ro.yml +1 -76
  420. data/db/data/regions/_default/ru.yml +1 -73
  421. data/db/data/regions/_default/sk.yml +0 -69
  422. data/db/data/regions/_default/sl.yml +2 -75
  423. data/db/data/regions/_default/sv.yml +2 -72
  424. data/db/data/regions/_default/th.yml +1 -66
  425. data/db/data/regions/_default/tr.yml +2 -67
  426. data/db/data/regions/_default/vi.yml +2 -69
  427. data/db/data/regions/_default/zh-CN.yml +10 -63
  428. data/db/data/regions/_default/zh-TW.yml +4 -57
  429. data/lib/worldwide/address.rb +32 -5
  430. data/lib/worldwide/scripts.rb +1 -1
  431. data/lib/worldwide/units.rb +58 -54
  432. data/lib/worldwide/version.rb +1 -1
  433. metadata +6 -6
@@ -6,7 +6,7 @@ zh-CN:
6
6
  company:
7
7
  label:
8
8
  default: 公司
9
- optional: 公司(可选)
9
+ optional: 公司(选填)
10
10
  errors:
11
11
  blank_instructional: 输入公司
12
12
  blank_informative: 缺少公司
@@ -23,7 +23,7 @@ zh-CN:
23
23
  first_name:
24
24
  label:
25
25
  default: 名字
26
- optional: 名字(可选)
26
+ optional: 名字(选填)
27
27
  errors:
28
28
  blank_instructional: 输入名字
29
29
  blank_informative: 缺少名字
@@ -61,7 +61,7 @@ zh-CN:
61
61
  address1:
62
62
  label:
63
63
  default: 地址
64
- optional: 地址(可选)
64
+ optional: 地址(选填)
65
65
  warnings:
66
66
  contains_too_many_words: 建议地址行 1 少于 %{word_count} 个字词
67
67
  errors:
@@ -94,17 +94,9 @@ zh-CN:
94
94
  default: 公寓、房间号等。
95
95
  optional: 公寓、房间号等(可选)
96
96
  errors:
97
- contains_html_tags: 地址行 2 不能包含 HTML
98
- contains_emojis: 地址行 2 不能包含表情符号
99
- contains_url: 地址行 2 不能包含 URL
100
- contains_mathematical_symbols: 地址行 2 不能包含数学符号
101
- contains_restricted_characters: 地址行 2 只能包含字母、数字、当地字符和特殊字符
102
- contains_too_many_words: 地址行 2 不能超过 %{word_count} 个字词
103
- unknown_for_address: 地址行 2 可能不正确
104
97
  blank_instructional: 输入公寓、房间号等
105
98
  blank_informative: 缺少公寓或房间号
106
99
  too_long_instructional: 地址行 2 过长(最多 255 个字符)
107
- too_long_informational: 地址行 2 过长
108
100
  missing_building_number_instructional: 添加大楼编号(如果有)
109
101
  missing_building_number_informative: 缺少大楼编号
110
102
  street_unknown_for_zip_instructional: 输入 %{zip} 对应的有效街道名称
@@ -131,16 +123,8 @@ zh-CN:
131
123
  city:
132
124
  label:
133
125
  default: 城市
134
- optional: 城市(可选)
126
+ optional: 城市(选填)
135
127
  errors:
136
- too_long: 城市名过长(最多 255 个字符)
137
- contains_html_tags: 城市名不能包含 HTML
138
- contains_emojis: 城市名不能包含表情符号
139
- contains_url: 城市名不能包含 URL
140
- contains_mathematical_symbols: 城市名不能包含数学符号
141
- contains_restricted_characters: "“城市”字段只能包含字母、数字、当地字符和特殊字符"
142
- contains_too_many_words: 城市名不能超过 %{word_count} 个字词
143
- unknown_for_address: 城市可能不正确
144
128
  blank_instructional: 输入城市
145
129
  blank_informative: 缺少城市
146
130
  unknown_for_zip_instructional: 输入 %{zip} 对应的有效城市
@@ -168,7 +152,7 @@ zh-CN:
168
152
  country:
169
153
  label:
170
154
  default: 国家/地区
171
- optional: 国家/地区(可选)
155
+ optional: 国家/地区(选填)
172
156
  errors:
173
157
  blank_instructional: 选择国家/地区
174
158
  blank_informative: 缺少国家/地区
@@ -180,12 +164,9 @@ zh-CN:
180
164
  invalid_for_zip_informative: "%{country} 与国家/地区不匹配"
181
165
  phone:
182
166
  label:
183
- default: 电话
184
- optional: 电话(可选)
167
+ default: 电话号码
168
+ optional: 电话号码(选填)
185
169
  errors:
186
- contains_emojis: 电话号码不能包含表情符号
187
- contains_mathematical_symbols: 电话号码不能包含数学符号
188
- contains_restricted_characters: "“电话号码”字段只能包含字母、数字、当地字符和特殊字符"
189
170
  blank_instructional: 输入电话号码
190
171
  blank_informative: 缺少电话号码
191
172
  invalid_instructional: 输入有效的电话号码
@@ -200,10 +181,9 @@ zh-CN:
200
181
  contains_restricted_characters_informative: 电话号码不能包含受限字符
201
182
  province:
202
183
  label:
203
- default: 区域
204
- optional: 区域(可选)
184
+ default: 地区
185
+ optional: 地区(选填)
205
186
  errors:
206
- unknown_for_address: 地区可能不正确
207
187
  blank_instructional: 选择地区
208
188
  blank_informative: 缺少地区
209
189
  invalid_instructional: 选择地区
@@ -221,15 +201,8 @@ zh-CN:
221
201
  zip:
222
202
  label:
223
203
  default: 邮政编码
224
- optional: 邮政编码(可选)
204
+ optional: 邮政编码(选填)
225
205
  errors:
226
- blocked_address: 不支持此地点
227
- too_long: 邮政编码过长
228
- contains_html_tags: 邮政编码不能包含 HTML
229
- contains_emojis: 邮政编码不能包含表情符号
230
- contains_mathematical_symbols: 邮政编码不能包含数学符号
231
- contains_restricted_characters: "“邮政编码”字段只能包含字母、数字、当地字符和特殊字符"
232
- unknown_for_address: 邮政编码可能不正确
233
206
  blank_instructional: 输入邮政编码
234
207
  blank_informative: 缺少邮政编码
235
208
  invalid_instructional: 输入有效的邮政编码
@@ -243,7 +216,6 @@ zh-CN:
243
216
  invalid_for_country_and_province_informative: 邮政编码与 %{country} %{province}
244
217
  不匹配
245
218
  not_supported_instructional: 邮政编码不受支持。请输入新地址并重试
246
- not_supported_informativel: 邮政编码不受支持
247
219
  unknown_for_province_instructional: 输入 %{province} 对应的有效邮政编码
248
220
  unknown_for_province_informative: 邮政编码对 %{province} 无效
249
221
  blocked_address_instructional: 不支持此地点
@@ -279,9 +251,7 @@ zh-CN:
279
251
  contains_restricted_characters_instructional: 街道名只能包含字母、数字、当地字符和特殊字符
280
252
  contains_restricted_characters_informative: 街道名不能包含受限字符
281
253
  contains_too_many_words_instructional: 街道名不能超过 %{word_count} 个字词
282
- contains_too_many_words_informational: 街道名不能超过 %{word_count} 个字词
283
254
  contains_html_tags_instructional: 街道名不能包含 HTML
284
- contains_html_tags_informational: 街道名不能包含 HTML
285
255
  contains_url_instructional: 街道名不能包含 URL
286
256
  contains_url_informative: 街道名不能包含 URL
287
257
  street_unknown_for_zip_instructional: 输入 %{zip} 对应的有效街道
@@ -320,17 +290,6 @@ zh-CN:
320
290
  default: 街区
321
291
  optional: 街区(选填)
322
292
  errors:
323
- blank: 输入街区
324
- too_long: 街区名过长(最多 %{limit} 个字符)
325
- contains_emojis: 街区名不能包含表情符号
326
- contains_mathematical_symbols: 街区名不能包含数学符号
327
- contains_restricted_characters: 街区名只能包含字母、数字、当地字符和特殊字符
328
- contains_too_many_words: 街区名不能超过 %{word_count} 个字词
329
- contains_html_tags: 街区名不能包含 HTML 标记
330
- contains_url: 街区名不能包含 URL
331
- unknown_for_city: 输入 %{city} 对应的有效街区名称
332
- unknown_for_zip: 输入 %{zip} 对应的有效街区名称
333
- unknown_for_address: 街区名可能不正确
334
293
  blank_instructional: 输入街区名
335
294
  blank_informative: 缺少街区名
336
295
  too_long_instructional: 街区名过长(最多 %{limit} 个字符)
@@ -360,18 +319,6 @@ zh-CN:
360
319
  default: 公寓、房间号等
361
320
  optional: 公寓、房间号等(可选)
362
321
  errors:
363
- blank: 输入公寓、房间号等
364
- too_long: 第二个地址行过长(最多 %{limit} 个字符)
365
- contains_emojis: 第二个地址行不能包含表情符号
366
- contains_mathematical_symbols: 第二个地址行不能包含数学符号
367
- contains_restricted_characters: 第二个地址行只能包含字母、数字、当地字符和特殊字符
368
- contains_too_many_words: 第二个地址行不能超过 %{word_count} 个字词
369
- contains_html_tags: 第二个地址行不能包含 HTML 标记。
370
- contains_url: 第二个地址行不能包含 URL。
371
- missing_building_number: 添加大楼编号(如果有)
372
- street_unknown_for_zip: 输入 %{zip} 对应的有效街道名称
373
- building_number_invalid: 大楼编号与 %{street} (%{zip}) 不匹配
374
- unknown_for_address: 第二个地址行可能不正确
375
322
  blank_instructional: 输入公寓、房间号等
376
323
  blank_informative: 缺少公寓或房间号
377
324
  too_long_instructional: 第二个地址行过长(最多 %{limit} 个字符)
@@ -94,17 +94,9 @@ zh-TW:
94
94
  default: 公寓、套房等
95
95
  optional: 公寓、套房等 (選填)
96
96
  errors:
97
- contains_html_tags: 第二行地址不得包含 HTML
98
- contains_emojis: 第二行地址不得包含表情符號
99
- contains_url: 第二行地址不得包含網址
100
- contains_mathematical_symbols: 第二行地址不得包含數學符號
101
- contains_restricted_characters: 第二行地址僅可包含字母、數字、當地字元和特殊字元
102
- contains_too_many_words: 第二行地址不得超過 %{word_count} 個字
103
- unknown_for_address: 第二行地址可能並不正確
104
97
  blank_instructional: 輸入公寓、套房等
105
98
  blank_informative: 缺少公寓或套房
106
99
  too_long_instructional: 第二行地址過長 (最多 255 個字元)
107
- too_long_informational: 第二行地址過長
108
100
  missing_building_number_instructional: 如果您的地址有建築物號碼,請新增建築物號碼
109
101
  missing_building_number_informative: 可能未輸入建築物號碼
110
102
  street_unknown_for_zip_instructional: 請輸入 %{zip} 的有效街道名稱
@@ -130,17 +122,9 @@ zh-TW:
130
122
  contains_too_many_words: 地址第 2 行建議少於 %{word_count} 字
131
123
  city:
132
124
  label:
133
- default:
134
- optional: (選填)
125
+ default: 城市
126
+ optional: 城市 (選填)
135
127
  errors:
136
- too_long: 城市過長 (最多 255 個字元)
137
- contains_html_tags: 城市不得包含 HTML
138
- contains_emojis: 城市不得包含表情符號
139
- contains_url: 城市不得包含網址
140
- contains_mathematical_symbols: 城市不得包含數學符號
141
- contains_restricted_characters: 城市僅可包含字母、數字、當地字元和特殊字元
142
- contains_too_many_words: 城市不得超過 %{word_count} 個字
143
- unknown_for_address: 城市可能不正確
144
128
  blank_instructional: 請輸入城市
145
129
  blank_informative: 缺少城市
146
130
  unknown_for_zip_instructional: 請輸入 %{zip} 的有效城市
@@ -183,9 +167,6 @@ zh-TW:
183
167
  default: 電話
184
168
  optional: 電話 (選填)
185
169
  errors:
186
- contains_emojis: 電話號碼不得包含表情符號
187
- contains_mathematical_symbols: 電話號碼不得包含數學符號
188
- contains_restricted_characters: 電話號碼僅可包含字母、數字、當地字元和特殊字元
189
170
  blank_instructional: 請輸入電話號碼
190
171
  blank_informative: 缺少電話號碼
191
172
  invalid_instructional: 請輸入有效的電話號碼
@@ -200,10 +181,9 @@ zh-TW:
200
181
  contains_restricted_characters_informative: "「電話號碼」不得包含限制的字元"
201
182
  province:
202
183
  label:
203
- default: 區域
204
- optional: 區域 (選填)
184
+ default: 地區
185
+ optional: 地區 (選填)
205
186
  errors:
206
- unknown_for_address: 地區可能不正確
207
187
  blank_instructional: 請選取地區
208
188
  blank_informative: 缺少地區
209
189
  invalid_instructional: 請選取地區
@@ -223,13 +203,6 @@ zh-TW:
223
203
  default: 郵遞區號
224
204
  optional: 郵遞區號 (選填)
225
205
  errors:
226
- blocked_address: 不支援此地點
227
- too_long: 郵遞區號過長
228
- contains_html_tags: 郵遞區號不得包含 HTML
229
- contains_emojis: 郵遞區號不得包含表情符號
230
- contains_mathematical_symbols: 郵遞區號不得包含數學符號
231
- contains_restricted_characters: 郵遞區號僅可包含字母、數字、當地字元和特殊字元
232
- unknown_for_address: 郵遞區號可能不正確
233
206
  blank_instructional: 請輸入郵遞區號
234
207
  blank_informative: 缺少郵遞區號
235
208
  invalid_instructional: 請輸入有效的郵遞區號
@@ -243,7 +216,6 @@ zh-TW:
243
216
  invalid_for_country_and_province_informative: 郵遞區號與 %{country} %{province}
244
217
  不符
245
218
  not_supported_instructional: 不支援此郵遞區號。請輸入新的地址,然後再試一次
246
- not_supported_informativel: 不支援此郵遞區號
247
219
  unknown_for_province_instructional: 請輸入 %{province} 的有效郵遞區號
248
220
  unknown_for_province_informative: "%{province} 的郵遞區號無效"
249
221
  blocked_address_instructional: 不支援此地點
@@ -279,9 +251,7 @@ zh-TW:
279
251
  contains_restricted_characters_instructional: 街道僅可包含字母、數字、當地字元和特殊字元
280
252
  contains_restricted_characters_informative: 街道不得包含限制的字元
281
253
  contains_too_many_words_instructional: 街道不得超過 %{word_count} 個字
282
- contains_too_many_words_informational: 街道不得超過 %{word_count} 個字
283
254
  contains_html_tags_instructional: 街道不得包含 HTML
284
- contains_html_tags_informational: 街道不得包含 HTML
285
255
  contains_url_instructional: 街道不得包含網址
286
256
  contains_url_informative: 地址不得包含網址
287
257
  street_unknown_for_zip_instructional: 請為輸入 %{zip} 的有效街道
@@ -320,17 +290,6 @@ zh-TW:
320
290
  default: 鄰
321
291
  optional: 鄰 (選填)
322
292
  errors:
323
- blank: 請輸入「鄰」
324
- too_long: "「鄰」過長 (最多 %{limit} 個字元)"
325
- contains_emojis: "「鄰」不得包含表情符號"
326
- contains_mathematical_symbols: "「鄰」不得包含數學符號"
327
- contains_restricted_characters: "「鄰」僅可包含字母、數字、當地字元和特殊字元"
328
- contains_too_many_words: "「鄰」不得超過 %{word_count} 個字"
329
- contains_html_tags: "「鄰」不得包含 HTML 標籤"
330
- contains_url: "「鄰」不得包含網址"
331
- unknown_for_city: 請輸入 %{city} 的有效鄰名
332
- unknown_for_zip: 請輸入 %{zip} 的有效鄰名
333
- unknown_for_address: "「鄰」可能不正確"
334
293
  blank_instructional: 請輸入「鄰」
335
294
  blank_informative: 缺少「鄰」
336
295
  too_long_instructional: "「鄰」過長 (最多 %{limit} 個字元)"
@@ -360,18 +319,6 @@ zh-TW:
360
319
  default: 公寓、套房等
361
320
  optional: 公寓、套房等 (選填)
362
321
  errors:
363
- blank: 請輸入公寓、套房等
364
- too_long: "「地址第二行」過長 (最多 %{limit} 個字元)"
365
- contains_emojis: "「地址第二行」不得包含表情符號"
366
- contains_mathematical_symbols: "「地址第二行」不得包含數學符號"
367
- contains_restricted_characters: "「地址第二行」僅可包含字母、數字、當地字元和特殊字元"
368
- contains_too_many_words: "「地址第二行」不得超過 %{word_count} 個字"
369
- contains_html_tags: "「地址第二行」不得包含 HTML 標籤。"
370
- contains_url: "「地址第二行」不得包含網址。"
371
- missing_building_number: 如果您的地址有建築物號碼,請新增建築物號碼
372
- street_unknown_for_zip: 請輸入 %{zip} 的有效街道名稱
373
- building_number_invalid: 在 %{zip} %{street} 找不到此建築物號碼
374
- unknown_for_address: "「地址第二行」可能並不正確"
375
322
  blank_instructional: 請輸入公寓、套房等
376
323
  blank_informative: 缺少公寓或套房
377
324
  too_long_instructional: "「地址第二行」過長 (最多 %{limit} 個字元)"
@@ -129,7 +129,7 @@ module Worldwide
129
129
  fields.reverse.insert(1, ":").join("")
130
130
  end
131
131
 
132
- if Worldwide::Scripts.identify(text: result).include?(:Latn)
132
+ if Worldwide::Scripts.identify(text: result).include?(:Latin)
133
133
  result
134
134
  else
135
135
  result.delete(" \u{3000}")
@@ -148,7 +148,7 @@ module Worldwide
148
148
  end
149
149
 
150
150
  def concatenate_address1
151
- additional_fields = region.combined_address_format["address1"] || []
151
+ additional_fields = region.combined_address_format.dig(script_from_field("address1"), "address1") || []
152
152
  additional_field_keys = additional_fields.map { |field| field["key"] }
153
153
 
154
154
  return address1 if field_values(additional_field_keys).empty?
@@ -157,7 +157,7 @@ module Worldwide
157
157
  end
158
158
 
159
159
  def concatenate_address2
160
- additional_fields = region.combined_address_format["address2"] || []
160
+ additional_fields = region.combined_address_format.dig(script_from_field("address2"), "address2") || []
161
161
  additional_field_keys = additional_fields.map { |field| field["key"] }
162
162
 
163
163
  return address2 if field_values(additional_field_keys).empty?
@@ -166,13 +166,13 @@ module Worldwide
166
166
  end
167
167
 
168
168
  def split_address1
169
- additional_fields = region.combined_address_format["address1"] || []
169
+ additional_fields = region.combined_address_format.dig(script_from_string(address1), "address1") || []
170
170
  split_fields_arr = address1&.split(RESERVED_DELIMITER) || []
171
171
  split_fields(additional_fields, split_fields_arr)
172
172
  end
173
173
 
174
174
  def split_address2
175
- additional_fields = region.combined_address_format["address2"] || []
175
+ additional_fields = region.combined_address_format.dig(script_from_string(address2), "address2") || []
176
176
  split_fields_arr = address2&.split(RESERVED_DELIMITER) || []
177
177
  split_fields(additional_fields, split_fields_arr)
178
178
  end
@@ -465,6 +465,33 @@ module Worldwide
465
465
  end
466
466
  end
467
467
 
468
+ def script_from_string(str)
469
+ script = "default"
470
+ scripts = region.combined_address_format.except("default").keys
471
+ return script if scripts.empty?
472
+
473
+ detected_scripts = Worldwide::Scripts.identify(text: str).map(&:to_s)
474
+ if detected_scripts.length == 1 && scripts.include?(detected_scripts.first)
475
+ script = detected_scripts.first
476
+ end
477
+ script
478
+ end
479
+
480
+ def script_from_field(field)
481
+ scripts = region.combined_address_format.except("default").keys
482
+ script = scripts.find do |script|
483
+ combined_address_format = region.combined_address_format.dig(script, field)
484
+ additional_fields_string = combined_address_format.map { |field| send(field["key"].underscore.to_sym) }.join(" ")
485
+ text_exclusively_uses_script?(additional_fields_string, script)
486
+ end
487
+ script.present? ? script : "default"
488
+ end
489
+
490
+ def text_exclusively_uses_script?(text, script)
491
+ detected_scripts = Worldwide::Scripts.identify(text: text).map(&:to_s)
492
+ detected_scripts.length == 1 && detected_scripts.include?(script)
493
+ end
494
+
468
495
  def concatenate_fields(fields)
469
496
  concatenated_field = ""
470
497
  fields.each_with_index do |field, i|
@@ -15,7 +15,7 @@ module Worldwide
15
15
  "Hangul": "\\p{Hangul}",
16
16
  "Hiragana": "\\p{Hiragana}",
17
17
  "Katakana": "\\p{Katakana}",
18
- "Latn": "\\p{Latin}",
18
+ "Latin": "\\p{Latin}",
19
19
  "Thai": "\\p{Thai}",
20
20
  }
21
21
 
@@ -1,69 +1,73 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- SUPPORTED_HUMANIZATIONS = {
5
- short: :short,
6
- long: :long,
7
- }.freeze
8
-
9
- MEASUREMENT_KEYS = {
10
- millimeter: :length_millimeter,
11
- millimeters: :length_millimeter,
12
- centimeter: :length_centimeter,
13
- centimeters: :length_centimeter,
14
- foot: :length_foot,
15
- feet: :length_foot,
16
- inch: :length_inch,
17
- inches: :length_inch,
18
- meter: :length_meter,
19
- meters: :length_meter,
20
- gram: :mass_gram,
21
- grams: :mass_gram,
22
- kilogram: :mass_kilogram,
23
- kilograms: :mass_kilogram,
24
- ounce: :mass_ounce,
25
- ounces: :mass_ounce,
26
- pound: :mass_pound,
27
- pounds: :mass_pound,
28
- centiliter: :volume_centiliter,
29
- centiliters: :volume_centiliter,
30
- cubic_meter: :volume_cubic_meter,
31
- cubic_meters: :volume_cubic_meter,
32
- imperial_fluid_ounce: :volume_fluid_ounce_imperial,
33
- imperial_fluid_ounces: :volume_fluid_ounce_imperial,
34
- fluid_ounce: :volume_fluid_ounce,
35
- fluid_ounces: :volume_fluid_ounce,
36
- imperial_gallon: :volume_gallon_imperial,
37
- imperial_gallons: :volume_gallon_imperial,
38
- gallon: :volume_gallon,
39
- gallons: :volume_gallon,
40
- liter: :volume_liter,
41
- liters: :volume_liter,
42
- milliliter: :volume_milliliter,
43
- milliliters: :volume_milliliter,
44
- pint: :volume_pint,
45
- pints: :volume_pint,
46
- imperial_pint: :volume_pint_imperial,
47
- imperial_pints: :volume_pint_imperial,
48
- quart: :volume_quart,
49
- quarts: :volume_quart,
50
- imperial_quart: :volume_quart_imperial,
51
- imperial_quarts: :volume_quart_imperial,
52
- yard: :length_yard,
53
- yards: :length_yard,
54
- }.freeze
55
-
56
4
  class Units
57
5
  class << self
58
6
  def format(amount, unit, humanize: :short)
59
- supported_humanization = SUPPORTED_HUMANIZATIONS[humanize.to_sym]
7
+ supported_humanization = supported_humanizations[humanize.to_sym]
60
8
  raise ArgumentError, "Unsupported value for `humanize`: #{humanize}." unless supported_humanization
61
9
 
62
- measurement_key = MEASUREMENT_KEYS[unit.to_sym]
10
+ measurement_key = measurement_keys[unit.to_sym]
63
11
  raise ArgumentError, "Unsupported value for `unit`: #{unit}." unless measurement_key
64
12
 
65
13
  Cldr.t("units.unit_length.#{supported_humanization}.#{measurement_key}", count: amount)
66
14
  end
15
+
16
+ def supported_humanizations
17
+ {
18
+ short: :short,
19
+ long: :long,
20
+ }.freeze
21
+ end
22
+
23
+ def measurement_keys
24
+ {
25
+ millimeter: :length_millimeter,
26
+ millimeters: :length_millimeter,
27
+ centimeter: :length_centimeter,
28
+ centimeters: :length_centimeter,
29
+ foot: :length_foot,
30
+ feet: :length_foot,
31
+ inch: :length_inch,
32
+ inches: :length_inch,
33
+ meter: :length_meter,
34
+ meters: :length_meter,
35
+ gram: :mass_gram,
36
+ grams: :mass_gram,
37
+ kilogram: :mass_kilogram,
38
+ kilograms: :mass_kilogram,
39
+ ounce: :mass_ounce,
40
+ ounces: :mass_ounce,
41
+ pound: :mass_pound,
42
+ pounds: :mass_pound,
43
+ centiliter: :volume_centiliter,
44
+ centiliters: :volume_centiliter,
45
+ cubic_meter: :volume_cubic_meter,
46
+ cubic_meters: :volume_cubic_meter,
47
+ imperial_fluid_ounce: :volume_fluid_ounce_imperial,
48
+ imperial_fluid_ounces: :volume_fluid_ounce_imperial,
49
+ fluid_ounce: :volume_fluid_ounce,
50
+ fluid_ounces: :volume_fluid_ounce,
51
+ imperial_gallon: :volume_gallon_imperial,
52
+ imperial_gallons: :volume_gallon_imperial,
53
+ gallon: :volume_gallon,
54
+ gallons: :volume_gallon,
55
+ liter: :volume_liter,
56
+ liters: :volume_liter,
57
+ milliliter: :volume_milliliter,
58
+ milliliters: :volume_milliliter,
59
+ pint: :volume_pint,
60
+ pints: :volume_pint,
61
+ imperial_pint: :volume_pint_imperial,
62
+ imperial_pints: :volume_pint_imperial,
63
+ quart: :volume_quart,
64
+ quarts: :volume_quart,
65
+ imperial_quart: :volume_quart_imperial,
66
+ imperial_quarts: :volume_quart_imperial,
67
+ yard: :length_yard,
68
+ yards: :length_yard,
69
+ }.freeze
70
+ end
67
71
  end
68
72
  end
69
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "1.5.0"
4
+ VERSION = "1.6.1"
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.5.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-19 00:00:00.000000000 Z
11
+ date: 2024-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -8490,7 +8490,7 @@ licenses: []
8490
8490
  metadata:
8491
8491
  allowed_push_host: https://rubygems.org/
8492
8492
  changelog_uri: https://github.com/Shopify/worldwide/blob/main/CHANGELOG.md
8493
- post_install_message:
8493
+ post_install_message:
8494
8494
  rdoc_options: []
8495
8495
  require_paths:
8496
8496
  - lib
@@ -8505,8 +8505,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
8505
8505
  - !ruby/object:Gem::Version
8506
8506
  version: '0'
8507
8507
  requirements: []
8508
- rubygems_version: 3.5.13
8509
- signing_key:
8508
+ rubygems_version: 3.5.14
8509
+ signing_key:
8510
8510
  specification_version: 4
8511
8511
  summary: Internationalization and localization APIs
8512
8512
  test_files: []