twitter_cldr 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -22
- data/History.txt +3 -0
- data/NOTICE +3 -96
- data/README.md +23 -40
- data/Rakefile +12 -24
- data/lib/twitter_cldr.rb +1 -2
- data/lib/twitter_cldr/localized/localized_date.rb +1 -1
- data/lib/twitter_cldr/localized/localized_datetime.rb +1 -1
- data/lib/twitter_cldr/localized/localized_string.rb +7 -2
- data/lib/twitter_cldr/parsers/unicode_regex/component.rb +1 -4
- data/lib/twitter_cldr/resources/locales_resources_importer.rb +3 -7
- data/lib/twitter_cldr/resources/readme_renderer.rb +0 -7
- data/lib/twitter_cldr/shared/calendar.rb +2 -2
- data/lib/twitter_cldr/shared/postal_codes.rb +1 -9
- data/lib/twitter_cldr/shared/unicode_regex.rb +1 -9
- data/lib/twitter_cldr/tokenizers/numbers/rbnf_tokenizer.rb +1 -5
- data/lib/twitter_cldr/utils.rb +0 -2
- data/lib/twitter_cldr/utils/yaml.rb +0 -2
- data/lib/twitter_cldr/version.rb +1 -1
- data/resources/locales/af/calendars.yml +181 -181
- data/resources/locales/af/currencies.yml +166 -166
- data/resources/locales/af/languages.yml +217 -217
- data/resources/locales/af/layout.yml +1 -1
- data/resources/locales/af/numbers.yml +30 -30
- data/resources/locales/af/rbnf.yml +52 -52
- data/resources/locales/af/territories.yml +210 -210
- data/resources/locales/ar/calendars.yml +181 -181
- data/resources/locales/ar/currencies.yml +190 -190
- data/resources/locales/ar/languages.yml +413 -413
- data/resources/locales/ar/layout.yml +1 -1
- data/resources/locales/ar/numbers.yml +84 -84
- data/resources/locales/ar/rbnf.yml +59 -59
- data/resources/locales/ar/territories.yml +179 -179
- data/resources/locales/be/calendars.yml +125 -125
- data/resources/locales/be/currencies.yml +99 -99
- data/resources/locales/be/languages.yml +119 -119
- data/resources/locales/be/layout.yml +1 -1
- data/resources/locales/be/numbers.yml +24 -24
- data/resources/locales/be/rbnf.yml +157 -157
- data/resources/locales/be/territories.yml +185 -185
- data/resources/locales/bg/calendars.yml +171 -171
- data/resources/locales/bg/currencies.yml +170 -170
- data/resources/locales/bg/languages.yml +437 -437
- data/resources/locales/bg/layout.yml +1 -1
- data/resources/locales/bg/numbers.yml +35 -35
- data/resources/locales/bg/rbnf.yml +34 -34
- data/resources/locales/bg/territories.yml +181 -181
- data/resources/locales/bn/calendars.yml +188 -188
- data/resources/locales/bn/currencies.yml +168 -168
- data/resources/locales/bn/languages.yml +417 -417
- data/resources/locales/bn/layout.yml +1 -1
- data/resources/locales/bn/numbers.yml +35 -35
- data/resources/locales/bn/territories.yml +185 -185
- data/resources/locales/ca/calendars.yml +177 -177
- data/resources/locales/ca/currencies.yml +302 -302
- data/resources/locales/ca/languages.yml +439 -439
- data/resources/locales/ca/layout.yml +1 -1
- data/resources/locales/ca/numbers.yml +35 -35
- data/resources/locales/ca/rbnf.yml +160 -160
- data/resources/locales/ca/territories.yml +179 -179
- data/resources/locales/cs/calendars.yml +150 -150
- data/resources/locales/cs/currencies.yml +314 -314
- data/resources/locales/cs/languages.yml +506 -506
- data/resources/locales/cs/layout.yml +1 -1
- data/resources/locales/cs/numbers.yml +60 -60
- data/resources/locales/cs/rbnf.yml +40 -40
- data/resources/locales/cs/territories.yml +188 -188
- data/resources/locales/cy/calendars.yml +149 -149
- data/resources/locales/cy/currencies.yml +105 -105
- data/resources/locales/cy/languages.yml +330 -330
- data/resources/locales/cy/layout.yml +1 -1
- data/resources/locales/cy/numbers.yml +83 -83
- data/resources/locales/cy/rbnf.yml +54 -54
- data/resources/locales/cy/territories.yml +164 -164
- data/resources/locales/da/calendars.yml +182 -182
- data/resources/locales/da/currencies.yml +177 -177
- data/resources/locales/da/languages.yml +484 -484
- data/resources/locales/da/layout.yml +1 -1
- data/resources/locales/da/numbers.yml +35 -35
- data/resources/locales/da/rbnf.yml +38 -38
- data/resources/locales/da/territories.yml +206 -206
- data/resources/locales/de-CH/calendars.yml +192 -192
- data/resources/locales/de-CH/currencies.yml +428 -428
- data/resources/locales/de-CH/languages.yml +575 -575
- data/resources/locales/de-CH/layout.yml +1 -1
- data/resources/locales/de-CH/numbers.yml +35 -35
- data/resources/locales/de-CH/territories.yml +209 -209
- data/resources/locales/de/calendars.yml +192 -192
- data/resources/locales/de/currencies.yml +428 -428
- data/resources/locales/de/languages.yml +575 -575
- data/resources/locales/de/layout.yml +1 -1
- data/resources/locales/de/numbers.yml +35 -35
- data/resources/locales/de/rbnf.yml +80 -80
- data/resources/locales/de/territories.yml +207 -207
- data/resources/locales/el/calendars.yml +179 -179
- data/resources/locales/el/currencies.yml +162 -162
- data/resources/locales/el/languages.yml +441 -441
- data/resources/locales/el/layout.yml +1 -1
- data/resources/locales/el/numbers.yml +35 -35
- data/resources/locales/el/rbnf.yml +98 -98
- data/resources/locales/el/territories.yml +182 -182
- data/resources/locales/en-150/calendars.yml +105 -105
- data/resources/locales/en-150/currencies.yml +103 -103
- data/resources/locales/en-150/languages.yml +503 -503
- data/resources/locales/en-150/layout.yml +1 -1
- data/resources/locales/en-150/numbers.yml +35 -35
- data/resources/locales/en-150/territories.yml +182 -182
- data/resources/locales/en-AU/calendars.yml +105 -105
- data/resources/locales/en-AU/currencies.yml +103 -103
- data/resources/locales/en-AU/languages.yml +503 -503
- data/resources/locales/en-AU/layout.yml +1 -1
- data/resources/locales/en-AU/numbers.yml +35 -35
- data/resources/locales/en-AU/territories.yml +182 -182
- data/resources/locales/en-CA/calendars.yml +105 -105
- data/resources/locales/en-CA/currencies.yml +103 -103
- data/resources/locales/en-CA/languages.yml +503 -503
- data/resources/locales/en-CA/layout.yml +1 -1
- data/resources/locales/en-CA/numbers.yml +35 -35
- data/resources/locales/en-CA/territories.yml +182 -182
- data/resources/locales/en-GB/calendars.yml +109 -109
- data/resources/locales/en-GB/currencies.yml +250 -250
- data/resources/locales/en-GB/languages.yml +503 -503
- data/resources/locales/en-GB/layout.yml +1 -1
- data/resources/locales/en-GB/numbers.yml +35 -35
- data/resources/locales/en-GB/territories.yml +181 -181
- data/resources/locales/en-IE/calendars.yml +105 -105
- data/resources/locales/en-IE/currencies.yml +103 -103
- data/resources/locales/en-IE/languages.yml +503 -503
- data/resources/locales/en-IE/layout.yml +1 -1
- data/resources/locales/en-IE/numbers.yml +35 -35
- data/resources/locales/en-IE/territories.yml +182 -182
- data/resources/locales/en-SG/calendars.yml +105 -105
- data/resources/locales/en-SG/currencies.yml +103 -103
- data/resources/locales/en-SG/languages.yml +503 -503
- data/resources/locales/en-SG/layout.yml +1 -1
- data/resources/locales/en-SG/numbers.yml +35 -35
- data/resources/locales/en-SG/territories.yml +182 -182
- data/resources/locales/en-ZA/calendars.yml +105 -105
- data/resources/locales/en-ZA/currencies.yml +103 -103
- data/resources/locales/en-ZA/languages.yml +503 -503
- data/resources/locales/en-ZA/layout.yml +1 -1
- data/resources/locales/en-ZA/numbers.yml +36 -36
- data/resources/locales/en-ZA/territories.yml +182 -182
- data/resources/locales/en/calendars.yml +105 -105
- data/resources/locales/en/currencies.yml +103 -103
- data/resources/locales/en/languages.yml +503 -503
- data/resources/locales/en/layout.yml +1 -1
- data/resources/locales/en/numbers.yml +35 -35
- data/resources/locales/en/rbnf.yml +94 -94
- data/resources/locales/en/territories.yml +182 -182
- data/resources/locales/es-419/calendars.yml +170 -170
- data/resources/locales/es-419/currencies.yml +258 -258
- data/resources/locales/es-419/languages.yml +439 -439
- data/resources/locales/es-419/layout.yml +1 -1
- data/resources/locales/es-419/numbers.yml +33 -33
- data/resources/locales/es-419/territories.yml +178 -178
- data/resources/locales/es-CO/calendars.yml +182 -182
- data/resources/locales/es-CO/currencies.yml +258 -258
- data/resources/locales/es-CO/languages.yml +439 -439
- data/resources/locales/es-CO/layout.yml +1 -1
- data/resources/locales/es-CO/numbers.yml +35 -35
- data/resources/locales/es-CO/territories.yml +179 -179
- data/resources/locales/es-MX/calendars.yml +181 -181
- data/resources/locales/es-MX/currencies.yml +194 -194
- data/resources/locales/es-MX/languages.yml +441 -441
- data/resources/locales/es-MX/layout.yml +1 -1
- data/resources/locales/es-MX/numbers.yml +35 -35
- data/resources/locales/es-MX/territories.yml +178 -178
- data/resources/locales/es-US/calendars.yml +185 -185
- data/resources/locales/es-US/currencies.yml +258 -258
- data/resources/locales/es-US/languages.yml +439 -439
- data/resources/locales/es-US/layout.yml +1 -1
- data/resources/locales/es-US/numbers.yml +35 -35
- data/resources/locales/es-US/territories.yml +179 -179
- data/resources/locales/es/calendars.yml +183 -183
- data/resources/locales/es/currencies.yml +258 -258
- data/resources/locales/es/languages.yml +439 -439
- data/resources/locales/es/layout.yml +1 -1
- data/resources/locales/es/numbers.yml +35 -35
- data/resources/locales/es/rbnf.yml +123 -123
- data/resources/locales/es/territories.yml +179 -179
- data/resources/locales/eu/calendars.yml +185 -185
- data/resources/locales/eu/currencies.yml +160 -160
- data/resources/locales/eu/languages.yml +213 -213
- data/resources/locales/eu/layout.yml +1 -1
- data/resources/locales/eu/numbers.yml +29 -29
- data/resources/locales/eu/territories.yml +184 -184
- data/resources/locales/fa/calendars.yml +191 -191
- data/resources/locales/fa/currencies.yml +107 -107
- data/resources/locales/fa/languages.yml +412 -412
- data/resources/locales/fa/layout.yml +1 -1
- data/resources/locales/fa/numbers.yml +36 -36
- data/resources/locales/fa/rbnf.yml +28 -28
- data/resources/locales/fa/territories.yml +187 -187
- data/resources/locales/fi/calendars.yml +186 -186
- data/resources/locales/fi/currencies.yml +316 -316
- data/resources/locales/fi/languages.yml +590 -590
- data/resources/locales/fi/layout.yml +1 -1
- data/resources/locales/fi/numbers.yml +37 -37
- data/resources/locales/fi/rbnf.yml +39 -39
- data/resources/locales/fi/territories.yml +213 -213
- data/resources/locales/fil/calendars.yml +182 -182
- data/resources/locales/fil/currencies.yml +118 -118
- data/resources/locales/fil/languages.yml +214 -214
- data/resources/locales/fil/layout.yml +1 -1
- data/resources/locales/fil/numbers.yml +35 -35
- data/resources/locales/fil/rbnf.yml +35 -35
- data/resources/locales/fil/territories.yml +180 -180
- data/resources/locales/fr-BE/calendars.yml +198 -198
- data/resources/locales/fr-BE/currencies.yml +246 -246
- data/resources/locales/fr-BE/languages.yml +448 -448
- data/resources/locales/fr-BE/layout.yml +1 -1
- data/resources/locales/fr-BE/numbers.yml +35 -35
- data/resources/locales/fr-BE/rbnf.yml +140 -140
- data/resources/locales/fr-BE/territories.yml +195 -195
- data/resources/locales/fr-CA/calendars.yml +199 -199
- data/resources/locales/fr-CA/currencies.yml +252 -252
- data/resources/locales/fr-CA/languages.yml +449 -449
- data/resources/locales/fr-CA/layout.yml +1 -1
- data/resources/locales/fr-CA/numbers.yml +36 -36
- data/resources/locales/fr-CA/territories.yml +196 -196
- data/resources/locales/fr-CH/calendars.yml +200 -200
- data/resources/locales/fr-CH/currencies.yml +246 -246
- data/resources/locales/fr-CH/languages.yml +448 -448
- data/resources/locales/fr-CH/layout.yml +1 -1
- data/resources/locales/fr-CH/numbers.yml +36 -36
- data/resources/locales/fr-CH/rbnf.yml +139 -139
- data/resources/locales/fr-CH/territories.yml +195 -195
- data/resources/locales/fr/calendars.yml +198 -198
- data/resources/locales/fr/currencies.yml +246 -246
- data/resources/locales/fr/languages.yml +448 -448
- data/resources/locales/fr/layout.yml +1 -1
- data/resources/locales/fr/numbers.yml +36 -36
- data/resources/locales/fr/rbnf.yml +145 -145
- data/resources/locales/fr/territories.yml +195 -195
- data/resources/locales/ga/calendars.yml +162 -162
- data/resources/locales/ga/currencies.yml +250 -250
- data/resources/locales/ga/languages.yml +247 -247
- data/resources/locales/ga/layout.yml +1 -1
- data/resources/locales/ga/numbers.yml +71 -71
- data/resources/locales/ga/rbnf.yml +115 -115
- data/resources/locales/ga/territories.yml +78 -78
- data/resources/locales/gl/calendars.yml +183 -183
- data/resources/locales/gl/currencies.yml +169 -169
- data/resources/locales/gl/languages.yml +213 -213
- data/resources/locales/gl/layout.yml +1 -1
- data/resources/locales/gl/numbers.yml +35 -35
- data/resources/locales/gl/territories.yml +180 -180
- data/resources/locales/he/calendars.yml +129 -129
- data/resources/locales/he/currencies.yml +173 -173
- data/resources/locales/he/languages.yml +443 -443
- data/resources/locales/he/layout.yml +1 -1
- data/resources/locales/he/numbers.yml +60 -60
- data/resources/locales/he/rbnf.yml +133 -133
- data/resources/locales/he/territories.yml +179 -179
- data/resources/locales/hi/calendars.yml +185 -185
- data/resources/locales/hi/currencies.yml +160 -160
- data/resources/locales/hi/languages.yml +420 -420
- data/resources/locales/hi/layout.yml +1 -1
- data/resources/locales/hi/numbers.yml +35 -35
- data/resources/locales/hi/rbnf.yml +137 -137
- data/resources/locales/hi/territories.yml +183 -183
- data/resources/locales/hr/calendars.yml +173 -173
- data/resources/locales/hr/currencies.yml +315 -315
- data/resources/locales/hr/languages.yml +457 -457
- data/resources/locales/hr/layout.yml +1 -1
- data/resources/locales/hr/numbers.yml +47 -47
- data/resources/locales/hr/rbnf.yml +63 -63
- data/resources/locales/hr/territories.yml +181 -181
- data/resources/locales/hu/calendars.yml +175 -175
- data/resources/locales/hu/currencies.yml +171 -171
- data/resources/locales/hu/languages.yml +455 -455
- data/resources/locales/hu/layout.yml +1 -1
- data/resources/locales/hu/numbers.yml +36 -36
- data/resources/locales/hu/rbnf.yml +91 -91
- data/resources/locales/hu/territories.yml +212 -212
- data/resources/locales/id/calendars.yml +182 -182
- data/resources/locales/id/currencies.yml +297 -297
- data/resources/locales/id/languages.yml +457 -457
- data/resources/locales/id/layout.yml +1 -1
- data/resources/locales/id/numbers.yml +22 -22
- data/resources/locales/id/rbnf.yml +25 -25
- data/resources/locales/id/territories.yml +181 -181
- data/resources/locales/is/calendars.yml +182 -182
- data/resources/locales/is/currencies.yml +194 -194
- data/resources/locales/is/languages.yml +443 -443
- data/resources/locales/is/layout.yml +1 -1
- data/resources/locales/is/numbers.yml +35 -35
- data/resources/locales/is/rbnf.yml +45 -45
- data/resources/locales/is/territories.yml +212 -212
- data/resources/locales/it-CH/calendars.yml +183 -183
- data/resources/locales/it-CH/currencies.yml +168 -168
- data/resources/locales/it-CH/languages.yml +501 -501
- data/resources/locales/it-CH/layout.yml +1 -1
- data/resources/locales/it-CH/numbers.yml +29 -29
- data/resources/locales/it-CH/territories.yml +184 -184
- data/resources/locales/it/calendars.yml +180 -180
- data/resources/locales/it/currencies.yml +168 -168
- data/resources/locales/it/languages.yml +501 -501
- data/resources/locales/it/layout.yml +1 -1
- data/resources/locales/it/numbers.yml +29 -29
- data/resources/locales/it/rbnf.yml +368 -368
- data/resources/locales/it/territories.yml +184 -184
- data/resources/locales/ja/calendars.yml +195 -195
- data/resources/locales/ja/currencies.yml +353 -353
- data/resources/locales/ja/languages.yml +602 -602
- data/resources/locales/ja/layout.yml +1 -1
- data/resources/locales/ja/numbers.yml +35 -35
- data/resources/locales/ja/rbnf.yml +49 -49
- data/resources/locales/ja/territories.yml +260 -260
- data/resources/locales/ko/calendars.yml +180 -180
- data/resources/locales/ko/currencies.yml +168 -168
- data/resources/locales/ko/languages.yml +455 -455
- data/resources/locales/ko/layout.yml +1 -1
- data/resources/locales/ko/numbers.yml +33 -33
- data/resources/locales/ko/rbnf.yml +136 -136
- data/resources/locales/ko/territories.yml +219 -219
- data/resources/locales/lv/calendars.yml +179 -179
- data/resources/locales/lv/currencies.yml +166 -166
- data/resources/locales/lv/languages.yml +473 -473
- data/resources/locales/lv/layout.yml +1 -1
- data/resources/locales/lv/numbers.yml +48 -48
- data/resources/locales/lv/rbnf.yml +45 -45
- data/resources/locales/lv/territories.yml +202 -202
- data/resources/locales/ms/calendars.yml +181 -181
- data/resources/locales/ms/currencies.yml +163 -163
- data/resources/locales/ms/languages.yml +257 -257
- data/resources/locales/ms/layout.yml +1 -1
- data/resources/locales/ms/numbers.yml +23 -23
- data/resources/locales/ms/rbnf.yml +27 -27
- data/resources/locales/ms/territories.yml +179 -179
- data/resources/locales/nb/calendars.yml +190 -190
- data/resources/locales/nb/currencies.yml +313 -313
- data/resources/locales/nb/languages.yml +480 -480
- data/resources/locales/nb/layout.yml +1 -1
- data/resources/locales/nb/numbers.yml +37 -37
- data/resources/locales/nb/rbnf.yml +38 -38
- data/resources/locales/nb/territories.yml +213 -213
- data/resources/locales/nl/calendars.yml +182 -182
- data/resources/locales/nl/currencies.yml +319 -319
- data/resources/locales/nl/languages.yml +555 -555
- data/resources/locales/nl/layout.yml +1 -1
- data/resources/locales/nl/numbers.yml +35 -35
- data/resources/locales/nl/rbnf.yml +81 -81
- data/resources/locales/nl/territories.yml +215 -215
- data/resources/locales/pl/calendars.yml +176 -176
- data/resources/locales/pl/currencies.yml +175 -175
- data/resources/locales/pl/languages.yml +537 -537
- data/resources/locales/pl/layout.yml +1 -1
- data/resources/locales/pl/numbers.yml +60 -60
- data/resources/locales/pl/rbnf.yml +58 -58
- data/resources/locales/pl/territories.yml +191 -191
- data/resources/locales/pt/calendars.yml +187 -187
- data/resources/locales/pt/currencies.yml +172 -172
- data/resources/locales/pt/languages.yml +442 -442
- data/resources/locales/pt/layout.yml +1 -1
- data/resources/locales/pt/numbers.yml +35 -35
- data/resources/locales/pt/rbnf.yml +75 -75
- data/resources/locales/pt/territories.yml +178 -178
- data/resources/locales/ro/calendars.yml +170 -170
- data/resources/locales/ro/currencies.yml +165 -165
- data/resources/locales/ro/languages.yml +443 -443
- data/resources/locales/ro/layout.yml +1 -1
- data/resources/locales/ro/numbers.yml +47 -47
- data/resources/locales/ro/rbnf.yml +34 -34
- data/resources/locales/ro/territories.yml +178 -178
- data/resources/locales/ru/calendars.yml +174 -174
- data/resources/locales/ru/currencies.yml +176 -176
- data/resources/locales/ru/languages.yml +469 -469
- data/resources/locales/ru/layout.yml +1 -1
- data/resources/locales/ru/numbers.yml +60 -60
- data/resources/locales/ru/rbnf.yml +40 -40
- data/resources/locales/ru/territories.yml +197 -197
- data/resources/locales/sk/calendars.yml +170 -170
- data/resources/locales/sk/currencies.yml +168 -168
- data/resources/locales/sk/languages.yml +439 -439
- data/resources/locales/sk/layout.yml +1 -1
- data/resources/locales/sk/numbers.yml +60 -60
- data/resources/locales/sk/rbnf.yml +40 -40
- data/resources/locales/sk/territories.yml +191 -191
- data/resources/locales/sq/calendars.yml +157 -157
- data/resources/locales/sq/currencies.yml +102 -102
- data/resources/locales/sq/languages.yml +188 -188
- data/resources/locales/sq/layout.yml +1 -1
- data/resources/locales/sq/numbers.yml +36 -36
- data/resources/locales/sq/rbnf.yml +26 -26
- data/resources/locales/sq/territories.yml +180 -180
- data/resources/locales/sr/calendars.yml +185 -185
- data/resources/locales/sr/currencies.yml +171 -171
- data/resources/locales/sr/languages.yml +430 -430
- data/resources/locales/sr/layout.yml +1 -1
- data/resources/locales/sr/numbers.yml +47 -47
- data/resources/locales/sr/rbnf.yml +80 -80
- data/resources/locales/sr/territories.yml +184 -184
- data/resources/locales/sv/calendars.yml +189 -189
- data/resources/locales/sv/currencies.yml +212 -212
- data/resources/locales/sv/languages.yml +541 -541
- data/resources/locales/sv/layout.yml +1 -1
- data/resources/locales/sv/numbers.yml +37 -37
- data/resources/locales/sv/rbnf.yml +149 -149
- data/resources/locales/sv/territories.yml +207 -207
- data/resources/locales/ta/calendars.yml +185 -185
- data/resources/locales/ta/currencies.yml +160 -160
- data/resources/locales/ta/languages.yml +422 -422
- data/resources/locales/ta/layout.yml +1 -1
- data/resources/locales/ta/numbers.yml +35 -35
- data/resources/locales/ta/rbnf.yml +54 -54
- data/resources/locales/ta/territories.yml +184 -184
- data/resources/locales/th/calendars.yml +176 -176
- data/resources/locales/th/currencies.yml +695 -695
- data/resources/locales/th/languages.yml +594 -594
- data/resources/locales/th/layout.yml +1 -1
- data/resources/locales/th/numbers.yml +23 -23
- data/resources/locales/th/rbnf.yml +29 -29
- data/resources/locales/th/territories.yml +253 -253
- data/resources/locales/tr/calendars.yml +179 -179
- data/resources/locales/tr/currencies.yml +268 -268
- data/resources/locales/tr/languages.yml +443 -443
- data/resources/locales/tr/layout.yml +1 -1
- data/resources/locales/tr/numbers.yml +33 -33
- data/resources/locales/tr/rbnf.yml +61 -61
- data/resources/locales/tr/territories.yml +179 -179
- data/resources/locales/uk/calendars.yml +175 -175
- data/resources/locales/uk/currencies.yml +175 -175
- data/resources/locales/uk/languages.yml +467 -467
- data/resources/locales/uk/layout.yml +1 -1
- data/resources/locales/uk/numbers.yml +60 -60
- data/resources/locales/uk/rbnf.yml +40 -40
- data/resources/locales/uk/territories.yml +193 -193
- data/resources/locales/ur/calendars.yml +162 -162
- data/resources/locales/ur/currencies.yml +160 -160
- data/resources/locales/ur/languages.yml +203 -203
- data/resources/locales/ur/layout.yml +1 -1
- data/resources/locales/ur/numbers.yml +36 -36
- data/resources/locales/ur/territories.yml +166 -166
- data/resources/locales/vi/calendars.yml +80 -80
- data/resources/locales/vi/currencies.yml +295 -295
- data/resources/locales/vi/languages.yml +1 -1
- data/resources/locales/vi/layout.yml +1 -1
- data/resources/locales/vi/numbers.yml +23 -23
- data/resources/locales/vi/rbnf.yml +39 -39
- data/resources/locales/vi/territories.yml +158 -158
- data/resources/locales/zh-Hant/calendars.yml +200 -200
- data/resources/locales/zh-Hant/currencies.yml +789 -789
- data/resources/locales/zh-Hant/languages.yml +607 -607
- data/resources/locales/zh-Hant/layout.yml +1 -1
- data/resources/locales/zh-Hant/numbers.yml +34 -34
- data/resources/locales/zh-Hant/rbnf.yml +197 -197
- data/resources/locales/zh-Hant/territories.yml +260 -260
- data/resources/locales/zh/calendars.yml +204 -204
- data/resources/locales/zh/currencies.yml +740 -740
- data/resources/locales/zh/languages.yml +515 -515
- data/resources/locales/zh/layout.yml +1 -1
- data/resources/locales/zh/numbers.yml +35 -35
- data/resources/locales/zh/rbnf.yml +231 -231
- data/resources/locales/zh/territories.yml +260 -260
- data/resources/shared/numbering_systems.yml +118 -118
- data/resources/shared/rbnf_root.yml +239 -239
- data/resources/shared/segments/segments_root.yml +143 -143
- data/resources/shared/territories_containment.yml +304 -304
- data/spec/bidi/bidi_spec.rb +0 -1
- data/spec/core_ext_spec.rb +1 -2
- data/spec/parsers/segmentation_parser_spec.rb +8 -4
- data/spec/parsers/symbol_table_spec.rb +1 -5
- data/spec/parsers/unicode_regex/character_class_spec.rb +5 -3
- data/spec/parsers/unicode_regex/unicode_string_spec.rb +1 -1
- data/spec/shared/unicode_regex_spec.rb +14 -14
- data/spec/spec_helper.rb +3 -12
- data/spec/utils/yaml/yaml_spec.rb +10 -26
- metadata +14 -15
- data/lib/twitter_cldr/utils/interpolation.rb +0 -105
- data/spec/utils/interpolation_spec.rb +0 -124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36fb6c8b2e3270ea51a5b6d9dd2a9eb6be7deb30
|
4
|
+
data.tar.gz: 2d7d3e08365638d9a7cf73405e5c961063f7754f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50be3dcceca9966c50d9a1a36980a84f1b9e14c739a0552fa584e4982181d81deff6a99c8265b3076b0ab366b0c515deaf1821828f424b6f05ad937fa6b3fb80
|
7
|
+
data.tar.gz: 127a0e0aeefc5fe7363dc9935b3c2223639e0aef529497a52cb1d5b4c64c6589800c4c2a720e21e140a432e4a48cc24fc7dcb5d4a92c9d190ef58e8a9415f514
|
data/Gemfile
CHANGED
@@ -8,17 +8,7 @@ group :development, :test do
|
|
8
8
|
gem 'pry'
|
9
9
|
gem 'pry-nav'
|
10
10
|
|
11
|
-
|
12
|
-
gem 'rubinius-debugger'
|
13
|
-
end
|
14
|
-
|
15
|
-
if RUBY_VERSION >= "1.9" && RUBY_PLATFORM != "java" && RUBY_ENGINE != "rbx"
|
16
|
-
gem 'ruby-prof'
|
17
|
-
end
|
18
|
-
|
19
|
-
if RUBY_VERSION <= "1.8.7"
|
20
|
-
gem 'oniguruma'
|
21
|
-
end
|
11
|
+
gem 'ruby-prof' unless RUBY_PLATFORM == "java"
|
22
12
|
|
23
13
|
gem 'regexp_parser', '~> 0.1.6'
|
24
14
|
end
|
@@ -27,6 +17,7 @@ group :development do
|
|
27
17
|
gem 'nokogiri', "~> 1.5.9"
|
28
18
|
|
29
19
|
gem 'ruby-cldr', :github => 'kl-7/ruby-cldr', :branch => 'kl_nubmber_patttern_pluralization'
|
20
|
+
gem 'i18n', '~> 0.6.11'
|
30
21
|
gem 'cldr-plurals', '~> 1.0.0'
|
31
22
|
end
|
32
23
|
|
@@ -34,17 +25,10 @@ group :test do
|
|
34
25
|
gem 'rspec', '~> 2.14.0'
|
35
26
|
gem 'rr', '~> 1.1.2'
|
36
27
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
platform :mri_18 do
|
42
|
-
gem 'rcov'
|
43
|
-
end
|
28
|
+
gem 'rubyzip'
|
29
|
+
gem 'coveralls', :require => false
|
44
30
|
|
45
|
-
|
46
|
-
|
47
|
-
gem 'launchy'
|
48
|
-
end
|
31
|
+
gem 'simplecov'
|
32
|
+
gem 'launchy'
|
49
33
|
end
|
50
34
|
|
data/History.txt
CHANGED
data/NOTICE
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
twitter-cldr-rb is a Ruby implementation of the Common Locale Data Repository
|
2
2
|
Copyright (C) 2012 Twitter, Inc.
|
3
3
|
|
4
|
+
======================================================================================
|
4
5
|
|
5
6
|
Portions of this gem were borrowed from Sven Fuchs' ruby-cldr gem. Here is
|
6
7
|
the license that accompanied Mr. Fuchs' code:
|
@@ -26,99 +27,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
26
27
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
27
28
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
28
29
|
|
29
|
-
|
30
|
-
Backporting of String interpolation from Ruby 1.9 to Ruby 1.8 implemented in
|
31
|
-
this gem (see file interpolation.rb) was partially copied and heavily based
|
32
|
-
on the implementation of i18n and gettext gems. Below are the license agreements
|
33
|
-
that accompanied these gems.
|
34
|
-
|
35
|
-
License agreement of the i18n gem (https://github.com/svenfuchs/i18n):
|
36
|
-
|
37
|
-
Copyright (c) 2008 The Ruby I18n team
|
38
|
-
|
39
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
40
|
-
a copy of this software and associated documentation files (the
|
41
|
-
"Software"), to deal in the Software without restriction, including
|
42
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
43
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
44
|
-
permit persons to whom the Software is furnished to do so, subject to
|
45
|
-
the following conditions:
|
46
|
-
|
47
|
-
The above copyright notice and this permission notice shall be
|
48
|
-
included in all copies or substantial portions of the Software.
|
49
|
-
|
50
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
51
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
52
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
53
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
54
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
55
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
56
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
57
|
-
|
58
|
-
License of the gettext gem (https://github.com/mutoh/gettext):
|
59
|
-
|
60
|
-
Copyright (C) 2005-2009 Masao Mutoh
|
61
|
-
|
62
|
-
You may redistribute it [the code] and/or modify it under the same license
|
63
|
-
terms as Ruby or LGPL [http://www.gnu.org/licenses/lgpl-3.0.txt].
|
64
|
-
|
65
|
-
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
66
|
-
You can redistribute it and/or modify it under either the terms of the GPL
|
67
|
-
version 2 (see the file GPL), or the conditions below:
|
68
|
-
|
69
|
-
1. You may make and give away verbatim copies of the source form of the
|
70
|
-
software without restriction, provided that you duplicate all of the
|
71
|
-
original copyright notices and associated disclaimers.
|
72
|
-
|
73
|
-
2. You may modify your copy of the software in any way, provided that
|
74
|
-
you do at least ONE of the following:
|
75
|
-
|
76
|
-
a) place your modifications in the Public Domain or otherwise
|
77
|
-
make them Freely Available, such as by posting said
|
78
|
-
modifications to Usenet or an equivalent medium, or by allowing
|
79
|
-
the author to include your modifications in the software.
|
80
|
-
|
81
|
-
b) use the modified software only within your corporation or
|
82
|
-
organization.
|
83
|
-
|
84
|
-
c) give non-standard binaries non-standard names, with
|
85
|
-
instructions on where to get the original software distribution.
|
86
|
-
|
87
|
-
d) make other distribution arrangements with the author.
|
88
|
-
|
89
|
-
3. You may distribute the software in object code or binary form,
|
90
|
-
provided that you do at least ONE of the following:
|
91
|
-
|
92
|
-
a) distribute the binaries and library files of the software,
|
93
|
-
together with instructions (in the manual page or equivalent)
|
94
|
-
on where to get the original distribution.
|
95
|
-
|
96
|
-
b) accompany the distribution with the machine-readable source of
|
97
|
-
the software.
|
98
|
-
|
99
|
-
c) give non-standard binaries non-standard names, with
|
100
|
-
instructions on where to get the original software distribution.
|
101
|
-
|
102
|
-
d) make other distribution arrangements with the author.
|
103
|
-
|
104
|
-
4. You may modify and include the part of the software into any other
|
105
|
-
software (possibly commercial). But some files in the distribution
|
106
|
-
are not written by the author, so that they are not under these terms.
|
107
|
-
|
108
|
-
For the list of those files and their copying conditions, see the
|
109
|
-
file LEGAL.
|
110
|
-
|
111
|
-
5. The scripts and library files supplied as input to or produced as
|
112
|
-
output from the software do not automatically fall under the
|
113
|
-
copyright of the software, but belong to whomever generated them,
|
114
|
-
and may be sold commercially, and may be aggregated with this
|
115
|
-
software.
|
116
|
-
|
117
|
-
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
118
|
-
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
119
|
-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
120
|
-
PURPOSE.
|
121
|
-
|
30
|
+
======================================================================================
|
122
31
|
|
123
32
|
TwitterCldr::Collation::ImplicitCollationElements module was ported from
|
124
33
|
the ICU4J library (http://site.icu-project.org). Here is its license:
|
@@ -153,9 +62,7 @@ Except as contained in this notice, the name of a copyright holder shall not be
|
|
153
62
|
used in advertising or otherwise to promote the sale, use or other dealings in
|
154
63
|
this Software without prior written authorization of the copyright holder.
|
155
64
|
|
156
|
-
|
157
|
-
|
158
|
-
|
65
|
+
======================================================================================
|
159
66
|
|
160
67
|
The currencies data in twitter-cldr-rb has been adapted from the currencies gem.
|
161
68
|
Here's the license that accompanied that code:
|
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
## twitter-cldr-rb [![Build Status](https://secure.travis-ci.org/twitter/twitter-cldr-rb.png?branch=master)](http://travis-ci.org/twitter/twitter-cldr-rb) [![Code Climate](https://codeclimate.com/github/twitter/twitter-cldr-rb.png)](https://codeclimate.com/github/twitter/twitter-cldr-rb)
|
1
|
+
## twitter-cldr-rb [![Build Status](https://secure.travis-ci.org/twitter/twitter-cldr-rb.png?branch=master)](http://travis-ci.org/twitter/twitter-cldr-rb) [![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)
|
4
2
|
|
5
3
|
TwitterCldr uses Unicode's Common Locale Data Repository (CLDR) to format certain types of text into their
|
6
4
|
localized equivalents. Currently supported types of text include dates, times, currencies, decimals, percentages, and symbols.
|
@@ -39,18 +37,18 @@ TwitterCldr patches core Ruby objects like `Fixnum` and `Date` to make localizat
|
|
39
37
|
|
40
38
|
```ruby
|
41
39
|
# default formatting with to_s
|
42
|
-
1337.localize(:es).to_s # "1
|
40
|
+
1337.localize(:es).to_s # "1.337"
|
43
41
|
|
44
42
|
# currencies, default USD
|
45
|
-
1337.localize(:es).to_currency.to_s # "1
|
46
|
-
1337.localize(:es).to_currency.to_s(:currency => "EUR") # "1
|
43
|
+
1337.localize(:es).to_currency.to_s # "1.337,00 $"
|
44
|
+
1337.localize(:es).to_currency.to_s(:currency => "EUR") # "1.337,00 €"
|
47
45
|
|
48
46
|
# percentages
|
49
|
-
1337.localize(:es).to_percent.to_s # "1
|
50
|
-
1337.localize(:es).to_percent.to_s(:precision => 2) # "1
|
47
|
+
1337.localize(:es).to_percent.to_s # "1.337 %"
|
48
|
+
1337.localize(:es).to_percent.to_s(:precision => 2) # "1.337,00 %"
|
51
49
|
|
52
50
|
# decimals
|
53
|
-
1337.localize(:es).to_decimal.to_s(:precision => 3) # "1
|
51
|
+
1337.localize(:es).to_decimal.to_s(:precision => 3) # "1.337,000"
|
54
52
|
```
|
55
53
|
|
56
54
|
**Note**: The `:precision` option can be used with all these number formatters.
|
@@ -154,7 +152,7 @@ For English (and other languages), you can also specify an ordinal spellout:
|
|
154
152
|
```ruby
|
155
153
|
DateTime.now.localize(:es).to_full_s # "viernes, 14 de febrero de 2014, 12:20:05 (UTC +00:00)"
|
156
154
|
DateTime.now.localize(:es).to_long_s # "14 de febrero de 2014, 12:20:05 UTC"
|
157
|
-
DateTime.now.localize(:es).to_medium_s # "14
|
155
|
+
DateTime.now.localize(:es).to_medium_s # "14 de feb. de 2014 12:20:05"
|
158
156
|
DateTime.now.localize(:es).to_short_s # "14/2/14 12:20"
|
159
157
|
|
160
158
|
Time.now.localize(:es).to_full_s # "12:20:05 (UTC +00:00)"
|
@@ -164,7 +162,7 @@ Time.now.localize(:es).to_short_s # "12:20"
|
|
164
162
|
|
165
163
|
DateTime.now.localize(:es).to_date.to_full_s # "viernes, 14 de febrero de 2014"
|
166
164
|
DateTime.now.localize(:es).to_date.to_long_s # "14 de febrero de 2014"
|
167
|
-
DateTime.now.localize(:es).to_date.to_medium_s # "14
|
165
|
+
DateTime.now.localize(:es).to_date.to_medium_s # "14 de feb. de 2014"
|
168
166
|
DateTime.now.localize(:es).to_date.to_short_s # "14/2/14"
|
169
167
|
```
|
170
168
|
|
@@ -184,7 +182,7 @@ dt.to_short_s # ...etc
|
|
184
182
|
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:
|
185
183
|
|
186
184
|
```ruby
|
187
|
-
# ["EEEEd", "EHm", "EHms", "Ed", "Ehm", "Ehms", "Gy", "GyMMM", "GyMMMEEEEd", "GyMMMEd", "GyMMMd",
|
185
|
+
# ["E", "EEEEd", "EHm", "EHms", "Ed", "Ehm", "Ehms", "Gy", "GyMMM", "GyMMMEEEEd", "GyMMMEd", "GyMMMd", ... ]
|
188
186
|
DateTime.now.localize(:ja).additional_formats
|
189
187
|
```
|
190
188
|
|
@@ -201,6 +199,7 @@ It's important to know that, even though any given format may not be available a
|
|
201
199
|
|
202
200
|
| Format | Output |
|
203
201
|
|:-----------|------------------------|
|
202
|
+
| E | Fri |
|
204
203
|
| EHm | Fri 12:20 |
|
205
204
|
| EHms | Fri 12:20:05 |
|
206
205
|
| Ed | 14 Fri |
|
@@ -320,8 +319,9 @@ TwitterCLDR makes it easy to find the plural rules for any numeric value:
|
|
320
319
|
|
321
320
|
```ruby
|
322
321
|
1.localize(:ru).plural_rule # :one
|
323
|
-
2.localize(:ru).plural_rule # :
|
322
|
+
2.localize(:ru).plural_rule # :few
|
324
323
|
5.localize(:ru).plural_rule # :many
|
324
|
+
10.0.localize(:ru).plural_rule # :other
|
325
325
|
```
|
326
326
|
|
327
327
|
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:
|
@@ -332,11 +332,11 @@ TwitterCldr::Formatters::Plurals::Rules.all # [:one, :other]
|
|
332
332
|
|
333
333
|
# get all rules for a specific locale
|
334
334
|
TwitterCldr::Formatters::Plurals::Rules.all_for(:es) # [:one, :other]
|
335
|
-
TwitterCldr::Formatters::Plurals::Rules.all_for(:ru) # [:
|
335
|
+
TwitterCldr::Formatters::Plurals::Rules.all_for(:ru) # [:few, :many, :one, :other]
|
336
336
|
|
337
337
|
# get the rule for a number in a specific locale
|
338
338
|
TwitterCldr::Formatters::Plurals::Rules.rule_for(1, :ru) # :one
|
339
|
-
TwitterCldr::Formatters::Plurals::Rules.rule_for(2, :ru) # :
|
339
|
+
TwitterCldr::Formatters::Plurals::Rules.rule_for(2, :ru) # :few
|
340
340
|
```
|
341
341
|
|
342
342
|
### Plurals
|
@@ -375,13 +375,10 @@ NOTE: If you're using TwitterCLDR with Rails 3, you may see an error if you try
|
|
375
375
|
'%<{"count": {"one": "only one", "other": "tons more!"}}'.to_str.localize % { :count => 2 }
|
376
376
|
```
|
377
377
|
|
378
|
-
The `LocalizedString` class supports all forms of interpolation
|
378
|
+
The `LocalizedString` class supports all forms of interpolation:
|
379
379
|
|
380
380
|
```ruby
|
381
|
-
# Ruby
|
382
|
-
"five euros plus %.3f in tax" % (13.25 * 0.087)
|
383
|
-
|
384
|
-
# Ruby 1.9
|
381
|
+
# Ruby
|
385
382
|
"five euros plus %.3f in tax" % (13.25 * 0.087)
|
386
383
|
"there are %{count} horses in the barn" % { :count => "5" }
|
387
384
|
|
@@ -390,7 +387,7 @@ The `LocalizedString` class supports all forms of interpolation and combines sup
|
|
390
387
|
"there are %{count} horses in the barn".localize % { :count => "5" }
|
391
388
|
```
|
392
389
|
|
393
|
-
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
|
390
|
+
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 `>`:
|
394
391
|
|
395
392
|
```ruby
|
396
393
|
"five euros plus %<percent>.3f in %{noun}".localize % { :percent => 13.25 * 0.087, :noun => "tax" }
|
@@ -480,7 +477,7 @@ postal_code.regexp # /\d{5}([ \-]\d{4})?/
|
|
480
477
|
Get a sample of valid postal codes with the `#sample` method:
|
481
478
|
|
482
479
|
```ruby
|
483
|
-
postal_code.sample(5) # ["
|
480
|
+
postal_code.sample(5) # ["20274-2080", "17661", "18705", "77929", "73034-2737"]
|
484
481
|
```
|
485
482
|
|
486
483
|
### Phone Codes
|
@@ -626,15 +623,9 @@ regex =~ "fooABC" # 3
|
|
626
623
|
|
627
624
|
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.
|
628
625
|
|
629
|
-
#### Support for Ruby 1.8
|
630
|
-
|
631
|
-
Ruby 1.8 does not allow escaped Unicode characters in regular expressions and restricts their maximum length. TwitterCLDR's `UnicodeRegex` class supports escaped unicode characters in Ruby 1.8, but cannot offer a work-around for the length issue. For this reason, Ruby 1.8 users are required to install the oniguruma regex engine and require the oniguruma gem in their projects.
|
632
|
-
|
633
|
-
To install oniguruma, run `brew install oniguruma` on MacOS, `[sudo] apt-get install libonig-dev` on Ubuntu (you may need to search for other instructions specific to your platform). Then, install the oniguruma gem via your Gemfile or on your system via `gem install oniguruma`. Once installed, `require oniguruma` somewhere in your project before making use of the `TwitterCldr::Shared::UnicodeRegex` class.
|
634
|
-
|
635
626
|
### Text Segmentation
|
636
627
|
|
637
|
-
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).
|
628
|
+
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.
|
638
629
|
|
639
630
|
You can break a string into sentences using the `LocalizedString#each_sentence` method:
|
640
631
|
|
@@ -795,7 +786,7 @@ bidi.to_s
|
|
795
786
|
|
796
787
|
### Unicode YAML Support
|
797
788
|
|
798
|
-
|
789
|
+
The Psych gem that is the default YAML engine inRuby 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`.
|
799
790
|
|
800
791
|
You can make use of TwitterCLDR's YAML dumper by calling `localize` and then `to_yaml` on an `Array`, `Hash`, or `String`:
|
801
792
|
|
@@ -840,15 +831,7 @@ TwitterCldr.locale # will return :ru
|
|
840
831
|
|
841
832
|
## Compatibility
|
842
833
|
|
843
|
-
TwitterCLDR is fully compatible with Ruby 1.
|
844
|
-
|
845
|
-
#### Notes on Ruby 1.8
|
846
|
-
|
847
|
-
Numerous TwitterCLDR features have been built with the assumption that they will only ever be used on UTF-8 encoded text, which is mostly due to the need to support Ruby 1.8. For this reason, you may find it necessary to set the global `$KCODE` variable to `"UTF-8"`. Setting this variable tells Ruby what encoding to use when loading source files. TwitterCLDR will **not** set this value for you.
|
848
|
-
|
849
|
-
```ruby
|
850
|
-
$KCODE = "UTF-8"
|
851
|
-
```
|
834
|
+
TwitterCLDR is fully compatible with Ruby 1.9.3, 2.0.0, 2.2.0.
|
852
835
|
|
853
836
|
## Requirements
|
854
837
|
|
@@ -862,7 +845,7 @@ Tests are written in RSpec using RR as the mocking framework.
|
|
862
845
|
|
863
846
|
## Test Coverage
|
864
847
|
|
865
|
-
You can run the development test coverage suite with `bundle exec rake spec:cov`, or the full suite with `bundle exec rake spec:cov:full`.
|
848
|
+
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`.
|
866
849
|
|
867
850
|
## JavaScript Support
|
868
851
|
|
data/Rakefile
CHANGED
@@ -31,33 +31,21 @@ namespace :spec do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
desc 'Run specs with
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
desc 'Run full specs suit with RCov'
|
43
|
-
task 'spec:cov:full' => %w[spec:full_spec_env spec:cov]
|
44
|
-
else
|
45
|
-
namespace :spec do
|
46
|
-
desc 'Run specs with SimpleCov'
|
47
|
-
task :cov => ['spec:simplecov_env', :spec] do
|
48
|
-
require 'launchy'
|
49
|
-
Launchy.open 'coverage/index.html'
|
50
|
-
end
|
34
|
+
namespace :spec do
|
35
|
+
desc 'Run specs with SimpleCov'
|
36
|
+
task :cov => ['spec:simplecov_env', :spec] do
|
37
|
+
require 'launchy'
|
38
|
+
Launchy.open 'coverage/index.html'
|
39
|
+
end
|
51
40
|
|
52
|
-
|
53
|
-
|
41
|
+
desc 'Run full specs suit with SimpleCov'
|
42
|
+
task 'cov:full' => %w[spec:full_spec_env spec:cov]
|
54
43
|
|
55
|
-
|
56
|
-
|
57
|
-
|
44
|
+
task :simplecov_env do
|
45
|
+
puts 'Cleaning up coverage reports'
|
46
|
+
rm_rf 'coverage'
|
58
47
|
|
59
|
-
|
60
|
-
end
|
48
|
+
ENV['SCOV'] = 'true'
|
61
49
|
end
|
62
50
|
end
|
63
51
|
|
data/lib/twitter_cldr.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
# Copyright 2012 Twitter, Inc
|
4
4
|
# http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
|
6
|
-
# $KCODE = 'UTF-8' unless RUBY_VERSION >= '1.9.0'
|
7
|
-
|
8
6
|
require 'yaml'
|
9
7
|
require 'date'
|
10
8
|
require 'time'
|
@@ -40,6 +38,7 @@ module TwitterCldr
|
|
40
38
|
|
41
39
|
RESOURCES_DIR = File.join(File.dirname(File.dirname(File.expand_path(__FILE__))), 'resources')
|
42
40
|
|
41
|
+
# TODO: convert this and all other hashes to 1.9 syntax
|
43
42
|
# maps twitter locales to cldr locales
|
44
43
|
TWITTER_LOCALE_MAP = {
|
45
44
|
:msa => :ms,
|
@@ -10,14 +10,14 @@ module TwitterCldr
|
|
10
10
|
include Enumerable
|
11
11
|
|
12
12
|
# Uses wrapped string object as a format specification and returns the result of applying it to +args+ (see
|
13
|
-
#
|
13
|
+
# standard String#% method documentation for interpolation syntax).
|
14
14
|
#
|
15
15
|
# If +args+ is a Hash than pluralization is performed before interpolation (see +PluralFormatter+ class for
|
16
16
|
# pluralization specification).
|
17
17
|
#
|
18
18
|
def %(args)
|
19
19
|
pluralized = args.is_a?(Hash) ? formatter.format(@base_obj, args) : @base_obj
|
20
|
-
|
20
|
+
escape_plural_interpolation(pluralized) % args
|
21
21
|
end
|
22
22
|
|
23
23
|
def normalize(options = {})
|
@@ -118,6 +118,11 @@ module TwitterCldr
|
|
118
118
|
|
119
119
|
protected
|
120
120
|
|
121
|
+
def escape_plural_interpolation(string)
|
122
|
+
# escape plura interpolation patterns ()see PluralFormatter)
|
123
|
+
string.gsub(TwitterCldr::Formatters::PluralFormatter::PLURALIZATION_REGEXP, '%\0')
|
124
|
+
end
|
125
|
+
|
121
126
|
def formatter
|
122
127
|
@formatter ||=
|
123
128
|
TwitterCldr::Formatters::PluralFormatter.for_locale(locale)
|