twitter_cldr 6.11.5 → 6.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1103) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/README.md +0 -1111
  4. data/lib/twitter_cldr/resources/calendars_importer.rb +1 -1
  5. data/lib/twitter_cldr/resources/cldr_locale.rb +4 -3
  6. data/lib/twitter_cldr/resources/currency_symbols_importer.rb +8 -4
  7. data/lib/twitter_cldr/resources/locales_resources_importer.rb +33 -1
  8. data/lib/twitter_cldr/resources/number_formats_importer.rb +4 -1
  9. data/lib/twitter_cldr/resources/postal_codes_importer.rb +1 -1
  10. data/lib/twitter_cldr/resources/segment_rules_importer.rb +6 -3
  11. data/lib/twitter_cldr/resources/segment_tests_importer.rb +118 -16
  12. data/lib/twitter_cldr/resources/tailoring_importer.rb +6 -6
  13. data/lib/twitter_cldr/resources/timezone_tests_importer.rb +0 -8
  14. data/lib/twitter_cldr/resources/transform_tests_importer.rb +0 -5
  15. data/lib/twitter_cldr/resources/transforms_importer.rb +33 -1
  16. data/lib/twitter_cldr/segmentation/break_iterator.rb +14 -16
  17. data/lib/twitter_cldr/segmentation/metadata.rb +4 -0
  18. data/lib/twitter_cldr/segmentation/state_machine.rb +13 -1
  19. data/lib/twitter_cldr/shared/properties_database.rb +12 -0
  20. data/lib/twitter_cldr/shared/property_set.rb +14 -0
  21. data/lib/twitter_cldr/transforms/conversions/side.rb +20 -12
  22. data/lib/twitter_cldr/transforms/transformer.rb +1 -1
  23. data/lib/twitter_cldr/transforms/transforms/transform_rule.rb +1 -1
  24. data/lib/twitter_cldr/utils/regexp_ast.rb +3 -0
  25. data/lib/twitter_cldr/version.rb +1 -1
  26. data/lib/twitter_cldr/versions.rb +3 -3
  27. data/lib/twitter_cldr.rb +4 -5
  28. data/resources/locales/af/calendars.yml +9 -9
  29. data/resources/locales/af/currencies.yml +1 -0
  30. data/resources/locales/af/fields.yml +25 -0
  31. data/resources/locales/af/languages.yml +41 -0
  32. data/resources/locales/af/lists.yml +5 -5
  33. data/resources/locales/af/numbers.yml +115 -1
  34. data/resources/locales/af/timezones.yml +4 -0
  35. data/resources/locales/af/units.yml +54 -9
  36. data/resources/locales/ar/calendars.yml +5 -5
  37. data/resources/locales/ar/fields.yml +24 -0
  38. data/resources/locales/ar/languages.yml +34 -0
  39. data/resources/locales/ar/lists.yml +8 -8
  40. data/resources/locales/ar/numbers.yml +116 -2
  41. data/resources/locales/ar/rbnf.yml +139 -139
  42. data/resources/locales/ar/timezones.yml +4 -0
  43. data/resources/locales/ar/units.yml +890 -31
  44. data/resources/locales/az/calendars.yml +11 -11
  45. data/resources/locales/az/fields.yml +32 -0
  46. data/resources/locales/az/languages.yml +39 -0
  47. data/resources/locales/az/lists.yml +2 -2
  48. data/resources/locales/az/numbers.yml +114 -0
  49. data/resources/locales/az/timezones.yml +2 -0
  50. data/resources/locales/az/units.yml +385 -6
  51. data/resources/locales/be/calendars.yml +16 -16
  52. data/resources/locales/be/fields.yml +32 -0
  53. data/resources/locales/be/languages.yml +43 -1
  54. data/resources/locales/be/lists.yml +6 -6
  55. data/resources/locales/be/numbers.yml +114 -0
  56. data/resources/locales/be/territories.yml +1 -1
  57. data/resources/locales/be/timezones.yml +4 -0
  58. data/resources/locales/be/units.yml +947 -124
  59. data/resources/locales/bg/calendars.yml +30 -30
  60. data/resources/locales/bg/fields.yml +4 -4
  61. data/resources/locales/bg/languages.yml +42 -3
  62. data/resources/locales/bg/lists.yml +6 -6
  63. data/resources/locales/bg/numbers.yml +115 -1
  64. data/resources/locales/bg/rbnf.yml +1213 -116
  65. data/resources/locales/bg/timezones.yml +5 -1
  66. data/resources/locales/bg/units.yml +433 -9
  67. data/resources/locales/bn/calendars.yml +19 -19
  68. data/resources/locales/bn/currencies.yml +23 -22
  69. data/resources/locales/bn/fields.yml +12 -12
  70. data/resources/locales/bn/languages.yml +74 -50
  71. data/resources/locales/bn/lists.yml +4 -4
  72. data/resources/locales/bn/numbers.yml +115 -0
  73. data/resources/locales/bn/territories.yml +16 -16
  74. data/resources/locales/bn/timezones.yml +12 -8
  75. data/resources/locales/bn/units.yml +338 -9
  76. data/resources/locales/bo/numbers.yml +114 -0
  77. data/resources/locales/bo/timezones.yml +10 -0
  78. data/resources/locales/bo/units.yml +4 -2
  79. data/resources/locales/bs/calendars.yml +10 -10
  80. data/resources/locales/bs/fields.yml +56 -0
  81. data/resources/locales/bs/languages.yml +36 -0
  82. data/resources/locales/bs/lists.yml +6 -6
  83. data/resources/locales/bs/numbers.yml +1276 -236
  84. data/resources/locales/bs/timezones.yml +2 -0
  85. data/resources/locales/bs/units.yml +534 -8
  86. data/resources/locales/ca/calendars.yml +17 -17
  87. data/resources/locales/ca/languages.yml +32 -0
  88. data/resources/locales/ca/lists.yml +6 -6
  89. data/resources/locales/ca/numbers.yml +153 -37
  90. data/resources/locales/ca/plural_rules.yml +2 -1
  91. data/resources/locales/ca/plurals.yml +4 -1
  92. data/resources/locales/ca/territories.yml +6 -6
  93. data/resources/locales/ca/timezones.yml +5 -1
  94. data/resources/locales/ca/units.yml +472 -20
  95. data/resources/locales/cs/calendars.yml +14 -10
  96. data/resources/locales/cs/languages.yml +42 -1
  97. data/resources/locales/cs/lists.yml +7 -7
  98. data/resources/locales/cs/numbers.yml +114 -0
  99. data/resources/locales/cs/timezones.yml +310 -306
  100. data/resources/locales/cs/units.yml +406 -356
  101. data/resources/locales/cy/calendars.yml +10 -10
  102. data/resources/locales/cy/fields.yml +25 -0
  103. data/resources/locales/cy/languages.yml +40 -1
  104. data/resources/locales/cy/lists.yml +4 -4
  105. data/resources/locales/cy/numbers.yml +114 -0
  106. data/resources/locales/cy/timezones.yml +2 -0
  107. data/resources/locales/cy/units.yml +650 -25
  108. data/resources/locales/da/calendars.yml +30 -30
  109. data/resources/locales/da/fields.yml +4 -0
  110. data/resources/locales/da/languages.yml +36 -3
  111. data/resources/locales/da/lists.yml +2 -2
  112. data/resources/locales/da/numbers.yml +114 -0
  113. data/resources/locales/da/territories.yml +2 -2
  114. data/resources/locales/da/timezones.yml +2 -0
  115. data/resources/locales/da/units.yml +593 -224
  116. data/resources/locales/de/calendars.yml +8 -8
  117. data/resources/locales/de/languages.yml +31 -0
  118. data/resources/locales/de/lists.yml +6 -6
  119. data/resources/locales/de/numbers.yml +114 -0
  120. data/resources/locales/de/timezones.yml +44 -42
  121. data/resources/locales/de/units.yml +247 -25
  122. data/resources/locales/de-AT/calendars.yml +8 -8
  123. data/resources/locales/de-AT/languages.yml +31 -0
  124. data/resources/locales/de-AT/lists.yml +6 -6
  125. data/resources/locales/de-AT/numbers.yml +114 -0
  126. data/resources/locales/de-AT/timezones.yml +44 -42
  127. data/resources/locales/de-AT/units.yml +247 -25
  128. data/resources/locales/de-CH/calendars.yml +7 -7
  129. data/resources/locales/de-CH/languages.yml +37 -6
  130. data/resources/locales/de-CH/lists.yml +6 -6
  131. data/resources/locales/de-CH/numbers.yml +114 -0
  132. data/resources/locales/de-CH/territories.yml +1 -1
  133. data/resources/locales/de-CH/timezones.yml +44 -42
  134. data/resources/locales/de-CH/units.yml +247 -25
  135. data/resources/locales/el/calendars.yml +13 -13
  136. data/resources/locales/el/languages.yml +34 -0
  137. data/resources/locales/el/lists.yml +4 -4
  138. data/resources/locales/el/numbers.yml +114 -0
  139. data/resources/locales/el/rbnf.yml +15 -3
  140. data/resources/locales/el/territories.yml +1 -1
  141. data/resources/locales/el/timezones.yml +4 -0
  142. data/resources/locales/el/units.yml +477 -72
  143. data/resources/locales/en/calendars.yml +15 -15
  144. data/resources/locales/en/currencies.yml +15 -7
  145. data/resources/locales/en/fields.yml +72 -0
  146. data/resources/locales/en/languages.yml +45 -5
  147. data/resources/locales/en/numbers.yml +114 -0
  148. data/resources/locales/en/rbnf.yml +2 -2
  149. data/resources/locales/en/territories.yml +2 -1
  150. data/resources/locales/en/timezones.yml +9 -1
  151. data/resources/locales/en/units.yml +29 -11
  152. data/resources/locales/en-001/calendars.yml +13 -13
  153. data/resources/locales/en-001/currencies.yml +12 -4
  154. data/resources/locales/en-001/fields.yml +12 -0
  155. data/resources/locales/en-001/languages.yml +43 -3
  156. data/resources/locales/en-001/numbers.yml +114 -0
  157. data/resources/locales/en-001/territories.yml +9 -8
  158. data/resources/locales/en-001/timezones.yml +13 -1
  159. data/resources/locales/en-001/units.yml +36 -17
  160. data/resources/locales/en-150/calendars.yml +13 -13
  161. data/resources/locales/en-150/currencies.yml +12 -4
  162. data/resources/locales/en-150/fields.yml +12 -0
  163. data/resources/locales/en-150/languages.yml +43 -3
  164. data/resources/locales/en-150/numbers.yml +114 -0
  165. data/resources/locales/en-150/territories.yml +9 -8
  166. data/resources/locales/en-150/timezones.yml +13 -1
  167. data/resources/locales/en-150/units.yml +36 -17
  168. data/resources/locales/en-AU/calendars.yml +25 -25
  169. data/resources/locales/en-AU/currencies.yml +21 -14
  170. data/resources/locales/en-AU/fields.yml +5 -3
  171. data/resources/locales/en-AU/languages.yml +43 -3
  172. data/resources/locales/en-AU/numbers.yml +114 -0
  173. data/resources/locales/en-AU/territories.yml +4 -3
  174. data/resources/locales/en-AU/timezones.yml +15 -1
  175. data/resources/locales/en-AU/units.yml +40 -21
  176. data/resources/locales/en-CA/calendars.yml +23 -23
  177. data/resources/locales/en-CA/currencies.yml +28 -20
  178. data/resources/locales/en-CA/fields.yml +12 -0
  179. data/resources/locales/en-CA/languages.yml +52 -12
  180. data/resources/locales/en-CA/numbers.yml +114 -0
  181. data/resources/locales/en-CA/territories.yml +8 -7
  182. data/resources/locales/en-CA/timezones.yml +12 -2
  183. data/resources/locales/en-CA/units.yml +41 -20
  184. data/resources/locales/en-GB/calendars.yml +10 -10
  185. data/resources/locales/en-GB/currencies.yml +12 -4
  186. data/resources/locales/en-GB/fields.yml +1 -0
  187. data/resources/locales/en-GB/languages.yml +42 -2
  188. data/resources/locales/en-GB/numbers.yml +114 -0
  189. data/resources/locales/en-GB/territories.yml +2 -1
  190. data/resources/locales/en-GB/timezones.yml +5 -1
  191. data/resources/locales/en-GB/units.yml +31 -13
  192. data/resources/locales/en-IE/calendars.yml +13 -13
  193. data/resources/locales/en-IE/currencies.yml +12 -4
  194. data/resources/locales/en-IE/fields.yml +12 -0
  195. data/resources/locales/en-IE/languages.yml +43 -3
  196. data/resources/locales/en-IE/numbers.yml +114 -0
  197. data/resources/locales/en-IE/territories.yml +9 -8
  198. data/resources/locales/en-IE/timezones.yml +13 -1
  199. data/resources/locales/en-IE/units.yml +36 -17
  200. data/resources/locales/en-IN/calendars.yml +17 -17
  201. data/resources/locales/en-IN/currencies.yml +12 -4
  202. data/resources/locales/en-IN/fields.yml +12 -0
  203. data/resources/locales/en-IN/languages.yml +43 -3
  204. data/resources/locales/en-IN/numbers.yml +114 -0
  205. data/resources/locales/en-IN/territories.yml +9 -8
  206. data/resources/locales/en-IN/timezones.yml +15 -1
  207. data/resources/locales/en-IN/units.yml +35 -16
  208. data/resources/locales/en-NZ/calendars.yml +13 -13
  209. data/resources/locales/en-NZ/currencies.yml +12 -4
  210. data/resources/locales/en-NZ/fields.yml +12 -0
  211. data/resources/locales/en-NZ/languages.yml +43 -3
  212. data/resources/locales/en-NZ/numbers.yml +114 -0
  213. data/resources/locales/en-NZ/territories.yml +9 -8
  214. data/resources/locales/en-NZ/timezones.yml +13 -1
  215. data/resources/locales/en-NZ/units.yml +36 -17
  216. data/resources/locales/en-SG/calendars.yml +13 -13
  217. data/resources/locales/en-SG/currencies.yml +12 -4
  218. data/resources/locales/en-SG/fields.yml +12 -0
  219. data/resources/locales/en-SG/languages.yml +43 -3
  220. data/resources/locales/en-SG/numbers.yml +114 -0
  221. data/resources/locales/en-SG/territories.yml +9 -8
  222. data/resources/locales/en-SG/timezones.yml +13 -1
  223. data/resources/locales/en-SG/units.yml +36 -17
  224. data/resources/locales/en-US/calendars.yml +15 -15
  225. data/resources/locales/en-US/currencies.yml +15 -7
  226. data/resources/locales/en-US/fields.yml +72 -0
  227. data/resources/locales/en-US/languages.yml +45 -5
  228. data/resources/locales/en-US/numbers.yml +114 -0
  229. data/resources/locales/en-US/territories.yml +2 -1
  230. data/resources/locales/en-US/timezones.yml +9 -1
  231. data/resources/locales/en-US/units.yml +29 -11
  232. data/resources/locales/en-ZA/calendars.yml +13 -13
  233. data/resources/locales/en-ZA/currencies.yml +12 -4
  234. data/resources/locales/en-ZA/fields.yml +12 -0
  235. data/resources/locales/en-ZA/languages.yml +43 -3
  236. data/resources/locales/en-ZA/numbers.yml +116 -2
  237. data/resources/locales/en-ZA/territories.yml +9 -8
  238. data/resources/locales/en-ZA/timezones.yml +13 -1
  239. data/resources/locales/en-ZA/units.yml +36 -17
  240. data/resources/locales/eo/calendars.yml +80 -80
  241. data/resources/locales/eo/fields.yml +439 -8
  242. data/resources/locales/eo/numbers.yml +114 -0
  243. data/resources/locales/eo/timezones.yml +10 -0
  244. data/resources/locales/eo/units.yml +4 -2
  245. data/resources/locales/es/calendars.yml +16 -16
  246. data/resources/locales/es/languages.yml +38 -4
  247. data/resources/locales/es/lists.yml +6 -6
  248. data/resources/locales/es/numbers.yml +114 -0
  249. data/resources/locales/es/rbnf.yml +18 -0
  250. data/resources/locales/es/timezones.yml +4 -2
  251. data/resources/locales/es/units.yml +40 -9
  252. data/resources/locales/es-419/calendars.yml +26 -26
  253. data/resources/locales/es-419/fields.yml +1 -1
  254. data/resources/locales/es-419/languages.yml +35 -1
  255. data/resources/locales/es-419/lists.yml +6 -6
  256. data/resources/locales/es-419/numbers.yml +114 -0
  257. data/resources/locales/es-419/timezones.yml +4 -0
  258. data/resources/locales/es-419/units.yml +45 -17
  259. data/resources/locales/es-AR/calendars.yml +17 -17
  260. data/resources/locales/es-AR/languages.yml +35 -1
  261. data/resources/locales/es-AR/lists.yml +6 -6
  262. data/resources/locales/es-AR/numbers.yml +114 -0
  263. data/resources/locales/es-AR/timezones.yml +4 -0
  264. data/resources/locales/es-AR/units.yml +45 -17
  265. data/resources/locales/es-CO/calendars.yml +22 -22
  266. data/resources/locales/es-CO/languages.yml +35 -1
  267. data/resources/locales/es-CO/lists.yml +6 -6
  268. data/resources/locales/es-CO/numbers.yml +114 -0
  269. data/resources/locales/es-CO/timezones.yml +4 -0
  270. data/resources/locales/es-CO/units.yml +45 -17
  271. data/resources/locales/es-MX/calendars.yml +21 -21
  272. data/resources/locales/es-MX/fields.yml +3 -3
  273. data/resources/locales/es-MX/languages.yml +43 -9
  274. data/resources/locales/es-MX/lists.yml +6 -6
  275. data/resources/locales/es-MX/numbers.yml +115 -1
  276. data/resources/locales/es-MX/territories.yml +2 -2
  277. data/resources/locales/es-MX/timezones.yml +4 -0
  278. data/resources/locales/es-MX/units.yml +49 -21
  279. data/resources/locales/es-US/calendars.yml +24 -24
  280. data/resources/locales/es-US/languages.yml +43 -9
  281. data/resources/locales/es-US/lists.yml +6 -6
  282. data/resources/locales/es-US/numbers.yml +114 -0
  283. data/resources/locales/es-US/timezones.yml +4 -0
  284. data/resources/locales/es-US/units.yml +52 -26
  285. data/resources/locales/et/calendars.yml +25 -25
  286. data/resources/locales/et/fields.yml +8 -0
  287. data/resources/locales/et/languages.yml +33 -0
  288. data/resources/locales/et/lists.yml +4 -4
  289. data/resources/locales/et/numbers.yml +114 -0
  290. data/resources/locales/et/timezones.yml +2 -0
  291. data/resources/locales/et/units.yml +405 -6
  292. data/resources/locales/eu/calendars.yml +35 -35
  293. data/resources/locales/eu/currencies.yml +11 -0
  294. data/resources/locales/eu/fields.yml +40 -0
  295. data/resources/locales/eu/languages.yml +128 -88
  296. data/resources/locales/eu/lists.yml +6 -6
  297. data/resources/locales/eu/numbers.yml +1233 -237
  298. data/resources/locales/eu/timezones.yml +12 -0
  299. data/resources/locales/eu/units.yml +386 -17
  300. data/resources/locales/fa/calendars.yml +4 -4
  301. data/resources/locales/fa/currencies.yml +1 -0
  302. data/resources/locales/fa/fields.yml +4 -4
  303. data/resources/locales/fa/languages.yml +44 -7
  304. data/resources/locales/fa/lists.yml +4 -4
  305. data/resources/locales/fa/numbers.yml +118 -2
  306. data/resources/locales/fa/timezones.yml +4 -0
  307. data/resources/locales/fa/units.yml +255 -40
  308. data/resources/locales/fi/calendars.yml +7 -7
  309. data/resources/locales/fi/currencies.yml +6 -2
  310. data/resources/locales/fi/languages.yml +34 -1
  311. data/resources/locales/fi/lists.yml +6 -6
  312. data/resources/locales/fi/numbers.yml +116 -1
  313. data/resources/locales/fi/timezones.yml +2 -0
  314. data/resources/locales/fi/units.yml +121 -65
  315. data/resources/locales/fil/calendars.yml +21 -21
  316. data/resources/locales/fil/currencies.yml +46 -46
  317. data/resources/locales/fil/fields.yml +48 -48
  318. data/resources/locales/fil/languages.yml +41 -4
  319. data/resources/locales/fil/lists.yml +4 -4
  320. data/resources/locales/fil/numbers.yml +116 -1
  321. data/resources/locales/fil/territories.yml +1 -1
  322. data/resources/locales/fil/timezones.yml +21 -19
  323. data/resources/locales/fil/units.yml +355 -9
  324. data/resources/locales/fr/calendars.yml +9 -9
  325. data/resources/locales/fr/currencies.yml +3 -3
  326. data/resources/locales/fr/fields.yml +4 -0
  327. data/resources/locales/fr/languages.yml +34 -3
  328. data/resources/locales/fr/lists.yml +4 -4
  329. data/resources/locales/fr/numbers.yml +114 -0
  330. data/resources/locales/fr/timezones.yml +14 -12
  331. data/resources/locales/fr/units.yml +84 -30
  332. data/resources/locales/fr-BE/calendars.yml +9 -9
  333. data/resources/locales/fr-BE/currencies.yml +3 -3
  334. data/resources/locales/fr-BE/fields.yml +4 -0
  335. data/resources/locales/fr-BE/languages.yml +34 -3
  336. data/resources/locales/fr-BE/lists.yml +4 -4
  337. data/resources/locales/fr-BE/numbers.yml +114 -0
  338. data/resources/locales/fr-BE/timezones.yml +14 -12
  339. data/resources/locales/fr-BE/units.yml +84 -30
  340. data/resources/locales/fr-CA/calendars.yml +5 -5
  341. data/resources/locales/fr-CA/fields.yml +4 -0
  342. data/resources/locales/fr-CA/languages.yml +34 -3
  343. data/resources/locales/fr-CA/lists.yml +4 -4
  344. data/resources/locales/fr-CA/numbers.yml +114 -0
  345. data/resources/locales/fr-CA/timezones.yml +4 -0
  346. data/resources/locales/fr-CA/units.yml +43 -25
  347. data/resources/locales/fr-CH/calendars.yml +7 -7
  348. data/resources/locales/fr-CH/currencies.yml +3 -3
  349. data/resources/locales/fr-CH/fields.yml +4 -0
  350. data/resources/locales/fr-CH/languages.yml +34 -3
  351. data/resources/locales/fr-CH/lists.yml +4 -4
  352. data/resources/locales/fr-CH/numbers.yml +114 -0
  353. data/resources/locales/fr-CH/timezones.yml +14 -12
  354. data/resources/locales/fr-CH/units.yml +84 -30
  355. data/resources/locales/ga/calendars.yml +26 -26
  356. data/resources/locales/ga/currencies.yml +6 -4
  357. data/resources/locales/ga/fields.yml +39 -39
  358. data/resources/locales/ga/languages.yml +131 -13
  359. data/resources/locales/ga/lists.yml +3 -3
  360. data/resources/locales/ga/numbers.yml +114 -0
  361. data/resources/locales/ga/timezones.yml +2 -0
  362. data/resources/locales/ga/units.yml +379 -23
  363. data/resources/locales/gl/calendars.yml +11 -11
  364. data/resources/locales/gl/fields.yml +12 -0
  365. data/resources/locales/gl/languages.yml +43 -0
  366. data/resources/locales/gl/lists.yml +6 -6
  367. data/resources/locales/gl/numbers.yml +116 -2
  368. data/resources/locales/gl/timezones.yml +311 -309
  369. data/resources/locales/gl/units.yml +470 -10
  370. data/resources/locales/gu/currencies.yml +1 -0
  371. data/resources/locales/gu/languages.yml +39 -3
  372. data/resources/locales/gu/lists.yml +3 -3
  373. data/resources/locales/gu/numbers.yml +115 -0
  374. data/resources/locales/gu/territories.yml +1 -1
  375. data/resources/locales/gu/timezones.yml +4 -0
  376. data/resources/locales/gu/units.yml +447 -11
  377. data/resources/locales/he/calendars.yml +2 -2
  378. data/resources/locales/he/currencies.yml +29 -20
  379. data/resources/locales/he/fields.yml +9 -0
  380. data/resources/locales/he/languages.yml +35 -3
  381. data/resources/locales/he/lists.yml +6 -6
  382. data/resources/locales/he/numbers.yml +117 -2
  383. data/resources/locales/he/plural_rules.yml +2 -3
  384. data/resources/locales/he/plurals.yml +2 -4
  385. data/resources/locales/he/rbnf.yml +12 -0
  386. data/resources/locales/he/territories.yml +2 -2
  387. data/resources/locales/he/timezones.yml +9 -5
  388. data/resources/locales/he/units.yml +664 -33
  389. data/resources/locales/hi/calendars.yml +2 -2
  390. data/resources/locales/hi/currencies.yml +1 -0
  391. data/resources/locales/hi/fields.yml +20 -0
  392. data/resources/locales/hi/languages.yml +39 -3
  393. data/resources/locales/hi/lists.yml +6 -6
  394. data/resources/locales/hi/numbers.yml +725 -44
  395. data/resources/locales/hi/territories.yml +4 -4
  396. data/resources/locales/hi/timezones.yml +4 -0
  397. data/resources/locales/hi/units.yml +423 -89
  398. data/resources/locales/hr/calendars.yml +7 -7
  399. data/resources/locales/hr/currencies.yml +1 -1
  400. data/resources/locales/hr/languages.yml +33 -0
  401. data/resources/locales/hr/lists.yml +8 -8
  402. data/resources/locales/hr/numbers.yml +114 -0
  403. data/resources/locales/hr/territories.yml +2 -2
  404. data/resources/locales/hr/timezones.yml +5 -3
  405. data/resources/locales/hr/units.yml +311 -69
  406. data/resources/locales/hu/calendars.yml +7 -7
  407. data/resources/locales/hu/currencies.yml +21 -7
  408. data/resources/locales/hu/fields.yml +24 -12
  409. data/resources/locales/hu/languages.yml +33 -0
  410. data/resources/locales/hu/lists.yml +6 -6
  411. data/resources/locales/hu/numbers.yml +136 -11
  412. data/resources/locales/hu/timezones.yml +2 -0
  413. data/resources/locales/hu/units.yml +631 -210
  414. data/resources/locales/hy/calendars.yml +1 -1
  415. data/resources/locales/hy/fields.yml +16 -0
  416. data/resources/locales/hy/languages.yml +46 -5
  417. data/resources/locales/hy/lists.yml +4 -4
  418. data/resources/locales/hy/numbers.yml +114 -0
  419. data/resources/locales/hy/timezones.yml +4 -0
  420. data/resources/locales/hy/units.yml +517 -123
  421. data/resources/locales/id/calendars.yml +12 -12
  422. data/resources/locales/id/currencies.yml +1 -0
  423. data/resources/locales/id/fields.yml +19 -0
  424. data/resources/locales/id/languages.yml +36 -2
  425. data/resources/locales/id/lists.yml +4 -4
  426. data/resources/locales/id/numbers.yml +114 -0
  427. data/resources/locales/id/timezones.yml +2 -0
  428. data/resources/locales/id/units.yml +302 -4
  429. data/resources/locales/is/calendars.yml +7 -7
  430. data/resources/locales/is/currencies.yml +15 -10
  431. data/resources/locales/is/fields.yml +17 -3
  432. data/resources/locales/is/languages.yml +36 -1
  433. data/resources/locales/is/lists.yml +4 -4
  434. data/resources/locales/is/numbers.yml +114 -0
  435. data/resources/locales/is/plural_rules.yml +2 -2
  436. data/resources/locales/is/plurals.yml +2 -2
  437. data/resources/locales/is/timezones.yml +9 -4
  438. data/resources/locales/is/units.yml +462 -135
  439. data/resources/locales/it/calendars.yml +9 -9
  440. data/resources/locales/it/currencies.yml +6 -6
  441. data/resources/locales/it/languages.yml +33 -2
  442. data/resources/locales/it/lists.yml +6 -6
  443. data/resources/locales/it/numbers.yml +114 -0
  444. data/resources/locales/it/rbnf.yml +566 -0
  445. data/resources/locales/it/territories.yml +5 -5
  446. data/resources/locales/it/timezones.yml +10 -5
  447. data/resources/locales/it/units.yml +94 -27
  448. data/resources/locales/it-CH/calendars.yml +11 -11
  449. data/resources/locales/it-CH/currencies.yml +6 -6
  450. data/resources/locales/it-CH/languages.yml +33 -2
  451. data/resources/locales/it-CH/lists.yml +6 -6
  452. data/resources/locales/it-CH/numbers.yml +114 -0
  453. data/resources/locales/it-CH/territories.yml +5 -5
  454. data/resources/locales/it-CH/timezones.yml +10 -5
  455. data/resources/locales/it-CH/units.yml +94 -27
  456. data/resources/locales/ja/currencies.yml +3 -3
  457. data/resources/locales/ja/languages.yml +32 -0
  458. data/resources/locales/ja/lists.yml +12 -12
  459. data/resources/locales/ja/numbers.yml +159 -0
  460. data/resources/locales/ja/timezones.yml +5 -1
  461. data/resources/locales/ja/units.yml +28 -8
  462. data/resources/locales/ka/languages.yml +40 -1
  463. data/resources/locales/ka/lists.yml +6 -6
  464. data/resources/locales/ka/numbers.yml +114 -0
  465. data/resources/locales/ka/timezones.yml +4 -0
  466. data/resources/locales/ka/units.yml +61 -10
  467. data/resources/locales/kk/calendars.yml +25 -25
  468. data/resources/locales/kk/currencies.yml +12 -12
  469. data/resources/locales/kk/fields.yml +37 -1
  470. data/resources/locales/kk/languages.yml +51 -14
  471. data/resources/locales/kk/lists.yml +5 -5
  472. data/resources/locales/kk/numbers.yml +114 -0
  473. data/resources/locales/kk/rbnf.yml +307 -0
  474. data/resources/locales/kk/territories.yml +4 -4
  475. data/resources/locales/kk/timezones.yml +27 -23
  476. data/resources/locales/kk/units.yml +465 -57
  477. data/resources/locales/km/currencies.yml +1 -0
  478. data/resources/locales/km/languages.yml +46 -0
  479. data/resources/locales/km/lists.yml +5 -5
  480. data/resources/locales/km/numbers.yml +114 -0
  481. data/resources/locales/km/timezones.yml +4 -0
  482. data/resources/locales/km/units.yml +306 -4
  483. data/resources/locales/kn/calendars.yml +5 -5
  484. data/resources/locales/kn/currencies.yml +2 -1
  485. data/resources/locales/kn/languages.yml +36 -1
  486. data/resources/locales/kn/lists.yml +4 -4
  487. data/resources/locales/kn/numbers.yml +719 -44
  488. data/resources/locales/kn/territories.yml +2 -2
  489. data/resources/locales/kn/timezones.yml +4 -0
  490. data/resources/locales/kn/units.yml +261 -164
  491. data/resources/locales/ko/calendars.yml +2 -2
  492. data/resources/locales/ko/currencies.yml +60 -58
  493. data/resources/locales/ko/fields.yml +48 -0
  494. data/resources/locales/ko/languages.yml +33 -0
  495. data/resources/locales/ko/lists.yml +6 -6
  496. data/resources/locales/ko/numbers.yml +114 -0
  497. data/resources/locales/ko/territories.yml +2 -2
  498. data/resources/locales/ko/timezones.yml +4 -0
  499. data/resources/locales/ko/units.yml +230 -6
  500. data/resources/locales/lo/calendars.yml +5 -4
  501. data/resources/locales/lo/currencies.yml +1 -0
  502. data/resources/locales/lo/fields.yml +50 -0
  503. data/resources/locales/lo/languages.yml +37 -3
  504. data/resources/locales/lo/lists.yml +5 -5
  505. data/resources/locales/lo/numbers.yml +114 -0
  506. data/resources/locales/lo/timezones.yml +4 -0
  507. data/resources/locales/lo/units.yml +320 -4
  508. data/resources/locales/lt/calendars.yml +10 -10
  509. data/resources/locales/lt/languages.yml +33 -1
  510. data/resources/locales/lt/lists.yml +6 -6
  511. data/resources/locales/lt/numbers.yml +114 -0
  512. data/resources/locales/lt/timezones.yml +2 -0
  513. data/resources/locales/lt/units.yml +907 -222
  514. data/resources/locales/lv/calendars.yml +8 -8
  515. data/resources/locales/lv/currencies.yml +2 -0
  516. data/resources/locales/lv/fields.yml +8 -0
  517. data/resources/locales/lv/languages.yml +36 -0
  518. data/resources/locales/lv/lists.yml +6 -6
  519. data/resources/locales/lv/numbers.yml +114 -0
  520. data/resources/locales/lv/timezones.yml +4 -0
  521. data/resources/locales/lv/units.yml +688 -124
  522. data/resources/locales/mk/calendars.yml +50 -50
  523. data/resources/locales/mk/fields.yml +2 -2
  524. data/resources/locales/mk/languages.yml +32 -0
  525. data/resources/locales/mk/lists.yml +5 -5
  526. data/resources/locales/mk/numbers.yml +114 -0
  527. data/resources/locales/mk/territories.yml +2 -2
  528. data/resources/locales/mk/timezones.yml +48 -44
  529. data/resources/locales/mk/units.yml +459 -6
  530. data/resources/locales/mr/calendars.yml +2 -8
  531. data/resources/locales/mr/currencies.yml +3 -2
  532. data/resources/locales/mr/day_periods.yml +2 -16
  533. data/resources/locales/mr/fields.yml +8 -0
  534. data/resources/locales/mr/languages.yml +35 -0
  535. data/resources/locales/mr/lists.yml +5 -5
  536. data/resources/locales/mr/numbers.yml +115 -0
  537. data/resources/locales/mr/territories.yml +2 -2
  538. data/resources/locales/mr/timezones.yml +4 -0
  539. data/resources/locales/mr/units.yml +478 -119
  540. data/resources/locales/ms/calendars.yml +13 -13
  541. data/resources/locales/ms/currencies.yml +8 -2
  542. data/resources/locales/ms/fields.yml +4 -0
  543. data/resources/locales/ms/languages.yml +39 -2
  544. data/resources/locales/ms/lists.yml +4 -4
  545. data/resources/locales/ms/numbers.yml +126 -6
  546. data/resources/locales/ms/territories.yml +2 -2
  547. data/resources/locales/ms/timezones.yml +2 -0
  548. data/resources/locales/ms/units.yml +148 -6
  549. data/resources/locales/mt/calendars.yml +10 -10
  550. data/resources/locales/mt/currencies.yml +2 -0
  551. data/resources/locales/mt/fields.yml +196 -102
  552. data/resources/locales/mt/numbers.yml +115 -0
  553. data/resources/locales/mt/plural_rules.yml +2 -1
  554. data/resources/locales/mt/plurals.yml +4 -3
  555. data/resources/locales/mt/timezones.yml +2 -0
  556. data/resources/locales/mt/units.yml +27 -8
  557. data/resources/locales/my/calendars.yml +23 -23
  558. data/resources/locales/my/fields.yml +32 -0
  559. data/resources/locales/my/languages.yml +45 -4
  560. data/resources/locales/my/lists.yml +6 -6
  561. data/resources/locales/my/numbers.yml +151 -36
  562. data/resources/locales/my/timezones.yml +36 -32
  563. data/resources/locales/my/units.yml +304 -14
  564. data/resources/locales/nb/calendars.yml +10 -10
  565. data/resources/locales/nb/languages.yml +33 -2
  566. data/resources/locales/nb/lists.yml +6 -6
  567. data/resources/locales/nb/numbers.yml +114 -0
  568. data/resources/locales/nb/timezones.yml +5 -1
  569. data/resources/locales/nb/units.yml +532 -231
  570. data/resources/locales/nl/calendars.yml +22 -22
  571. data/resources/locales/nl/currencies.yml +15 -6
  572. data/resources/locales/nl/fields.yml +7 -7
  573. data/resources/locales/nl/languages.yml +33 -0
  574. data/resources/locales/nl/lists.yml +6 -6
  575. data/resources/locales/nl/numbers.yml +195 -6
  576. data/resources/locales/nl/rbnf.yml +1 -1
  577. data/resources/locales/nl/timezones.yml +2 -0
  578. data/resources/locales/nl/units.yml +163 -15
  579. data/resources/locales/nl-BE/calendars.yml +22 -22
  580. data/resources/locales/nl-BE/currencies.yml +15 -6
  581. data/resources/locales/nl-BE/fields.yml +7 -7
  582. data/resources/locales/nl-BE/languages.yml +33 -0
  583. data/resources/locales/nl-BE/lists.yml +6 -6
  584. data/resources/locales/nl-BE/numbers.yml +195 -6
  585. data/resources/locales/nl-BE/timezones.yml +2 -0
  586. data/resources/locales/nl-BE/units.yml +163 -15
  587. data/resources/locales/pl/calendars.yml +7 -7
  588. data/resources/locales/pl/fields.yml +3 -0
  589. data/resources/locales/pl/languages.yml +32 -0
  590. data/resources/locales/pl/lists.yml +4 -4
  591. data/resources/locales/pl/numbers.yml +114 -0
  592. data/resources/locales/pl/timezones.yml +2 -0
  593. data/resources/locales/pl/units.yml +1420 -309
  594. data/resources/locales/pt/calendars.yml +13 -13
  595. data/resources/locales/pt/fields.yml +6 -0
  596. data/resources/locales/pt/languages.yml +35 -1
  597. data/resources/locales/pt/lists.yml +4 -4
  598. data/resources/locales/pt/numbers.yml +114 -0
  599. data/resources/locales/pt/rbnf.yml +1 -1
  600. data/resources/locales/pt/timezones.yml +2 -0
  601. data/resources/locales/pt/units.yml +599 -15
  602. data/resources/locales/pt-PT/calendars.yml +10 -10
  603. data/resources/locales/pt-PT/languages.yml +37 -3
  604. data/resources/locales/pt-PT/lists.yml +4 -4
  605. data/resources/locales/pt-PT/numbers.yml +114 -0
  606. data/resources/locales/pt-PT/plural_rules.yml +2 -2
  607. data/resources/locales/pt-PT/plurals.yml +3 -3
  608. data/resources/locales/pt-PT/territories.yml +1 -1
  609. data/resources/locales/pt-PT/timezones.yml +2 -0
  610. data/resources/locales/pt-PT/units.yml +420 -7
  611. data/resources/locales/ro/calendars.yml +10 -10
  612. data/resources/locales/ro/currencies.yml +22 -22
  613. data/resources/locales/ro/languages.yml +33 -0
  614. data/resources/locales/ro/lists.yml +4 -4
  615. data/resources/locales/ro/numbers.yml +114 -0
  616. data/resources/locales/ro/plural_rules.yml +1 -1
  617. data/resources/locales/ro/plurals.yml +3 -3
  618. data/resources/locales/ro/timezones.yml +2 -0
  619. data/resources/locales/ro/units.yml +580 -124
  620. data/resources/locales/ru/calendars.yml +23 -23
  621. data/resources/locales/ru/languages.yml +34 -1
  622. data/resources/locales/ru/lists.yml +4 -4
  623. data/resources/locales/ru/numbers.yml +114 -0
  624. data/resources/locales/ru/rbnf.yml +240 -12
  625. data/resources/locales/ru/territories.yml +7 -7
  626. data/resources/locales/ru/timezones.yml +4 -0
  627. data/resources/locales/ru/units.yml +858 -251
  628. data/resources/locales/sk/calendars.yml +9 -9
  629. data/resources/locales/sk/currencies.yml +7 -7
  630. data/resources/locales/sk/fields.yml +8 -0
  631. data/resources/locales/sk/languages.yml +34 -0
  632. data/resources/locales/sk/lists.yml +6 -6
  633. data/resources/locales/sk/numbers.yml +114 -0
  634. data/resources/locales/sk/timezones.yml +2 -0
  635. data/resources/locales/sk/units.yml +812 -330
  636. data/resources/locales/sl/calendars.yml +9 -9
  637. data/resources/locales/sl/languages.yml +36 -0
  638. data/resources/locales/sl/lists.yml +6 -6
  639. data/resources/locales/sl/numbers.yml +114 -0
  640. data/resources/locales/sl/timezones.yml +4 -2
  641. data/resources/locales/sl/units.yml +967 -243
  642. data/resources/locales/sq/calendars.yml +11 -11
  643. data/resources/locales/sq/currencies.yml +1 -1
  644. data/resources/locales/sq/fields.yml +20 -0
  645. data/resources/locales/sq/languages.yml +41 -0
  646. data/resources/locales/sq/lists.yml +6 -6
  647. data/resources/locales/sq/numbers.yml +114 -0
  648. data/resources/locales/sq/timezones.yml +4 -0
  649. data/resources/locales/sq/units.yml +461 -6
  650. data/resources/locales/sr/calendars.yml +16 -16
  651. data/resources/locales/sr/fields.yml +6 -0
  652. data/resources/locales/sr/languages.yml +37 -0
  653. data/resources/locales/sr/lists.yml +6 -6
  654. data/resources/locales/sr/numbers.yml +114 -0
  655. data/resources/locales/sr/timezones.yml +4 -0
  656. data/resources/locales/sr/units.yml +676 -68
  657. data/resources/locales/sr-Cyrl-ME/calendars.yml +18 -18
  658. data/resources/locales/sr-Cyrl-ME/fields.yml +6 -0
  659. data/resources/locales/sr-Cyrl-ME/languages.yml +37 -0
  660. data/resources/locales/sr-Cyrl-ME/lists.yml +6 -6
  661. data/resources/locales/sr-Cyrl-ME/numbers.yml +114 -0
  662. data/resources/locales/sr-Cyrl-ME/timezones.yml +4 -0
  663. data/resources/locales/sr-Cyrl-ME/units.yml +676 -68
  664. data/resources/locales/sr-Latn-ME/calendars.yml +18 -18
  665. data/resources/locales/sr-Latn-ME/currencies.yml +1197 -1197
  666. data/resources/locales/sr-Latn-ME/fields.yml +432 -426
  667. data/resources/locales/sr-Latn-ME/languages.yml +531 -494
  668. data/resources/locales/sr-Latn-ME/lists.yml +6 -6
  669. data/resources/locales/sr-Latn-ME/numbers.yml +114 -0
  670. data/resources/locales/sr-Latn-ME/timezones.yml +4 -0
  671. data/resources/locales/sr-Latn-ME/units.yml +677 -69
  672. data/resources/locales/sv/calendars.yml +11 -11
  673. data/resources/locales/sv/currencies.yml +9 -7
  674. data/resources/locales/sv/fields.yml +5 -1
  675. data/resources/locales/sv/languages.yml +32 -0
  676. data/resources/locales/sv/lists.yml +4 -4
  677. data/resources/locales/sv/numbers.yml +122 -3
  678. data/resources/locales/sv/territories.yml +1 -1
  679. data/resources/locales/sv/timezones.yml +2 -0
  680. data/resources/locales/sv/units.yml +724 -328
  681. data/resources/locales/sw/calendars.yml +11 -11
  682. data/resources/locales/sw/fields.yml +24 -0
  683. data/resources/locales/sw/languages.yml +41 -0
  684. data/resources/locales/sw/lists.yml +2 -2
  685. data/resources/locales/sw/numbers.yml +114 -0
  686. data/resources/locales/sw/timezones.yml +2 -0
  687. data/resources/locales/sw/units.yml +423 -17
  688. data/resources/locales/ta/calendars.yml +1 -1
  689. data/resources/locales/ta/languages.yml +38 -2
  690. data/resources/locales/ta/lists.yml +4 -4
  691. data/resources/locales/ta/numbers.yml +117 -2
  692. data/resources/locales/ta/territories.yml +2 -2
  693. data/resources/locales/ta/timezones.yml +4 -0
  694. data/resources/locales/ta/units.yml +173 -148
  695. data/resources/locales/th/calendars.yml +9 -9
  696. data/resources/locales/th/currencies.yml +1 -0
  697. data/resources/locales/th/fields.yml +1 -0
  698. data/resources/locales/th/languages.yml +50 -19
  699. data/resources/locales/th/lists.yml +6 -6
  700. data/resources/locales/th/numbers.yml +114 -0
  701. data/resources/locales/th/timezones.yml +5 -1
  702. data/resources/locales/th/units.yml +25 -7
  703. data/resources/locales/tr/calendars.yml +9 -9
  704. data/resources/locales/tr/fields.yml +8 -0
  705. data/resources/locales/tr/languages.yml +36 -5
  706. data/resources/locales/tr/lists.yml +4 -4
  707. data/resources/locales/tr/numbers.yml +214 -20
  708. data/resources/locales/tr/timezones.yml +2 -0
  709. data/resources/locales/tr/units.yml +191 -13
  710. data/resources/locales/uk/calendars.yml +22 -21
  711. data/resources/locales/uk/fields.yml +18 -18
  712. data/resources/locales/uk/languages.yml +42 -11
  713. data/resources/locales/uk/lists.yml +8 -8
  714. data/resources/locales/uk/numbers.yml +114 -0
  715. data/resources/locales/uk/rbnf.yml +12 -0
  716. data/resources/locales/uk/territories.yml +1 -1
  717. data/resources/locales/uk/timezones.yml +9 -5
  718. data/resources/locales/uk/units.yml +742 -359
  719. data/resources/locales/ur/calendars.yml +4 -4
  720. data/resources/locales/ur/languages.yml +42 -0
  721. data/resources/locales/ur/lists.yml +10 -10
  722. data/resources/locales/ur/numbers.yml +115 -1
  723. data/resources/locales/ur/territories.yml +1 -1
  724. data/resources/locales/ur/timezones.yml +5 -1
  725. data/resources/locales/ur/units.yml +397 -10
  726. data/resources/locales/vi/calendars.yml +12 -12
  727. data/resources/locales/vi/currencies.yml +2 -0
  728. data/resources/locales/vi/fields.yml +3 -0
  729. data/resources/locales/vi/languages.yml +34 -0
  730. data/resources/locales/vi/lists.yml +4 -4
  731. data/resources/locales/vi/numbers.yml +114 -0
  732. data/resources/locales/vi/timezones.yml +2 -0
  733. data/resources/locales/vi/units.yml +348 -10
  734. data/resources/locales/xh/calendars.yml +101 -101
  735. data/resources/locales/xh/currencies.yml +664 -82
  736. data/resources/locales/xh/fields.yml +107 -0
  737. data/resources/locales/xh/languages.yml +38 -2
  738. data/resources/locales/xh/numbers.yml +114 -0
  739. data/resources/locales/xh/territories.yml +264 -2
  740. data/resources/locales/xh/timezones.yml +1393 -6
  741. data/resources/locales/xh/units.yml +4 -2
  742. data/resources/locales/zh/currencies.yml +37 -10
  743. data/resources/locales/zh/languages.yml +38 -3
  744. data/resources/locales/zh/lists.yml +12 -12
  745. data/resources/locales/zh/numbers.yml +117 -0
  746. data/resources/locales/zh/timezones.yml +7 -3
  747. data/resources/locales/zh/units.yml +227 -57
  748. data/resources/locales/zh-Hant/currencies.yml +27 -9
  749. data/resources/locales/zh-Hant/languages.yml +47 -1
  750. data/resources/locales/zh-Hant/lists.yml +12 -12
  751. data/resources/locales/zh-Hant/numbers.yml +115 -0
  752. data/resources/locales/zh-Hant/timezones.yml +4 -0
  753. data/resources/locales/zh-Hant/units.yml +44 -8
  754. data/resources/locales/zu/calendars.yml +7 -7
  755. data/resources/locales/zu/currencies.yml +1 -0
  756. data/resources/locales/zu/fields.yml +53 -0
  757. data/resources/locales/zu/languages.yml +39 -0
  758. data/resources/locales/zu/numbers.yml +148 -10
  759. data/resources/locales/zu/timezones.yml +2 -0
  760. data/resources/locales/zu/units.yml +647 -6
  761. data/resources/shared/aliases.yml +4 -0
  762. data/resources/shared/bcp47_timezone_metadata.yml +5 -1
  763. data/resources/shared/currency_digits_and_rounding.yml +3 -0
  764. data/resources/shared/hyphenation/ca.yml +1 -1
  765. data/resources/shared/hyphenation/de-AT.yml +1 -1
  766. data/resources/shared/hyphenation/de-CH.yml +1 -1
  767. data/resources/shared/hyphenation/de-DE.yml +1 -1
  768. data/resources/shared/hyphenation/fr.yml +1 -1
  769. data/resources/shared/hyphenation/hr-HR.yml +1 -1
  770. data/resources/shared/hyphenation/mn-MN.yml +1 -1
  771. data/resources/shared/hyphenation/sl-SI.yml +1 -1
  772. data/resources/shared/likely_subtags.yml +6180 -11
  773. data/resources/shared/metazones.yml +29 -20
  774. data/resources/shared/numbering_systems.yml +6 -0
  775. data/resources/shared/parent_locales.yml +13 -5
  776. data/resources/shared/postal_codes.yml +160 -125
  777. data/resources/shared/rbnf_root.yml +6 -0
  778. data/resources/shared/segments/dictionaries/cjdict.dump +0 -0
  779. data/resources/shared/segments/dictionaries/laodict.dump +0 -0
  780. data/resources/shared/segments/dictionaries/thaidict.dump +0 -0
  781. data/resources/shared/segments/rules/el/sentence.yml +719 -711
  782. data/resources/shared/segments/rules/en-US-POSIX/word.yml +535 -527
  783. data/resources/shared/segments/rules/fi/word.yml +591 -0
  784. data/resources/shared/segments/rules/ja/line.yml +509 -500
  785. data/resources/shared/segments/rules/ja/word.yml +535 -527
  786. data/resources/shared/segments/rules/root/grapheme.yml +376 -370
  787. data/resources/shared/segments/rules/root/line.yml +509 -500
  788. data/resources/shared/segments/rules/root/sentence.yml +719 -711
  789. data/resources/shared/segments/rules/root/word.yml +535 -527
  790. data/resources/shared/segments/rules/sv/word.yml +591 -0
  791. data/resources/shared/segments/rules/zh/line.yml +509 -500
  792. data/resources/shared/segments/rules/zh-Hant/line.yml +509 -500
  793. data/resources/shared/segments/tests/icu_grapheme_break_test_results.yml +1717 -0
  794. data/resources/shared/segments/tests/icu_line_break_test_results.yml +20284 -0
  795. data/resources/shared/segments/tests/icu_sentence_break_test_results.yml +1134 -0
  796. data/resources/shared/segments/tests/icu_word_break_test_results.yml +6275 -0
  797. data/resources/shared/territories_containment.yml +1 -0
  798. data/resources/shared/timezone_regions.yml +15 -6
  799. data/resources/shared/transforms/Arabic-Latin.yml +42 -0
  800. data/resources/shared/transforms/Cyrillic-Latin.yml +23 -4
  801. data/resources/shared/transforms/Devanagari-InterIndic.yml +1 -0
  802. data/resources/shared/transforms/Devanagari-Latin.yml +1 -1
  803. data/resources/shared/transforms/Greek-Latin.yml +2 -1
  804. data/resources/shared/transforms/Han-Latin.yml +9 -9
  805. data/resources/shared/transforms/Han-Spacedhan.yml +18 -1
  806. data/resources/shared/transforms/Hebrew-Latin.yml +5 -2
  807. data/resources/shared/transforms/InterIndic-Latin.yml +4 -1
  808. data/resources/shared/transforms/Japn-Latn.yml +4132 -0
  809. data/resources/shared/transforms/Khmer-Latin.yml +211 -0
  810. data/resources/shared/transforms/Lao-Latin.yml +90 -0
  811. data/resources/shared/transforms/Latin-Armenian.yml +4 -0
  812. data/resources/shared/transforms/Latin-Ethiopic.yml +3 -3
  813. data/resources/shared/transforms/Malayalam-InterIndic.yml +5 -0
  814. data/resources/shared/transforms/Malayalam-Latin.yml +1 -1
  815. data/resources/shared/transforms/Myanmar-Latin.yml +1 -0
  816. data/resources/shared/transforms/Oriya-Latin.yml +1 -1
  817. data/resources/shared/transforms/Simplified-Traditional.yml +20 -4
  818. data/resources/shared/transforms/Sinhala-Latin.yml +100 -0
  819. data/resources/shared/transforms/am-Ethi-t-am-brai.yml +413 -0
  820. data/resources/shared/transforms/am-Ethi-t-am-ethi-m0-geminate.yml +6900 -0
  821. data/resources/shared/transforms/am-Ethi-t-d0-morse.yml +428 -0
  822. data/resources/shared/transforms/byn-Ethi-t-byn-latn-m0-tekie-alibekit.yml +468 -0
  823. data/resources/shared/transforms/byn-Ethi-t-byn-latn-m0-xaleget.yml +398 -0
  824. data/resources/shared/transforms/gz-Ethi-t-und-sarb.yml +85 -0
  825. data/resources/shared/transforms/my-t-my-d0-zawgyi.yml +40 -36
  826. data/resources/shared/transforms/my-t-my-s0-zawgyi.yml +2 -2
  827. data/resources/shared/transforms/sgw-Ethi-t-und-ethi.yml +105 -0
  828. data/resources/shared/transforms/transform_id_map.yml +827 -757
  829. data/resources/shared/transforms/und-Ethi-t-und-cyrl-m0-gutgarts.yml +497 -0
  830. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-aethiopi-geminate.yml +13 -0
  831. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-aethiopi.yml +515 -0
  832. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-alaloc-geminate.yml +13 -0
  833. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-alaloc.yml +466 -0
  834. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-beta_metsehaf-geminate.yml +13 -0
  835. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-beta_metsehaf.yml +515 -0
  836. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-es3842.yml +536 -0
  837. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-ies-jes-1964-geminate.yml +13 -0
  838. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-ies-jes-1964.yml +515 -0
  839. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-lambdin.yml +487 -0
  840. data/resources/shared/transforms/und-Ethi-t-und-latn-m0-sera.yml +575 -0
  841. data/resources/shared/transforms/und-Ethi-t-und-latn.yml +12 -0
  842. data/resources/shared/validity_data.yml +42 -10
  843. data/resources/unicode_data/blocks/alchemical_symbols.yml +128 -0
  844. data/resources/unicode_data/blocks/arabic_extended_c.yml +49 -0
  845. data/resources/unicode_data/blocks/cjk_unified_ideographs_extension_c.yml +2 -2
  846. data/resources/unicode_data/blocks/cjk_unified_ideographs_extension_h.yml +33 -0
  847. data/resources/unicode_data/blocks/cyrillic_extended_d.yml +1009 -0
  848. data/resources/unicode_data/blocks/devanagari_extended_a.yml +161 -0
  849. data/resources/unicode_data/blocks/egyptian_hieroglyph_format_controls.yml +464 -0
  850. data/resources/unicode_data/blocks/egyptian_hieroglyphs.yml +16 -0
  851. data/resources/unicode_data/blocks/geometric_shapes_extended.yml +16 -0
  852. data/resources/unicode_data/blocks/kaktovik_numerals.yml +321 -0
  853. data/resources/unicode_data/blocks/kannada.yml +16 -0
  854. data/resources/unicode_data/blocks/kawi.yml +1377 -0
  855. data/resources/unicode_data/blocks/khojki.yml +48 -0
  856. data/resources/unicode_data/blocks/lao.yml +16 -0
  857. data/resources/unicode_data/blocks/latin_extended_g.yml +96 -0
  858. data/resources/unicode_data/blocks/nag_mundari.yml +673 -0
  859. data/resources/unicode_data/blocks/small_kana_extension.yml +32 -0
  860. data/resources/unicode_data/blocks/symbols_and_pictographs_extended_a.yml +304 -0
  861. data/resources/unicode_data/blocks/transport_and_map_symbols.yml +16 -0
  862. data/resources/unicode_data/blocks.yml +29 -1
  863. data/resources/unicode_data/properties/Age/15.0/value.dump +0 -0
  864. data/resources/unicode_data/properties/Alphabetic/value.dump +0 -0
  865. data/resources/unicode_data/properties/Bidi_Class/L/value.dump +0 -0
  866. data/resources/unicode_data/properties/Bidi_Class/NSM/value.dump +0 -0
  867. data/resources/unicode_data/properties/Bidi_Class/ON/value.dump +0 -0
  868. data/resources/unicode_data/properties/Bidi_Mirrored/N/value.dump +0 -0
  869. data/resources/unicode_data/properties/Block/Arabic Extended-C/value.dump +3 -0
  870. data/resources/unicode_data/properties/Block/CJK Unified Ideographs Extension H/value.dump +3 -0
  871. data/resources/unicode_data/properties/Block/Cyrillic Extended-D/value.dump +3 -0
  872. data/resources/unicode_data/properties/Block/Devanagari Extended-A/value.dump +0 -0
  873. data/resources/unicode_data/properties/Block/Egyptian Hieroglyph Format Controls/value.dump +1 -1
  874. data/resources/unicode_data/properties/Block/Kaktovik Numerals/value.dump +3 -0
  875. data/resources/unicode_data/properties/Block/Kawi/value.dump +0 -0
  876. data/resources/unicode_data/properties/Block/Nag Mundari/value.dump +3 -0
  877. data/resources/unicode_data/properties/Canonical_Combining_Class/0/value.dump +0 -0
  878. data/resources/unicode_data/properties/Canonical_Combining_Class/220/value.dump +5 -3
  879. data/resources/unicode_data/properties/Canonical_Combining_Class/230/value.dump +0 -0
  880. data/resources/unicode_data/properties/Canonical_Combining_Class/232/value.dump +3 -3
  881. data/resources/unicode_data/properties/Canonical_Combining_Class/9/value.dump +3 -2
  882. data/resources/unicode_data/properties/Case_Ignorable/value.dump +0 -0
  883. data/resources/unicode_data/properties/Cased/value.dump +0 -0
  884. data/resources/unicode_data/properties/Diacritic/value.dump +0 -0
  885. data/resources/unicode_data/properties/East_Asian_Width/N/value.dump +0 -0
  886. data/resources/unicode_data/properties/East_Asian_Width/W/value.dump +0 -0
  887. data/resources/unicode_data/properties/Emoji/value.dump +0 -0
  888. data/resources/unicode_data/properties/Emoji_Modifier_Base/value.dump +1 -1
  889. data/resources/unicode_data/properties/Emoji_Presentation/value.dump +0 -0
  890. data/resources/unicode_data/properties/General_Category/C/f/value.dump +0 -0
  891. data/resources/unicode_data/properties/General_Category/L/l/value.dump +0 -0
  892. data/resources/unicode_data/properties/General_Category/L/m/value.dump +5 -3
  893. data/resources/unicode_data/properties/General_Category/L/o/value.dump +0 -0
  894. data/resources/unicode_data/properties/General_Category/M/c/value.dump +0 -0
  895. data/resources/unicode_data/properties/General_Category/M/n/value.dump +0 -0
  896. data/resources/unicode_data/properties/General_Category/N/d/value.dump +0 -0
  897. data/resources/unicode_data/properties/General_Category/N/o/value.dump +0 -0
  898. data/resources/unicode_data/properties/General_Category/P/o/value.dump +0 -0
  899. data/resources/unicode_data/properties/General_Category/S/o/value.dump +0 -0
  900. data/resources/unicode_data/properties/Grapheme_Base/value.dump +0 -0
  901. data/resources/unicode_data/properties/Grapheme_Cluster_Break/Control/value.dump +0 -0
  902. data/resources/unicode_data/properties/Grapheme_Cluster_Break/Extend/value.dump +0 -0
  903. data/resources/unicode_data/properties/Grapheme_Cluster_Break/Prepend/value.dump +0 -0
  904. data/resources/unicode_data/properties/Grapheme_Cluster_Break/SpacingMark/value.dump +0 -0
  905. data/resources/unicode_data/properties/Grapheme_Extend/value.dump +0 -0
  906. data/resources/unicode_data/properties/Grapheme_Link/value.dump +3 -2
  907. data/resources/unicode_data/properties/ID_Continue/value.dump +0 -0
  908. data/resources/unicode_data/properties/ID_Start/value.dump +0 -0
  909. data/resources/unicode_data/properties/Ideographic/value.dump +0 -0
  910. data/resources/unicode_data/properties/Indic_Positional_Category/Bottom/value.dump +5 -3
  911. data/resources/unicode_data/properties/Indic_Positional_Category/Left/value.dump +3 -2
  912. data/resources/unicode_data/properties/Indic_Positional_Category/Right/value.dump +0 -0
  913. data/resources/unicode_data/properties/Indic_Positional_Category/Top/value.dump +0 -0
  914. data/resources/unicode_data/properties/Indic_Syllabic_Category/Bindu/value.dump +0 -0
  915. data/resources/unicode_data/properties/Indic_Syllabic_Category/Cantillation_Mark/value.dump +4 -1
  916. data/resources/unicode_data/properties/Indic_Syllabic_Category/Consonant/value.dump +0 -0
  917. data/resources/unicode_data/properties/Indic_Syllabic_Category/Consonant_Preceding_Repha/value.dump +3 -2
  918. data/resources/unicode_data/properties/Indic_Syllabic_Category/Gemination_Mark/value.dump +4 -1
  919. data/resources/unicode_data/properties/Indic_Syllabic_Category/Invisible_Stacker/value.dump +3 -2
  920. data/resources/unicode_data/properties/Indic_Syllabic_Category/Number/value.dump +0 -0
  921. data/resources/unicode_data/properties/Indic_Syllabic_Category/Pure_Killer/value.dump +3 -2
  922. data/resources/unicode_data/properties/Indic_Syllabic_Category/Syllable_Modifier/value.dump +3 -2
  923. data/resources/unicode_data/properties/Indic_Syllabic_Category/Visarga/value.dump +3 -2
  924. data/resources/unicode_data/properties/Indic_Syllabic_Category/Vowel_Dependent/value.dump +6 -3
  925. data/resources/unicode_data/properties/Indic_Syllabic_Category/Vowel_Independent/value.dump +0 -0
  926. data/resources/unicode_data/properties/Line_Break/AL/value.dump +0 -0
  927. data/resources/unicode_data/properties/Line_Break/BA/value.dump +0 -0
  928. data/resources/unicode_data/properties/Line_Break/BB/value.dump +0 -0
  929. data/resources/unicode_data/properties/Line_Break/CJ/value.dump +5 -3
  930. data/resources/unicode_data/properties/Line_Break/CL/value.dump +4 -2
  931. data/resources/unicode_data/properties/Line_Break/CM/value.dump +0 -0
  932. data/resources/unicode_data/properties/Line_Break/EB/value.dump +1 -1
  933. data/resources/unicode_data/properties/Line_Break/GL/value.dump +6 -3
  934. data/resources/unicode_data/properties/Line_Break/ID/value.dump +0 -0
  935. data/resources/unicode_data/properties/Line_Break/NU/value.dump +0 -0
  936. data/resources/unicode_data/properties/Line_Break/OP/value.dump +4 -2
  937. data/resources/unicode_data/properties/Line_Break/PO/value.dump +3 -2
  938. data/resources/unicode_data/properties/Line_Break/SA/value.dump +0 -0
  939. data/resources/unicode_data/properties/Lowercase/value.dump +0 -0
  940. data/resources/unicode_data/properties/Numeric_Type/0/value.dump +0 -0
  941. data/resources/unicode_data/properties/Numeric_Type/1/value.dump +5 -3
  942. data/resources/unicode_data/properties/Numeric_Type/2/value.dump +5 -3
  943. data/resources/unicode_data/properties/Numeric_Type/3/value.dump +5 -3
  944. data/resources/unicode_data/properties/Numeric_Type/4/value.dump +5 -3
  945. data/resources/unicode_data/properties/Numeric_Type/5/value.dump +5 -3
  946. data/resources/unicode_data/properties/Numeric_Type/6/value.dump +5 -3
  947. data/resources/unicode_data/properties/Numeric_Type/7/value.dump +5 -3
  948. data/resources/unicode_data/properties/Numeric_Type/8/value.dump +5 -3
  949. data/resources/unicode_data/properties/Numeric_Type/9/value.dump +5 -3
  950. data/resources/unicode_data/properties/Numeric_Type/value.dump +0 -0
  951. data/resources/unicode_data/properties/Other_Alphabetic/value.dump +0 -0
  952. data/resources/unicode_data/properties/Other_Lowercase/value.dump +9 -5
  953. data/resources/unicode_data/properties/Script/Arabic/value.dump +0 -0
  954. data/resources/unicode_data/properties/Script/Common/value.dump +0 -0
  955. data/resources/unicode_data/properties/Script/Cyrillic/value.dump +0 -0
  956. data/resources/unicode_data/properties/Script/Devanagari/value.dump +0 -0
  957. data/resources/unicode_data/properties/Script/Egyptian_Hieroglyphs/value.dump +0 -0
  958. data/resources/unicode_data/properties/Script/Han/value.dump +0 -0
  959. data/resources/unicode_data/properties/Script/Hiragana/value.dump +0 -0
  960. data/resources/unicode_data/properties/Script/Kannada/value.dump +1 -1
  961. data/resources/unicode_data/properties/Script/Katakana/value.dump +0 -0
  962. data/resources/unicode_data/properties/Script/Kawi/value.dump +0 -0
  963. data/resources/unicode_data/properties/Script/Khojki/value.dump +0 -0
  964. data/resources/unicode_data/properties/Script/Lao/value.dump +1 -1
  965. data/resources/unicode_data/properties/Script/Latin/value.dump +0 -0
  966. data/resources/unicode_data/properties/Script/Nag_Mundari/value.dump +3 -0
  967. data/resources/unicode_data/properties/Sentence_Break/Extend/value.dump +0 -0
  968. data/resources/unicode_data/properties/Sentence_Break/Format/value.dump +0 -0
  969. data/resources/unicode_data/properties/Sentence_Break/Lower/value.dump +0 -0
  970. data/resources/unicode_data/properties/Sentence_Break/Numeric/value.dump +0 -0
  971. data/resources/unicode_data/properties/Sentence_Break/OLetter/value.dump +0 -0
  972. data/resources/unicode_data/properties/Sentence_Break/STerm/value.dump +0 -0
  973. data/resources/unicode_data/properties/Sentence_Terminal/value.dump +0 -0
  974. data/resources/unicode_data/properties/Soft_Dotted/value.dump +4 -2
  975. data/resources/unicode_data/properties/Terminal_Punctuation/value.dump +0 -0
  976. data/resources/unicode_data/properties/Unified_Ideograph/value.dump +0 -0
  977. data/resources/unicode_data/properties/Word_Break/ALetter/value.dump +0 -0
  978. data/resources/unicode_data/properties/Word_Break/Extend/value.dump +0 -0
  979. data/resources/unicode_data/properties/Word_Break/Format/value.dump +0 -0
  980. data/resources/unicode_data/properties/Word_Break/Katakana/value.dump +0 -0
  981. data/resources/unicode_data/properties/Word_Break/Numeric/value.dump +0 -0
  982. data/resources/unicode_data/properties/XID_Continue/value.dump +0 -0
  983. data/resources/unicode_data/properties/XID_Start/value.dump +0 -0
  984. data/resources/unicode_data/property_value_aliases.yml +21 -1
  985. data/spec/formatters/numbers/rbnf/locales/ar/rbnf_test.yml +626 -626
  986. data/spec/formatters/numbers/rbnf/locales/bg/rbnf_test.yml +1619 -215
  987. data/spec/formatters/numbers/rbnf/locales/el/rbnf_test.yml +116 -116
  988. data/spec/formatters/numbers/rbnf/locales/es/rbnf_test.yml +234 -0
  989. data/spec/formatters/numbers/rbnf/locales/he/rbnf_test.yml +116 -116
  990. data/spec/formatters/numbers/rbnf/locales/it/rbnf_test.yml +234 -0
  991. data/spec/formatters/numbers/rbnf/locales/kk/rbnf_test.yml +706 -0
  992. data/spec/formatters/numbers/rbnf/locales/ru/rbnf_test.yml +2899 -115
  993. data/spec/formatters/numbers/rbnf/locales/uk/rbnf_test.yml +116 -116
  994. data/spec/localized/localized_datetime_spec.rb +1 -1
  995. data/spec/parsers/symbol_table_spec.rb +1 -3
  996. data/spec/parsers/unicode_regex/character_set_spec.rb +1 -1
  997. data/spec/segmentation/rule_set_spec.rb +50 -54
  998. data/spec/shared/calendar_spec.rb +2 -2
  999. data/spec/shared/currencies_spec.rb +1 -1
  1000. data/spec/shared/numbers_spec.rb +1 -1
  1001. data/spec/shared/unit_spec.rb +10 -10
  1002. data/spec/spec_helper.rb +0 -2
  1003. data/spec/timezones/tests/af.yml +73 -10
  1004. data/spec/timezones/tests/ar.yml +73 -10
  1005. data/spec/timezones/tests/az.yml +73 -10
  1006. data/spec/timezones/tests/be.yml +73 -10
  1007. data/spec/timezones/tests/bg.yml +79 -16
  1008. data/spec/timezones/tests/bn.yml +128 -69
  1009. data/spec/timezones/tests/bo.yml +85 -22
  1010. data/spec/timezones/tests/bs.yml +73 -10
  1011. data/spec/timezones/tests/ca.yml +85 -22
  1012. data/spec/timezones/tests/cs.yml +2059 -1996
  1013. data/spec/timezones/tests/cy.yml +73 -10
  1014. data/spec/timezones/tests/da.yml +76 -13
  1015. data/spec/timezones/tests/de-AT.yml +1226 -1163
  1016. data/spec/timezones/tests/de-CH.yml +1226 -1163
  1017. data/spec/timezones/tests/de.yml +1226 -1163
  1018. data/spec/timezones/tests/el.yml +74 -11
  1019. data/spec/timezones/tests/en-001.yml +105 -42
  1020. data/spec/timezones/tests/en-150.yml +105 -42
  1021. data/spec/timezones/tests/en-AU.yml +99 -36
  1022. data/spec/timezones/tests/en-CA.yml +152 -89
  1023. data/spec/timezones/tests/en-GB.yml +87 -24
  1024. data/spec/timezones/tests/en-IE.yml +105 -42
  1025. data/spec/timezones/tests/en-IN.yml +109 -46
  1026. data/spec/timezones/tests/en-NZ.yml +105 -42
  1027. data/spec/timezones/tests/en-SG.yml +105 -42
  1028. data/spec/timezones/tests/en-US.yml +90 -27
  1029. data/spec/timezones/tests/en-ZA.yml +105 -42
  1030. data/spec/timezones/tests/en.yml +90 -27
  1031. data/spec/timezones/tests/eo.yml +85 -22
  1032. data/spec/timezones/tests/es-419.yml +73 -10
  1033. data/spec/timezones/tests/es-AR.yml +73 -10
  1034. data/spec/timezones/tests/es-CO.yml +73 -10
  1035. data/spec/timezones/tests/es-MX.yml +73 -10
  1036. data/spec/timezones/tests/es-US.yml +74 -11
  1037. data/spec/timezones/tests/es.yml +77 -14
  1038. data/spec/timezones/tests/et.yml +73 -10
  1039. data/spec/timezones/tests/eu.yml +74 -11
  1040. data/spec/timezones/tests/fa.yml +73 -10
  1041. data/spec/timezones/tests/fi.yml +73 -10
  1042. data/spec/timezones/tests/fil.yml +266 -203
  1043. data/spec/timezones/tests/fr-BE.yml +94 -31
  1044. data/spec/timezones/tests/fr-CA.yml +74 -11
  1045. data/spec/timezones/tests/fr-CH.yml +94 -31
  1046. data/spec/timezones/tests/fr.yml +94 -31
  1047. data/spec/timezones/tests/ga.yml +73 -10
  1048. data/spec/timezones/tests/gl.yml +2198 -2135
  1049. data/spec/timezones/tests/gu.yml +82 -19
  1050. data/spec/timezones/tests/he.yml +91 -28
  1051. data/spec/timezones/tests/hi.yml +88 -25
  1052. data/spec/timezones/tests/hr.yml +95 -32
  1053. data/spec/timezones/tests/hu.yml +73 -10
  1054. data/spec/timezones/tests/hy.yml +73 -10
  1055. data/spec/timezones/tests/id.yml +74 -11
  1056. data/spec/timezones/tests/is.yml +76 -13
  1057. data/spec/timezones/tests/it-CH.yml +89 -26
  1058. data/spec/timezones/tests/it.yml +89 -26
  1059. data/spec/timezones/tests/ja.yml +74 -11
  1060. data/spec/timezones/tests/ka.yml +73 -10
  1061. data/spec/timezones/tests/kk.yml +161 -98
  1062. data/spec/timezones/tests/km.yml +73 -10
  1063. data/spec/timezones/tests/kn.yml +77 -14
  1064. data/spec/timezones/tests/ko.yml +84 -21
  1065. data/spec/timezones/tests/lo.yml +73 -10
  1066. data/spec/timezones/tests/lt.yml +73 -10
  1067. data/spec/timezones/tests/lv.yml +73 -10
  1068. data/spec/timezones/tests/mk.yml +134 -71
  1069. data/spec/timezones/tests/mr.yml +84 -21
  1070. data/spec/timezones/tests/ms.yml +84 -21
  1071. data/spec/timezones/tests/mt.yml +72 -9
  1072. data/spec/timezones/tests/my.yml +300 -237
  1073. data/spec/timezones/tests/nb.yml +75 -12
  1074. data/spec/timezones/tests/nl-BE.yml +74 -11
  1075. data/spec/timezones/tests/nl.yml +74 -11
  1076. data/spec/timezones/tests/pl.yml +73 -10
  1077. data/spec/timezones/tests/pt-PT.yml +75 -12
  1078. data/spec/timezones/tests/pt.yml +73 -10
  1079. data/spec/timezones/tests/ro.yml +73 -10
  1080. data/spec/timezones/tests/ru.yml +87 -24
  1081. data/spec/timezones/tests/sk.yml +73 -10
  1082. data/spec/timezones/tests/sl.yml +76 -13
  1083. data/spec/timezones/tests/sq.yml +73 -10
  1084. data/spec/timezones/tests/sr-Cyrl-ME.yml +2263 -2200
  1085. data/spec/timezones/tests/sr-Latn-ME.yml +73 -10
  1086. data/spec/timezones/tests/sr.yml +73 -10
  1087. data/spec/timezones/tests/sv.yml +75 -12
  1088. data/spec/timezones/tests/sw.yml +73 -10
  1089. data/spec/timezones/tests/ta.yml +84 -21
  1090. data/spec/timezones/tests/th.yml +76 -13
  1091. data/spec/timezones/tests/tr.yml +73 -10
  1092. data/spec/timezones/tests/uk.yml +80 -17
  1093. data/spec/timezones/tests/ur.yml +88 -25
  1094. data/spec/timezones/tests/vi.yml +74 -11
  1095. data/spec/timezones/tests/xh.yml +2297 -2234
  1096. data/spec/timezones/tests/zh-Hant.yml +74 -11
  1097. data/spec/timezones/tests/zh.yml +82 -19
  1098. data/spec/timezones/tests/zu.yml +73 -10
  1099. data/spec/timezones/timezone_spec.rb +3 -0
  1100. data/spec/transforms/test_data.yml +568 -562
  1101. data/twitter_cldr.gemspec +24 -12
  1102. metadata +74 -18
  1103. data/lib/twitter_cldr/segmentation/line_iterator.rb +0 -23
data/README.md CHANGED
@@ -1,1111 +0,0 @@
1
- ## twitter-cldr-rb ![Unit Tests](https://github.com/camertron/rux/actions/workflows/unit_tests.yml/badge.svg?branch=master) [![Code Climate](https://codeclimate.com/github/twitter/twitter-cldr-rb.png)](https://codeclimate.com/github/twitter/twitter-cldr-rb) [![Coverage Status](https://coveralls.io/repos/twitter/twitter-cldr-rb/badge.png?branch=master)](https://coveralls.io/r/twitter/twitter-cldr-rb?branch=master)
2
-
3
- TwitterCldr uses Unicode's Common Locale Data Repository (CLDR) to format certain types of text into their
4
- localized equivalents. Currently supported types of text include dates, times, currencies, decimals, percentages, and symbols.
5
-
6
- ## Installation
7
-
8
- `gem install twitter_cldr`
9
-
10
- ## Usage
11
-
12
- ```ruby
13
- require 'twitter_cldr'
14
- ```
15
-
16
- ### Basics
17
-
18
- Get a list of all currently supported locales (these are all supported on twitter.com):
19
-
20
- ```ruby
21
- TwitterCldr.supported_locales # [:af, :ar, :az, :be, :bg, :bn, ... ]
22
- ```
23
-
24
- Determine if a locale is supported by TwitterCLDR:
25
-
26
- ```ruby
27
- TwitterCldr.supported_locale?(:es) # true
28
- TwitterCldr.supported_locale?(:xx) # false
29
- ```
30
-
31
-
32
- TwitterCldr patches core Ruby objects like `Integer` and `Date` to make localization as straightforward as possible.
33
-
34
- ### Numbers
35
-
36
- `Integer` and `Float` objects are supported (as well as `Fixnum` and `Bignum` for Ruby versions < 2.4). Here are some examples:
37
-
38
- ```ruby
39
- # default formatting with to_s
40
- 1337.localize(:es).to_s # "1.337"
41
-
42
- # currencies, default USD
43
- 1337.localize(:es).to_currency.to_s # "1.337,00 $"
44
- 1337.localize(:es).to_currency.to_s(:currency => "EUR") # "1.337,00 €"
45
-
46
- # percentages
47
- 1337.localize(:es).to_percent.to_s # "1.337 %"
48
- 1337.localize(:es).to_percent.to_s(:precision => 2) # "1.337,00 %"
49
-
50
- # decimals
51
- 1337.localize(:es).to_decimal.to_s(:precision => 3) # "1.337,000"
52
- ```
53
-
54
- **Note**: The `:precision` option can be used with all these number formatters.
55
-
56
- Behind the scenes, these convenience methods are creating instances of `LocalizedNumber`. You can do the same thing if you're feeling adventurous:
57
-
58
- ```ruby
59
- num = TwitterCldr::Localized::LocalizedNumber.new(1337, :es)
60
- num.to_currency.to_s # ...etc
61
- ```
62
-
63
-
64
-
65
- #### More on Currencies
66
-
67
- If you're looking for a list of supported currencies, use the `TwitterCldr::Shared::Currencies` class:
68
-
69
- ```ruby
70
- # all supported currency codes
71
- TwitterCldr::Shared::Currencies.currency_codes # ["ADP", "AED", "AFA", "AFN", ... ]
72
-
73
- # data for a specific currency code
74
- TwitterCldr::Shared::Currencies.for_code("CAD") # {:currency=>:CAD, :name=>"Canadian Dollar", :cldr_symbol=>"CA$", :symbol=>"$", :code_points=>[36]}
75
- ```
76
-
77
- #### Short / Long Decimals
78
-
79
- In addition to formatting regular decimals, TwitterCLDR supports short and long decimals. Short decimals abbreviate the notation for the appropriate power of ten, for example "1M" for 1,000,000 or "2K" for 2,000. Long decimals include the full notation, for example "1 million" or "2 thousand". Long and short decimals can be generated using the appropriate `format` option:
80
-
81
- ```ruby
82
- 2337.localize.to_decimal.to_s(format: :short) # "2K"
83
- 1337123.localize.to_decimal.to_s(format: :short) # "1M"
84
-
85
- 2337.localize.to_decimal.to_s(format: :long) # "2 thousand"
86
- 1337123.localize.to_decimal.to_s(format: :long) # "1 million"
87
- ```
88
-
89
- ### Units
90
-
91
- TwitterCLDR supports formatting numbers with an attached unit, for example "12 degrees Celsius". It's easy to make use of this functionality via the `#to_unit` method:
92
-
93
- ```ruby
94
- 12.localize.to_unit.length_mile # "12 miles"
95
- 12.localize(:ru).to_unit.length_mile # "12 милях"
96
- ```
97
- Units support a few different forms, long, short, and narrow:
98
-
99
- ```ruby
100
- 12.localize.to_unit.mass_kilogram(form: :short) # "12 kg"
101
- ```
102
-
103
- To get a list of all available unit types, use the `#unit_types` method:
104
-
105
- ```ruby
106
- unit = 12.localize.to_unit
107
- unit.unit_types # => [:length_mile, :temperature_celsius, :mass_kilogram, ...]
108
- ```
109
-
110
-
111
-
112
-
113
-
114
- ### Number Spellout, Ordinalization, and More
115
-
116
- TwitterCLDR's rule-based number formatters are capable of transforming integers into their written equivalents. Note that rule-based formatting of decimal numbers is currently not supported for languages other than English.
117
-
118
- #### Spellout
119
-
120
- For easy spellout formatting, check out the `LocalizedNumber#spellout` method:
121
-
122
- ```ruby
123
- 123.localize.spellout # one hundred twenty-three
124
- 25_641.localize.spellout # twenty-five thousand six hundred forty-one
125
- ```
126
-
127
- As always, you can call `#localize` with a locale symbol:
128
-
129
- ```ruby
130
- 123.localize(:es).spellout # ciento veintitrés
131
- 25_641.localize(:ru).spellout # двадцать пять тысяч шестьсот сорок один
132
- ```
133
-
134
- #### Ordinalization and More
135
-
136
- The available rule-based number formats defined by the CLDR data set vary by language. Some languages support ordinal and cardinal numbers, occasionally with an additional masculine/feminine option, while others do not. You'll need to consult the list of available formats for your language.
137
-
138
- Rule-based number formats are categorized by groups, and within groups by rulesets. You'll need to specify both to make use of all the available formats for your language.
139
-
140
- To get a list of supported groups, use the `#group_names` method:
141
-
142
- ```ruby
143
- 123.localize(:pt).rbnf.group_names # ["SpelloutRules", "OrdinalRules"]
144
- ```
145
-
146
- To get a list of supported rulesets for a group name, use the `#rule_set_names_for_group` method:
147
-
148
- ```ruby
149
- # ["digits-ordinal-masculine", "digits-ordinal-feminine", "digits-ordinal"]
150
- 123.localize(:pt).rbnf.rule_set_names_for_group("OrdinalRules")
151
- ```
152
-
153
- Once you've chosen a group and ruleset, you can pass them to the `to_rbnf_s` method:
154
-
155
- ```ruby
156
- 123.localize(:pt).to_rbnf_s("OrdinalRules", "digits-ordinal-feminine") # 123a
157
- 123.localize(:pt).to_rbnf_s("OrdinalRules", "digits-ordinal-masculine") # 123o
158
- ```
159
-
160
- For comparison, here's what English ordinal formatting looks like:
161
-
162
- ```ruby
163
- 123.localize.to_rbnf_s("OrdinalRules", "digits-ordinal") # 123rd
164
- ```
165
-
166
- For English (and other languages), you can also specify an ordinal spellout:
167
-
168
- ```ruby
169
- 123.localize.to_rbnf_s("SpelloutRules", "spellout-ordinal") # one hundred twenty-third
170
- 123.localize(:pt).to_rbnf_s("SpelloutRules", "spellout-ordinal-masculine") # centésimo vigésimo terceiro
171
- ```
172
-
173
- ### Dates and Times
174
-
175
- `Time`, and `DateTime` objects are supported. `Date` objects are supported transiently:
176
-
177
- ```ruby
178
- DateTime.now.localize(:es).to_full_s # "viernes, 14 de febrero de 2014, 12:20:05 (tiempo universal coordinado)"
179
- DateTime.now.localize(:es).to_long_s # "14 de febrero de 2014, 12:20:05 UTC"
180
- DateTime.now.localize(:es).to_medium_s # "14 feb 2014, 12:20:05"
181
- DateTime.now.localize(:es).to_short_s # "14/2/14, 12:20"
182
-
183
- Time.now.localize(:es).to_full_s # "12:20:05 (tiempo universal coordinado)"
184
- Time.now.localize(:es).to_long_s # "12:20:05 UTC"
185
- Time.now.localize(:es).to_medium_s # "12:20:05"
186
- Time.now.localize(:es).to_short_s # "12:20"
187
-
188
- DateTime.now.localize(:es).to_date.to_full_s # "viernes, 14 de febrero de 2014"
189
- DateTime.now.localize(:es).to_date.to_long_s # "14 de febrero de 2014"
190
- DateTime.now.localize(:es).to_date.to_medium_s # "14 feb 2014"
191
- DateTime.now.localize(:es).to_date.to_short_s # "14/2/14"
192
- ```
193
-
194
- The default CLDR data set only includes 4 date formats, full, long, medium, and short. See below for a list of additional formats.
195
-
196
- Behind the scenes, these convenience methods are creating instances of `LocalizedDate`, `LocalizedTime`, and `LocalizedDateTime`. You can do the same thing if you're feeling adventurous:
197
-
198
-
199
-
200
- ```ruby
201
- dt = TwitterCldr::Localized::LocalizedDateTime.new(DateTime.now, :es)
202
- dt.to_short_s # ...etc
203
- ```
204
-
205
- #### Additional Date Formats
206
-
207
- Besides the default date formats, CLDR supports a number of additional ones. The list of available formats varies for each locale. To get a full list, use the `additional_formats` method:
208
-
209
- ```ruby
210
- # ["Bh", "Bhm", "Bhms", "E", "EBhm", "EBhms", "EEEEd", "EHm", "EHms", "Ed", "Ehm", "Ehms", ... ]
211
- DateTime.now.localize(:ja).additional_formats
212
- ```
213
-
214
- You can use any of the returned formats as the argument to the `to_additional_s` method:
215
-
216
- ```ruby
217
- # "14日金曜日"
218
- DateTime.now.localize(:ja).to_additional_s("EEEEd")
219
- ```
220
-
221
- It's important to know that, even though any given format may not be available across locales, TwitterCLDR will do it's best to approximate if no exact match can be found.
222
-
223
- ##### List of additional date format examples for English:
224
-
225
- | Format | Output |
226
- |:-----------|------------------------|
227
- | Bh | 12 in the afternoon |
228
- | Bhm | 12:20 in the afternoon |
229
- | Bhms | 12:20:05 in the afternoon |
230
- | E | Fri |
231
- | EBhm | Fri 12:20 in the afternoon |
232
- | EBhms | Fri 12:20:05 in the afternoon |
233
- | EHm | Fri 12:20 |
234
- | EHms | Fri 12:20:05 |
235
- | Ed | 14 Fri |
236
- | Ehm | Fri 12:20 PM |
237
- | Ehms | Fri 12:20:05 PM |
238
- | Gy | 2014 CE |
239
- | GyMMM | Feb 2014 CE |
240
- | GyMMMEd | Fri, Feb 14, 2014 CE |
241
- | GyMMMd | Feb 14, 2014 CE |
242
- | GyMd | 2/14/2014 Common Era |
243
- | H | 12 |
244
- | Hm | 12:20 |
245
- | Hms | 12:20:05 |
246
- | Hmsv | 12:20:05 GMT |
247
- | Hmv | 12:20 GMT |
248
- | M | 2 |
249
- | MEd | Fri, 2/14 |
250
- | MMM | Feb |
251
- | MMMEd | Fri, Feb 14 |
252
- | MMMMW | week 3 of February |
253
- | MMMMd | February 14 |
254
- | MMMd | Feb 14 |
255
- | Md | 2/14 |
256
- | d | 14 |
257
- | h | 12 PM |
258
- | hm | 12:20 PM |
259
- | hms | 12:20:05 PM |
260
- | hmsv | 12:20:05 PM GMT |
261
- | hmv | 12:20 PM GMT |
262
- | ms | 20:05 |
263
- | y | 2014 |
264
- | yM | 2/2014 |
265
- | yMEd | Fri, 2/14/2014 |
266
- | yMMM | Feb 2014 |
267
- | yMMMEd | Fri, Feb 14, 2014 |
268
- | yMMMM | February 2014 |
269
- | yMMMd | Feb 14, 2014 |
270
- | yMd | 2/14/2014 |
271
- | yQQQ | Q1 2014 |
272
- | yQQQQ | 1st quarter 2014 |
273
- | yw | week 7 of 2014 |
274
-
275
-
276
-
277
- #### Relative Dates and Times
278
-
279
- In addition to formatting full dates and times, TwitterCLDR supports relative time spans via several convenience methods and the `LocalizedTimespan` class. TwitterCLDR tries to guess the best time unit (eg. days, hours, minutes, etc) based on the length of the time span. Unless otherwise specified, TwitterCLDR will use the current date and time as the reference point for the calculation.
280
-
281
- ```ruby
282
- (DateTime.now - 1).localize.ago.to_s # "1 day ago"
283
- (DateTime.now - 0.5).localize.ago.to_s # "12 hours ago" (i.e. half a day)
284
-
285
- (DateTime.now + 1).localize.until.to_s # "in 1 day"
286
- (DateTime.now + 0.5).localize.until.to_s # "in 12 hours"
287
- ```
288
-
289
- Specify other locales:
290
-
291
- ```ruby
292
- (DateTime.now - 1).localize(:de).ago.to_s # "vor 1 Tag"
293
- (DateTime.now + 1).localize(:de).until.to_s # "in 1 Tag"
294
- ```
295
-
296
- Force TwitterCLDR to use a specific time unit by including the `:unit` option:
297
-
298
- ```ruby
299
- (DateTime.now - 1).localize(:de).ago.to_s(:unit => :hour) # "vor 24 Stunden"
300
- (DateTime.now + 1).localize(:de).until.to_s(:unit => :hour) # "in 24 Stunden"
301
- ```
302
-
303
- Specify a different reference point for the time span calculation:
304
-
305
- ```ruby
306
- # 86400 = 1 day in seconds, 259200 = 3 days in seconds
307
- (Time.now + 86400).localize(:de).ago(:base_time => (Time.now + 259200)).to_s(:unit => :hour) # "vor 48 Stunden"
308
- ```
309
-
310
- Behind the scenes, these convenience methods are creating instances of `LocalizedTimespan`, whose constructor accepts a number of seconds as the first argument. You can do the same thing if you're feeling adventurous:
311
-
312
- ```ruby
313
-
314
- ts = TwitterCldr::Localized::LocalizedTimespan.new(86400, :locale => :de)
315
- ts.to_s # "in 1 Tag"
316
- ts.to_s(:unit => :hour) # "in 24 Stunden"
317
-
318
-
319
- ts = TwitterCldr::Localized::LocalizedTimespan.new(-86400, :locale => :de)
320
- ts.to_s # "vor 1 Tag"
321
- ts.to_s(:unit => :hour) # "vor 24 Stunden"
322
- ```
323
-
324
- By default, timespans are exact representations of a given unit of elapsed time. TwitterCLDR also supports approximate timespans which round up to the nearest larger unit. For example, "44 seconds" remains "44 seconds" while "45 seconds" becomes "1 minute". To approximate, pass the `:approximate => true` option into `to_s`:
325
-
326
- ```ruby
327
- TwitterCldr::Localized::LocalizedTimespan.new(44).to_s(:approximate => true) # "in 44 seconds"
328
- TwitterCldr::Localized::LocalizedTimespan.new(45).to_s(:approximate => true) # "in 1 minute"
329
- TwitterCldr::Localized::LocalizedTimespan.new(52).to_s(:approximate => true) # "in 1 minute"
330
- ```
331
-
332
- ### Timezones
333
-
334
- Timezones can be specified for any instance of `LocalizedTime`, `LocalizedDate`, or `LocalizedDateTime` via the `with_timezone` function:
335
-
336
- ```ruby
337
- # "lunes, 4 de noviembre de 2019, 16:00:00 (hora estándar del Pacífico)"
338
- DateTime.new(2019, 11, 5).localize(:es).with_timezone('America/Los_Angeles').to_full_s
339
- ```
340
-
341
- Any IANA timezone can be used provided it is available via the [tzinfo](https://github.com/tzinfo/tzinfo) gem. TZInfo references any timezone data available on your system, but will use the data encapsulated in the [tzinfo-data](https://github.com/tzinfo/tzinfo-data) gem if it is bundled with your application. If you're seeing discrepancies between, for example, production and development environments, consider bundling tzinfo-data.
342
-
343
- #### Timezone Formats
344
-
345
- In addition to including timezones in formatted dates and times, TwitterCLDR provides access to timezone formats via the `TwitterCldr::Timezones::Timezone` object.
346
-
347
- Timezone objects are specified via a combination of timezone ID and locale:
348
-
349
- ```ruby
350
-
351
- tz = TwitterCldr::Timezones::Timezone.instance('Australia/Brisbane', :en)
352
- ```
353
-
354
- A list of available timezone formats can be retrieved like so:
355
-
356
- ```ruby
357
- TwitterCldr::Timezones::Timezone::ALL_FORMATS
358
- ```
359
-
360
- Format a timezone by calling the `#display_name_for` method:
361
-
362
- ```ruby
363
- # "Brisbane Time"
364
- tz.display_name_for(DateTime.new(2019, 11, 5), :generic_location)
365
-
366
- # "Australian Eastern Standard Time"
367
- tz.display_name_for(DateTime.new(2019, 11, 5), :generic_long)
368
- ```
369
-
370
- `#display_name_for` also accepts arguments for resolving ambiguous times. See [TZInfo Documentation](https://www.rubydoc.info/gems/tzinfo/TZInfo/Timezone#period_for_local-instance_method) for more information.
371
-
372
- ### Calendar Data
373
-
374
- CLDR contains a trove of calendar data, much of which can be accessed. One example is names of months, days, years.
375
-
376
- ```ruby
377
- TwitterCldr::Shared::Calendar.new(:sv).months.take(3) # ["januari", "februari", "mars"]
378
- ```
379
-
380
-
381
- ### Lists
382
-
383
- TwitterCLDR supports formatting lists of strings as you might do in English by using commas, eg: "Apples, cherries, and oranges". Use the `localize` method on an array followed by a call to `to_sentence`:
384
-
385
- ```ruby
386
- ["apples", "cherries", "oranges"].localize.to_sentence # "apples, cherries, and oranges"
387
- ["apples", "cherries", "oranges"].localize(:es).to_sentence # "apples, cherries y oranges"
388
- ```
389
-
390
- Behind the scenes, these convenience methods are creating instances of `ListFormatter`. You can do the same thing if you're feeling adventurous:
391
-
392
- ```ruby
393
- f = TwitterCldr::Formatters::ListFormatter.new(:en)
394
- f.format(["Larry", "Curly", "Moe"]) # "Larry, Curly, and Moe"
395
-
396
- f = TwitterCldr::Formatters::ListFormatter.new(:es)
397
- f.format(["Larry", "Curly", "Moe"]) # "Larry, Curly y Moe"
398
- ```
399
-
400
- The TwitterCLDR `ListFormatter` class is smart enough to handle right-to-left (RTL) text and will format the list "backwards" in these cases (note that what looks backwards to English speakers looks frontwards for RTL speakers). See the section on handling bidirectional text below for more information.
401
-
402
- ### Plural Rules
403
-
404
- Some languages, like English, have "countable" nouns. You probably know this concept better as "plural" and "singular", i.e. the difference between "strawberry" and "strawberries". Other languages, like Russian, have three plural forms: one (numbers ending in 1), few (numbers ending in 2, 3, or 4), and many (everything else). Still other languages like Japanese don't use countable nouns at all.
405
-
406
- TwitterCLDR makes it easy to find the plural rules for any numeric value:
407
-
408
- ```ruby
409
- 1.localize(:ru).plural_rule # :one
410
- 2.localize(:ru).plural_rule # :few
411
- 5.localize(:ru).plural_rule # :many
412
- 10.0.localize(:ru).plural_rule # :other
413
- ```
414
-
415
- Behind the scenes, these convenience methods use the `TwitterCldr::Formatters::Plurals::Rules` class. You can do the same thing (and a bit more) if you're feeling adventurous:
416
-
417
- ```ruby
418
- # get all rules for the default locale
419
- TwitterCldr::Formatters::Plurals::Rules.all # [:one, :other]
420
-
421
- # get all rules for a specific locale
422
- TwitterCldr::Formatters::Plurals::Rules.all_for(:es) # [:one, :many, :other]
423
- TwitterCldr::Formatters::Plurals::Rules.all_for(:ru) # [:one, :few, :many, :other]
424
-
425
- # get the rule for a number in a specific locale
426
- TwitterCldr::Formatters::Plurals::Rules.rule_for(1, :ru) # :one
427
- TwitterCldr::Formatters::Plurals::Rules.rule_for(2, :ru) # :few
428
- ```
429
-
430
- ### Plurals
431
-
432
- In addition to providing access to plural rules, TwitterCLDR allows you to embed plurals directly in your source code:
433
-
434
- ```ruby
435
- replacements = {
436
- :horse_count => 3,
437
- :horses => {
438
- :one => "is 1 horse",
439
- :other => "are %{horse_count} horses"
440
- }
441
- }
442
-
443
- # "there are 3 horses in the barn"
444
- "there %{horse_count:horses} in the barn".localize % replacements
445
- ```
446
-
447
- Because providing a pluralization hash with the correct plural rules can be difficult, you can also embed plurals as a JSON hash into your string:
448
-
449
- ```ruby
450
- str = 'there %<{ "horse_count": { "one": "is one horse", "other": "are %{horse_count} horses" } }> in the barn'
451
-
452
- # "there are 3 horses in the barn"
453
- str.localize % { :horse_count => 3 }
454
- ```
455
-
456
- NOTE: If you're using TwitterCLDR with Rails 3, you may see an error if you try to use the `%` function on a localized string in your views. Strings in views in Rails 3 are instances of `SafeBuffer`, which patches the `gsub` method that the TwitterCLDR plural formatter relies on. To fix this issue, simply call `to_str` on any `SafeBuffer` before calling `localize`. More info [here](https://github.com/rails/rails/issues/1555). An example:
457
-
458
- ```ruby
459
- # throws an error in Rails 3 views:
460
- '%<{"count": {"one": "only one", "other": "tons more!"}}'.localize % { :count => 2 }
461
-
462
- # works just fine:
463
- '%<{"count": {"one": "only one", "other": "tons more!"}}'.to_str.localize % { :count => 2 }
464
- ```
465
-
466
- The `LocalizedString` class supports all forms of interpolation:
467
-
468
- ```ruby
469
- # Ruby
470
- "five euros plus %.3f in tax" % (13.25 * 0.087)
471
- "there are %{count} horses in the barn" % { :count => "5" }
472
-
473
- # with TwitterCLDR
474
- "five euros plus %.3f in tax".localize % (13.25 * 0.087)
475
- "there are %{count} horses in the barn".localize % { :count => "5" }
476
- ```
477
-
478
- When you pass a Hash as an argument and specify placeholders with `%<foo>d`, TwitterCLDR will interpret the hash values as named arguments and format the string according to the instructions appended to the closing `>`:
479
-
480
- ```ruby
481
- "five euros plus %<percent>.3f in %{noun}".localize % { :percent => 13.25 * 0.087, :noun => "tax" }
482
- ```
483
-
484
- ### World Languages
485
-
486
- You can use the localize convenience method on language code symbols to get their equivalents in another language:
487
-
488
- ```ruby
489
- :es.localize(:es).as_language_code # "español"
490
- :ru.localize(:es).as_language_code # "ruso"
491
- ```
492
-
493
- Behind the scenes, these convenience methods are creating instances of `LocalizedSymbol`. You can do the same thing if you're feeling adventurous:
494
-
495
- ```ruby
496
- ls = TwitterCldr::Localized::LocalizedSymbol.new(:ru, :es)
497
- ls.as_language_code # "ruso"
498
- ```
499
-
500
- In addition to translating language codes, TwitterCLDR provides access to the full set of supported languages via the `TwitterCldr::Shared::Languages` class:
501
-
502
- ```ruby
503
- # get all languages for the default locale
504
- TwitterCldr::Shared::Languages.all # { ... :vi => "Vietnamese", :"zh-Hant" => "Traditional Chinese" ... }
505
-
506
- # get all languages for a specific locale
507
- TwitterCldr::Shared::Languages.all_for(:es) # { ... :vi => "vietnamita", :"zh-Hant" => "chino tradicional" ... }
508
-
509
- # get a language by its code for the default locale
510
- TwitterCldr::Shared::Languages.from_code(:'zh-Hant') # "Traditional Chinese"
511
-
512
- # get a language from its code for a specific locale
513
- TwitterCldr::Shared::Languages.from_code_for_locale(:'zh-Hant', :es) # "chino tradicional"
514
-
515
- # translate a language from one locale to another
516
- # signature: translate_language(lang, source_locale, destination_locale)
517
- TwitterCldr::Shared::Languages.translate_language("chino tradicional", :es, :en) # "Traditional Chinese"
518
- TwitterCldr::Shared::Languages.translate_language("Traditional Chinese", :en, :es) # "chino tradicional"
519
- ```
520
-
521
- ### World Territories
522
-
523
- You can use the localize convenience method on territory code symbols to get their equivalents in another language:
524
-
525
- ```ruby
526
- :gb.localize(:pt).as_territory # "Reino Unido"
527
- :cz.localize(:pt).as_territory # "Tchéquia"
528
- ```
529
-
530
- Behind the scenes, these convenience methods are creating instances of `LocalizedSymbol`. You can do the same thing if you're feeling adventurous:
531
-
532
- ```ruby
533
- ls = TwitterCldr::Localized::LocalizedSymbol.new(:gb, :pt)
534
- ls.as_territory # "Reino Unido"
535
- ```
536
-
537
- In addition to translating territory codes, TwitterCLDR provides access to the full set of supported methods via the `TwitterCldr::Shared::Territories` class:
538
-
539
- ```ruby
540
- # get all territories for the default locale
541
- TwitterCldr::Shared::Territories.all # { ... :tl => "Timor-Leste", :tm => "Turkmenistan" ... }
542
-
543
- # get all territories for a specific locale
544
- TwitterCldr::Shared::Territories.all_for(:pt) # { ... :tl => "Timor-Leste", :tm => "Turcomenistão" ... }
545
-
546
- # get a territory by its code for the default locale
547
- TwitterCldr::Shared::Territories.from_territory_code(:'gb') # "United Kingdom"
548
-
549
- # get a territory from its code for a specific locale
550
- TwitterCldr::Shared::Territories.from_territory_code_for_locale(:gb, :pt) # "Reino Unido"
551
-
552
- # translate a territory from one locale to another
553
- # signature: translate_territory(territory_name, source_locale, destination_locale)
554
- TwitterCldr::Shared::Territories.translate_territory("Reino Unido", :pt, :en) # "United Kingdom"
555
- TwitterCldr::Shared::Territories.translate_territory("U.K.", :en, :pt) # "Reino Unido"
556
- ```
557
-
558
- ### Postal Codes
559
-
560
- The CLDR contains postal code validation regexes for a number of countries.
561
-
562
- ```ruby
563
- # United States
564
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:us)
565
- postal_code.valid?("94103") # true
566
- postal_code.valid?("9410") # false
567
-
568
- # England (Great Britain)
569
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:gb)
570
- postal_code.valid?("BS98 1TL") # true
571
-
572
- # Sweden
573
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:se)
574
- postal_code.valid?("280 12") # true
575
-
576
- # Canada
577
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:ca)
578
- postal_code.valid?("V3H 1Z7") # true
579
- ```
580
-
581
- Match all valid postal codes in a string with the `#find_all` method:
582
-
583
- ```ruby
584
- # United States
585
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:us)
586
- postal_code.find_all("12345 23456") # ["12345", "23456"]
587
- ```
588
-
589
- Get a list of supported territories by using the `#territories` method:
590
-
591
- ```ruby
592
- TwitterCldr::Shared::PostalCodes.territories # [:ac, :ad, :af, :ai, :al, ... ]
593
- ```
594
-
595
- Just want the regex? No problem:
596
-
597
- ```ruby
598
- postal_code = TwitterCldr::Shared::PostalCodes.for_territory(:us)
599
- postal_code.regexp # /(\d{5})(?:[ \-](\d{4}))?/
600
- ```
601
-
602
- Get a sample of valid postal codes with the `#sample` method:
603
-
604
- ```ruby
605
- postal_code.sample(5) # ["32934", "29974", "17881-2274", "67896", "26121"]
606
- ```
607
-
608
- ### Phone Codes
609
-
610
- Telephone codes were deprecated and have now been removed from the CLDR data set. They have been removed from TwitterCLDR as of v5.0.0.
611
-
612
- ### Language Codes
613
-
614
- Over the years, different standards for language codes have accumulated. Probably the two most popular are ISO-639 and BCP-47 and their children. TwitterCLDR provides a way to convert between these codes programmatically.
615
-
616
- ```ruby
617
- TwitterCldr::Shared::LanguageCodes.convert(:es, :from => :bcp_47, :to => :iso_639_2) # :spa
618
- ```
619
-
620
- Use the `standards_for` method to get the standards that are available for conversion from a given code. In the example below, note that the first argument, `:es`, is the correct BCP-47 language code for Spanish, which is the second argument. The return value comprises all the available conversions:
621
-
622
- ```ruby
623
- # [:bcp_47, :iso_639_1, :iso_639_2, :iso_639_3]
624
- TwitterCldr::Shared::LanguageCodes.standards_for(:es, :bcp_47)
625
- ```
626
-
627
- Get a list of supported standards for a full English language name:
628
-
629
- ```ruby
630
- # [:bcp_47, :iso_639_1, :iso_639_2, :iso_639_3]
631
- TwitterCldr::Shared::LanguageCodes.standards_for_language(:Spanish)
632
- ```
633
-
634
- Get a list of supported languages:
635
-
636
- ```ruby
637
- TwitterCldr::Shared::LanguageCodes.languages # [:Arabic, :German, :Norwegian, :Spanish, ... ]
638
- ```
639
-
640
- Determine valid standards:
641
-
642
- ```ruby
643
- TwitterCldr::Shared::LanguageCodes.valid_standard?(:iso_639_1) # true
644
- TwitterCldr::Shared::LanguageCodes.valid_standard?(:blarg) # false
645
- ```
646
-
647
- Determine valid codes:
648
-
649
- ```ruby
650
- TwitterCldr::Shared::LanguageCodes.valid_code?(:es, :bcp_47) # true
651
- TwitterCldr::Shared::LanguageCodes.valid_code?(:es, :iso_639_2) # false
652
- ```
653
-
654
- Convert the full English name of a language into a language code:
655
-
656
- ```ruby
657
- TwitterCldr::Shared::LanguageCodes.from_language(:Spanish, :iso_639_2) # :spa
658
- ```
659
-
660
- Convert a language code into it's full English name:
661
-
662
- ```ruby
663
- TwitterCldr::Shared::LanguageCodes.to_language(:spa, :iso_639_2) # "Spanish"
664
- ```
665
-
666
- **NOTE**: All of the functions in `TwitterCldr::Shared::LanguageCodes` accept both symbol and string parameters.
667
-
668
- ### Territories Containment
669
-
670
- Provides an API for determining territories containment as described [here](http://www.unicode.org/cldr/charts/25/supplemental/territory_containment_un_m_49.html):
671
-
672
- ```ruby
673
- TwitterCldr::Shared::TerritoriesContainment.children('151') # ["BG", "BY", "CZ", "HU", "MD", "PL", "RO", "RU", "SK", "SU", "UA", ... ]
674
- TwitterCldr::Shared::TerritoriesContainment.children('RU') # []
675
-
676
- TwitterCldr::Shared::TerritoriesContainment.parents('013') # ["003", "019", "419"]
677
- TwitterCldr::Shared::TerritoriesContainment.parents('001') # []
678
-
679
- TwitterCldr::Shared::TerritoriesContainment.contains?('151', 'RU') # true
680
- TwitterCldr::Shared::TerritoriesContainment.contains?('419', 'BZ') # true
681
- TwitterCldr::Shared::TerritoriesContainment.contains?('419', 'FR') # false
682
- ```
683
-
684
- You can also use `Territory` class and `to_territory` method in `LocalizedString` class to access these features:
685
-
686
- ```ruby
687
- TwitterCldr::Shared::Territory.new("013").parents # ["003", "019", "419"]
688
- '419'.localize.to_territory.contains?('BZ') # true
689
- ```
690
-
691
- ### Unicode Regular Expressions
692
-
693
- Unicode regular expressions are an extension of the normal regular expression syntax. All of the changes are local to the regex's character class feature and provide support for multi-character strings, Unicode character escapes, set operations (unions, intersections, and differences), and character sets.
694
-
695
- #### Changes to Character Classes
696
-
697
- Here's a complete list of the operations you can do inside a Unicode regex's character class.
698
-
699
- | Regex | Description |
700
- |:-------------------|:--------------------------------------------------------------------------------------------------------------------|
701
- |`[a]` | The set containing 'a'. |
702
- |`[a-z]` | The set containing 'a' through 'z' and all letters in between, in Unicode order. |
703
- |`[^a-z]` | The set containing all characters except 'a' through 'z', that is, U+0000 through 'a'-1 and 'z'+1 through U+10FFFF. |
704
- |`[[pat1][pat2]]` | The union of sets specified by pat1 and pat2. |
705
- |`[[pat1]&[pat2]]` | The intersection of sets specified by pat1 and pat2. |
706
- |`[[pat1]-[pat2]]` | The [symmetric difference](http://en.wikipedia.org/wiki/Symmetric_difference) of sets specified by pat1 and pat2. |
707
- |`[:Lu:] or \p{Lu}` | The set of characters having the specified Unicode property; in this case, Unicode uppercase letters. |
708
- |`[:^Lu:] or \P{Lu}` | The set of characters not having the given Unicode property. |
709
-
710
- For a description of available Unicode properties, see [Wikipedia](http://en.wikipedia.org/wiki/Unicode_character_property#General_Category) (click on "[show]").
711
-
712
- #### Using Unicode Regexes
713
-
714
- Create Unicode regular expressions via the `#compile` method:
715
-
716
- ```ruby
717
-
718
- regex = TwitterCldr::Shared::UnicodeRegex.compile("[:Lu:]+")
719
- ```
720
-
721
- Once compiled, instances of `UnicodeRegex` behave just like normal Ruby regexes and support the `#match` and `#=~` methods:
722
-
723
- ```ruby
724
-
725
- regex.match("ABC") # <MatchData "ABC">
726
- regex =~ "fooABC" # 3
727
- ```
728
-
729
- Protip: Try to avoid negation in character classes (eg. [^abc] and \P{Lu}) as it tends to negatively affect both performance when constructing regexes as well as matching.
730
-
731
- ### Text Segmentation
732
-
733
- TwitterCLDR currently supports text segmentation by sentence as described in the [Unicode Technical Report #29](http://www.unicode.org/reports/tr29/). The segmentation algorithm makes use of Unicode regular expressions (described above). Segmentation by word, line, and grapheme boundaries could also be supported if someone wants them.
734
-
735
- You can break a string into sentences using the `LocalizedString#each_sentence` method:
736
-
737
- ```ruby
738
- "The. Quick. Brown. Fox.".localize.each_sentence do |sentence|
739
- puts sentence.to_s # "The. ", "Quick. ", "Brown. ", "Fox."
740
- end
741
- ```
742
-
743
- Under the hood, text segmentation is performed by the `BreakIterator` class (name borrowed from ICU). You can use it directly if you're feeling adventurous:
744
-
745
- ```ruby
746
-
747
- iterator = TwitterCldr::Segmentation::BreakIterator.new(:en)
748
- iterator.each_sentence("The. Quick. Brown. Fox.") do |sentence|
749
- puts sentence # "The. ", "Quick. ", "Brown. ", "Fox."
750
- end
751
- ```
752
-
753
- To improve segmentation accuracy, a list of special segmentation exceptions have been created by the ULI (Unicode Interoperability Technical Committee, yikes what a mouthful). They help with special cases like the abbreviations "Mr." and "Ms." where breaks should not occur. ULI rules are enabled by default, but you can disable them via the `:use_uli_exceptions` option:
754
-
755
- ```ruby
756
-
757
- iterator = TwitterCldr::Segmentation::BreakIterator.new(:en, :use_uli_exceptions => false)
758
- iterator.each_sentence("I like Ms. Murphy, she's nice.") do |sentence|
759
- puts sentence # "I like Ms. ", "Murphy, she's nice."
760
- end
761
- ```
762
-
763
- ### Unicode Data
764
-
765
- TwitterCLDR provides ways to retrieve individual code points as well as normalize and decompose Unicode text.
766
-
767
- Retrieve data for code points:
768
-
769
- ```ruby
770
-
771
- code_point = TwitterCldr::Shared::CodePoint.get(0x1F3E9)
772
- code_point.name # "LOVE HOTEL"
773
- code_point.bidi_mirrored # "N"
774
- code_point.category # "So"
775
- code_point.combining_class # "0"
776
- ```
777
-
778
- Convert characters to code points:
779
-
780
- ```ruby
781
- TwitterCldr::Utils::CodePoints.from_string("¿") # [191]
782
- ```
783
-
784
- Convert code points to characters:
785
-
786
- ```ruby
787
- TwitterCldr::Utils::CodePoints.to_string([0xBF]) # "¿"
788
- ```
789
-
790
- #### Unicode Properties
791
-
792
- Each character in the Unicode standard comes with a set of properties. Property data includes what type of script the character is written in, which version of the standard it was first introduced in, whether it represent a digit or an alphabetical symbol, its casing, and much more. Certain properties are boolean true/false values while others contain a set of property values. For example, the Hiragana letter "く" ("ku") has an `"Alphabetic"` property (i.e. Alphabetic = true) but does not have an `"Uppercase"` property (i.e. Uppercase = false). In addition, "く" has a property of `"Script"` with a property value for `"Script"` of `["Hiragana"]` (Note that property values are always arrays, since a single property can contain more than one property value).
793
-
794
- TwitterCLDR supports all the various Unicode properties and can look them up by character or retrieve a set of matching characters for the given property and property value. Let's use "く" again as an example. "く"'s Unicode code point is 12367 (i.e. `'く'.unpack("U*").first`):
795
-
796
-
797
-
798
- ```ruby
799
- properties = TwitterCldr::Shared::CodePoint.get(12367).properties
800
-
801
- properties.alphabetic # true
802
- properties.uppercase # false
803
- properties.script.to_a # ["Hiragana"]
804
- ```
805
-
806
- Use `TwitterCldr::Shared::CodePoint.properties` to look up additional property information:
807
-
808
-
809
-
810
-
811
-
812
-
813
- ```ruby
814
- properties = TwitterCldr::Shared::CodePoint.properties.code_points_for_property('Script', 'Hiragana')
815
-
816
- properties.to_a # [12353..12438, 12445..12447 ... ]
817
- ```
818
-
819
- Behind the scenes, these methods are using instances of `TwitterCldr::Shared::PropertiesDatabase`. Most of the time you probably won't need to use your own instance, but it is worth mentioning that `PropertiesDatabase` supplies methods for retrieving a list of available property names and normalizing property names and values. Finally, `TwitterCldr::Shared::CodePoint.properties` is an instance of `PropertiesDatabase` that you can use in place of creating a separate instance.
820
-
821
- #### Normalization
822
-
823
- Normalize/decompose a Unicode string (NFD, NFKD, NFC, and NFKC implementations available). Note that the normalized string will almost always look the same as the original string because most character display systems automatically combine decomposed characters.
824
-
825
- ```ruby
826
- TwitterCldr::Normalization.normalize("français") # "français"
827
- ```
828
-
829
- Normalization is easier to see in hex:
830
-
831
- ```ruby
832
- # [101, 115, 112, 97, 241, 111, 108]
833
- TwitterCldr::Utils::CodePoints.from_string("español")
834
-
835
- # [101, 115, 112, 97, 110, 771, 111, 108]
836
- TwitterCldr::Utils::CodePoints.from_string(TwitterCldr::Normalization.normalize("español"))
837
- ```
838
-
839
- Notice in the example above that the letter "ñ" was transformed from `241` to `110 771`, which represent the "n" and the "˜" respectively.
840
-
841
- A few convenience methods also exist for `String` that make it easy to normalize and get code points for strings:
842
-
843
- ```ruby
844
- # [101, 115, 112, 97, 241, 111, 108]
845
- "español".localize.code_points
846
-
847
- # [101, 115, 112, 97, 110, 771, 111, 108]
848
- "español".localize.normalize.code_points
849
- ```
850
-
851
- Specify a specific normalization algorithm via the `:using` option. NFD, NFKD, NFC, and NFKC algorithms are all supported (default is NFD):
852
-
853
- ```ruby
854
- # [101, 115, 112, 97, 110, 771, 111, 108]
855
- "español".localize.normalize(:using => :NFKD).code_points
856
- ```
857
-
858
- #### Casefolding
859
-
860
- Casefolding is, generally speaking, the process of converting uppercase characters to lowercase ones so as to make text uniform and therefore easier to search. The canonical example of this is the German double "s". The "ß" character is transformed into "ss" by casefolding.
861
-
862
- ```ruby
863
- "Hello, World".localize.casefold.to_s # hello, world
864
- "Weißrussland".localize.casefold.to_s # weissrussland
865
- ```
866
-
867
- Turkic languages make use of the regular and dotted uppercase i characters "I" and "İ". Normal casefolding will convert a dotless uppercase "I" to a lowercase, dotted "i", which is correct in English. Turkic languages however expect the lowercase version of a dotless uppercase "I" to be a lowercase, dotless "ı". Pass the `:t` option to the `casefold` method to force Turkic treatment of "i" characters. By default, the `:t` option is set to true for Turkish and Azerbaijani:
868
-
869
- ```ruby
870
- "Istanbul".localize.casefold(:t => true).to_s # ıstanbul
871
- "Istanbul".localize(:tr).casefold.to_s # ıstanbul
872
- ```
873
-
874
- ### Hyphenation
875
-
876
- TwitterCLDR uses data from the LibreOffice project to offer an implementation of [Franklin Liang's hyphenation algorithm](http://www.tug.org/docs/liang/). Try the `#hyphenate` method on instances of `LocalizedString`:
877
-
878
- ```ruby
879
- 'foolhardy undulate'.localize.hyphenate('-').to_s # fool-hardy un-du-late
880
- ```
881
-
882
- Since the data doesn't come packaged with CLDR, only a certain subset of locales are supported. To get a list of supported locales, use the `supported_locales` method:
883
-
884
-
885
-
886
-
887
-
888
- ```ruby
889
- TwitterCldr::Shared::Hyphenator.supported_locales # ["af-ZA", "de-CH", "en-US", ...]
890
- ```
891
-
892
- You can also ask the `Hyphenator` class if a locale is supported:
893
-
894
- ```ruby
895
- TwitterCldr::Shared::Hyphenator.supported_locale?(:en) # true
896
- TwitterCldr::Shared::Hyphenator.supported_locale?(:ja) # false
897
- ```
898
-
899
- Create a new hyphenator instance via the `.get` method. If the locale is not supported, `.get` will raise an error.
900
-
901
- ```ruby
902
- hyphenator = TwitterCldr::Shared::Hyphenator.get(:en)
903
- hyphenator.hyphenate('absolutely', '-') # ab-so-lutely
904
- ```
905
-
906
- The `.get` method will identify the best rule set to use by "maximizing" the given locale, a process that tries different combinations of the locale's language, region, and script based on CLDR's likely subtag data. In practice this means passing in `:en` works even though the hyphenator specifically supports en-US and en-GB.
907
-
908
- The second argument to `#hyphenate` is the delimiter to use, i.e. the hyphen text to insert at syllable boundaries. By default, the delimiter is the Unicode soft hyphen character (\u00AD). Depending on the system that's used to display the hyphenated text (word processor, browser, etc), the soft hyphen may render differently. Soft hyphens are supposed to be rendered only when the word needs to be displayed on multiple lines, and should be invisible otherwise.
909
-
910
- ### Sorting (Collation)
911
-
912
- TwitterCLDR contains an implementation of the [Unicode Collation Algorithm (UCA)](http://unicode.org/reports/tr10/) that provides language-sensitive text sorting capabilities. Conveniently, all you have to do is use the `sort` method in combination with the familiar `localize` method. Notice the difference between the default Ruby sort, which simply compares bytes, and the proper language-aware sort from TwitterCLDR in this German example:
913
-
914
- ```ruby
915
- ["Art", "Wasa", "Älg", "Ved"].sort # ["Art", "Ved", "Wasa", "Älg"]
916
- ["Art", "Wasa", "Älg", "Ved"].localize(:de).sort.to_a # ["Älg", "Art", "Ved", "Wasa"]
917
- ```
918
-
919
- Behind the scenes, these convenience methods are creating instances of `LocalizedArray`, then using the `TwitterCldr::Collation::Collator` class to sort the elements:
920
-
921
- ```ruby
922
-
923
- collator = TwitterCldr::Collation::Collator.new(:de)
924
- collator.sort(["Art", "Wasa", "Älg", "Ved"]) # ["Älg", "Art", "Ved", "Wasa"]
925
- collator.sort!(["Art", "Wasa", "Älg", "Ved"]) # ["Älg", "Art", "Ved", "Wasa"]
926
- ```
927
-
928
- The `TwitterCldr::Collation::Collator` class also provides methods to compare two strings, get sort keys, and calculate collation elements for individual strings:
929
-
930
- ```ruby
931
-
932
- collator = TwitterCldr::Collation::Collator.new(:de)
933
- collator.compare("Art", "Älg") # 1
934
- collator.compare("Älg", "Art") # -1
935
- collator.compare("Art", "Art") # 0
936
-
937
- collator.get_collation_elements("Älg") # [[39, 5, 143], [0, 157, 5], [61, 5, 5], [51, 5, 5]]
938
-
939
- collator.get_sort_key("Älg") # [39, 61, 51, 1, 134, 157, 6, 1, 143, 7]
940
- ```
941
-
942
- **Note**: The TwitterCLDR collator does not currently pass all the collation tests provided by Unicode, but for some strange reasons. See the [summary](https://gist.github.com/f4ee3bd280a2257c5641) of these discrepancies if you're curious.
943
-
944
- ### Transliteration
945
-
946
- Transliteration is the process of converting the text in one language or script into another with the goal of preserving the source language's pronunciation as much as possible. It can be useful in making text pronounceable in the target language. For example, most native English speakers would not be able to read or pronounce Japanese characters like these: "くろねこさま". Transliterating these characters into Latin script yields "kuronekosama", which should be pronounceable by most English speakers (in fact, probably speakers of many languages that use Latin characters). Remember, transliteration isn't translation; the actual meaning of the words is not taken into consideration, only the sound patterns.
947
-
948
- TwitterCLDR supports transliteration via the `#transliterate_into` method on `LocalizedString`. For example:
949
-
950
- ```ruby
951
- "くろねこさま".localize.transliterate_into(:en) # "kuronekosama"
952
- ```
953
-
954
- This simple method hides quite a bit of complexity. First, TwitterCLDR identifies the scripts present in the source text. It then attempts to find any available transliterators to convert between the source language and the target language. If more than one transliterator is found, all of them will be applied to the source text.
955
-
956
- You can provide hints to the transliterator by providing additional locale information. For example, you can provide a source and target script:
957
-
958
- ```ruby
959
- "くろねこさま".localize(:ja_Hiragana).transliterate_into(:en_Latin) # "kuronekosama"
960
- ```
961
- You may supply only the target script, only the source script, neither, or both. TwitterCLDR will try to find the best set of transliterators to get the job done.
962
-
963
- Behind the scenes, `LocalizedString#transliterate_into` creates instances of `TwitterCldr::Transforms::Transformer`. You can do this too if you're feeling adventurous. Here's our Japanese example again that uses `Transformer`:
964
-
965
- ```ruby
966
-
967
- rule_set = TwitterCldr::Transforms::Transformer.get('Hiragana-Latin')
968
- rule_set.transform('くろねこさま') # "kuronekosama"
969
- ```
970
- Notice that the `.get` method was called with 'Hiragana-Latin' instead of 'ja-en' or something similar. This is because `.get` must be passed an exact transform id. To get a list of all supported transform ids, use the `Transformer#each_transform` method:
971
-
972
-
973
-
974
-
975
-
976
- ```ruby
977
- TwitterCldr::Transforms::Transformer.each_transform.to_a # ['Hiragana-Latin', 'Gujarati-Bengali', ...]
978
- ```
979
-
980
- You can also search for transform ids using the `TransformId` class, which will attempt to find the closest matching transformer for the given source and target locales. Note that `.find` will return `nil` if no transformer can be found. You can pass instances of `TransformId` instead of a string when calling `Transformer.get`:
981
-
982
-
983
-
984
-
985
-
986
-
987
- ```ruby
988
- TwitterCldr::Transforms::TransformId.find('ja', 'en') # nil
989
-
990
- id = TwitterCldr::Transforms::TransformId.find('ja_Hiragana', 'en')
991
- id.source # Hiragana
992
- id.target # Latin
993
-
994
- rule_set = TwitterCldr::Transforms::Transformer.get(id)
995
- rule_set.transform('くろねこさま') # "kuronekosama"
996
- ```
997
-
998
- ### Handling Bidirectional Text
999
-
1000
- When it comes to displaying text written in both right-to-left (RTL) and left-to-right (LTR) languages, most display systems run into problems. The trouble is that Arabic or Hebrew text and English text (for example) often get scrambled visually and are therefore difficult to read. It's not usually the basic ASCII characters like A-Z that get scrambled - it's most often punctuation marks and the like that are confusingly mixed up (they are considered "weak" types by Unicode).
1001
-
1002
- To mitigate this problem, Unicode supports special invisible characters that force visual reordering so that mixed RTL and LTR (called "bidirectional") text renders naturally on the screen. The Unicode Consortium has developed an algorithm (The Unicode Bidirectional Algorithm, or UBA) that intelligently inserts these control characters where appropriate. You can make use of the UBA implementation in TwitterCLDR by creating a new instance of `TwitterCldr::Shared::Bidi` using the `from_string` static method, and manipulating it like so:
1003
-
1004
- ```ruby
1005
-
1006
- bidi = TwitterCldr::Shared::Bidi.from_string("hello نزوة world", :direction => :RTL)
1007
- bidi.reorder_visually!
1008
- bidi.to_s
1009
- ```
1010
-
1011
- **Disclaimer**: Google Translate tells me the Arabic in the example above means "fancy", but my confidence is not very high, especially since all the letters are unattached. Apologies to any native speakers :)
1012
-
1013
- ### Unicode YAML Support
1014
-
1015
- The Psych gem that is the default YAML engine in Ruby 1.9 doesn't handle Unicode characters perfectly. To mitigate this problem, TwitterCLDR contains an adaptation of the [ya2yaml](https://github.com/afunai/ya2yaml) gem by Akira Funai. Our changes specifically add better dumping of Ruby symbols. If you can get Mr. Funai's attention, please gently remind him to merge @camertron's pull request so we can use his gem and not have to maintain a separate version :) Fortunately, YAML parsing can still be done with the usual `YAML.load` or `YAML.load_file`.
1016
-
1017
- You can make use of TwitterCLDR's YAML dumper by calling `localize` and then `to_yaml` on an `Array`, `Hash`, or `String`:
1018
-
1019
- ```ruby
1020
- { :hello => "world" }.localize.to_yaml
1021
- ["hello", "world"].localize.to_yaml
1022
- "hello, world".localize.to_yaml
1023
- ```
1024
-
1025
- Behind the scenes, these convenience methods are using the `TwitterCldr::Shared::YAML` class. You can do the same thing if you're feeling adventurous:
1026
-
1027
- ```ruby
1028
- TwitterCldr::Shared::YAML.dump({ :hello => "world" })
1029
- TwitterCldr::Shared::YAML.dump(["hello", "world"])
1030
- TwitterCldr::Shared::YAML.dump("hello, world")
1031
- ```
1032
-
1033
- ## Adding New Locales
1034
-
1035
- TwitterCLDR doesn't support every locale available in the CLDR data set. If the library doesn't support the locale you need, feel free to add it and create a pull request. Adding (or updating) locales is easy. You'll need to run several rake tasks, one with MRI and another with JRuby. You'll also need an internet connection, since most of the tasks require downloading versions of CLDR, ICU, and various Unicode data files.
1036
-
1037
- Under MRI and then JRuby, run the `add_locale` rake task, passing the locale in the square brackets:
1038
-
1039
- ```
1040
- bundle exec rake add_locale[bo]
1041
- ```
1042
-
1043
- If you're using rbenv or rvm, try using the `add_locale.sh` script, which will install the required Ruby versions and run the rake tasks:
1044
-
1045
- ```
1046
- ./script/add_locale.sh bo
1047
- ```
1048
-
1049
- ## About Twitter-specific Locales
1050
-
1051
- Twitter tries to always use BCP-47 language codes. Data from the CLDR doesn't always match those codes however, so TwitterCLDR provides a `convert_locale` method to convert between the two. All functionality throughout the entire gem defers to `convert_locale` before retrieving CLDR data. `convert_locale` supports Twitter-supported BCP-47 language codes as well as CLDR locale codes, so you don't have to guess which one to use. Here are a few examples:
1052
-
1053
- ```ruby
1054
- TwitterCldr.convert_locale(:'zh-cn') # :zh
1055
- TwitterCldr.convert_locale(:zh) # :zh
1056
- TwitterCldr.convert_locale(:'zh-tw') # :"zh-Hant"
1057
- TwitterCldr.convert_locale(:'zh-Hant') # :"zh-Hant"
1058
-
1059
- TwitterCldr.convert_locale(:msa) # :ms
1060
- TwitterCldr.convert_locale(:ms) # :ms
1061
- ```
1062
-
1063
- There are a few functions in TwitterCLDR that don't require a locale code, and instead use the default locale by calling `TwitterCldr.locale`. The `locale` function defers to `FastGettext.locale` when the FastGettext library is available, and falls back on :en (English) when it's not. (Twitter uses the FastGettext gem to retrieve translations efficiently in Ruby).
1064
-
1065
- ```ruby
1066
- TwitterCldr.get_locale # will return :en
1067
-
1068
- require 'fast_gettext'
1069
- FastGettext.locale = "ru"
1070
-
1071
- TwitterCldr.locale # will return :ru
1072
- ```
1073
-
1074
- ## Compatibility
1075
-
1076
- TwitterCLDR is fully compatible with Ruby 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1.
1077
-
1078
- ## Requirements
1079
-
1080
- No external requirements.
1081
-
1082
- ## Running Tests
1083
-
1084
- `bundle exec rake` will run our basic test suite suitable for development. To run the full test suite, use `bundle exec rake spec:full`. The full test suite takes considerably longer to run because it runs against the complete normalization and collation test files from the Unicode Consortium. The basic test suite only runs normalization and collation tests against a small subset of the complete test file.
1085
-
1086
- Tests are written in RSpec.
1087
-
1088
- ## Test Coverage
1089
-
1090
- You can run the development test coverage suite (using simplecov) with `bundle exec rake spec:cov`, or the full suite with `bundle exec rake spec:cov:full`.
1091
-
1092
- ## JavaScript Support
1093
-
1094
- TwitterCLDR currently supports localization of certain textual objects in JavaScript via the twitter-cldr-js gem. See [http://github.com/twitter/twitter-cldr-js](http://github.com/twitter/twitter-cldr-js) for details.
1095
-
1096
- ## Authors
1097
-
1098
- * Cameron C. Dutro: http://github.com/camertron
1099
- * Kirill Lashuk: http://github.com/kl-7
1100
- * Portions adapted from the ruby-cldr gem by Sven Fuchs: http://github.com/svenfuchs/ruby-cldr
1101
-
1102
- ## Links
1103
- * ruby-cldr gem: [http://github.com/svenfuchs/ruby-cldr](http://github.com/svenfuchs/ruby-cldr)
1104
- * fast_gettext gem: [https://github.com/grosser/fast_gettext](https://github.com/grosser/fast_gettext)
1105
- * CLDR homepage: [http://cldr.unicode.org/](http://cldr.unicode.org/)
1106
-
1107
- ## License
1108
-
1109
- Copyright 2022 Twitter, Inc.
1110
-
1111
- Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0