twitter_cldr_js 2.2.4 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/History.txt +5 -0
  4. data/README.md +51 -5
  5. data/Rakefile +1 -1
  6. data/lib/assets/javascripts/twitter_cldr/af.js +214 -57
  7. data/lib/assets/javascripts/twitter_cldr/ar.js +214 -57
  8. data/lib/assets/javascripts/twitter_cldr/be.js +214 -57
  9. data/lib/assets/javascripts/twitter_cldr/bg.js +214 -57
  10. data/lib/assets/javascripts/twitter_cldr/bn.js +214 -57
  11. data/lib/assets/javascripts/twitter_cldr/ca.js +214 -57
  12. data/lib/assets/javascripts/twitter_cldr/cs.js +214 -57
  13. data/lib/assets/javascripts/twitter_cldr/cy.js +215 -58
  14. data/lib/assets/javascripts/twitter_cldr/da.js +214 -57
  15. data/lib/assets/javascripts/twitter_cldr/de-CH.js +2183 -0
  16. data/lib/assets/javascripts/twitter_cldr/de.js +214 -57
  17. data/lib/assets/javascripts/twitter_cldr/el.js +214 -57
  18. data/lib/assets/javascripts/twitter_cldr/en-150.js +2183 -0
  19. data/lib/assets/javascripts/twitter_cldr/en-AU.js +2183 -0
  20. data/lib/assets/javascripts/twitter_cldr/en-CA.js +2183 -0
  21. data/lib/assets/javascripts/twitter_cldr/en-GB.js +214 -57
  22. data/lib/assets/javascripts/twitter_cldr/en-IE.js +2183 -0
  23. data/lib/assets/javascripts/twitter_cldr/en-SG.js +2183 -0
  24. data/lib/assets/javascripts/twitter_cldr/en-ZA.js +2183 -0
  25. data/lib/assets/javascripts/twitter_cldr/en.js +214 -57
  26. data/lib/assets/javascripts/twitter_cldr/es-419.js +2183 -0
  27. data/lib/assets/javascripts/twitter_cldr/es-CO.js +2183 -0
  28. data/lib/assets/javascripts/twitter_cldr/es-MX.js +2183 -0
  29. data/lib/assets/javascripts/twitter_cldr/es-US.js +2183 -0
  30. data/lib/assets/javascripts/twitter_cldr/es.js +215 -58
  31. data/lib/assets/javascripts/twitter_cldr/eu.js +214 -57
  32. data/lib/assets/javascripts/twitter_cldr/fa.js +214 -57
  33. data/lib/assets/javascripts/twitter_cldr/fi.js +214 -57
  34. data/lib/assets/javascripts/twitter_cldr/fil.js +215 -58
  35. data/lib/assets/javascripts/twitter_cldr/fr-BE.js +2183 -0
  36. data/lib/assets/javascripts/twitter_cldr/fr-CA.js +2183 -0
  37. data/lib/assets/javascripts/twitter_cldr/fr-CH.js +2183 -0
  38. data/lib/assets/javascripts/twitter_cldr/fr.js +214 -57
  39. data/lib/assets/javascripts/twitter_cldr/ga.js +214 -57
  40. data/lib/assets/javascripts/twitter_cldr/gl.js +214 -57
  41. data/lib/assets/javascripts/twitter_cldr/he.js +214 -57
  42. data/lib/assets/javascripts/twitter_cldr/hi.js +214 -57
  43. data/lib/assets/javascripts/twitter_cldr/hr.js +214 -57
  44. data/lib/assets/javascripts/twitter_cldr/hu.js +215 -58
  45. data/lib/assets/javascripts/twitter_cldr/id.js +214 -57
  46. data/lib/assets/javascripts/twitter_cldr/is.js +214 -57
  47. data/lib/assets/javascripts/twitter_cldr/it-CH.js +2183 -0
  48. data/lib/assets/javascripts/twitter_cldr/it.js +214 -57
  49. data/lib/assets/javascripts/twitter_cldr/ja.js +214 -57
  50. data/lib/assets/javascripts/twitter_cldr/ko.js +214 -57
  51. data/lib/assets/javascripts/twitter_cldr/lv.js +214 -57
  52. data/lib/assets/javascripts/twitter_cldr/msa.js +214 -57
  53. data/lib/assets/javascripts/twitter_cldr/nl.js +214 -57
  54. data/lib/assets/javascripts/twitter_cldr/no.js +214 -57
  55. data/lib/assets/javascripts/twitter_cldr/pl.js +214 -57
  56. data/lib/assets/javascripts/twitter_cldr/pt.js +214 -57
  57. data/lib/assets/javascripts/twitter_cldr/ro.js +215 -58
  58. data/lib/assets/javascripts/twitter_cldr/ru.js +214 -57
  59. data/lib/assets/javascripts/twitter_cldr/sk.js +214 -57
  60. data/lib/assets/javascripts/twitter_cldr/sq.js +215 -58
  61. data/lib/assets/javascripts/twitter_cldr/sr.js +214 -57
  62. data/lib/assets/javascripts/twitter_cldr/sv.js +214 -57
  63. data/lib/assets/javascripts/twitter_cldr/ta.js +214 -57
  64. data/lib/assets/javascripts/twitter_cldr/th.js +214 -57
  65. data/lib/assets/javascripts/twitter_cldr/tr.js +214 -57
  66. data/lib/assets/javascripts/twitter_cldr/uk.js +214 -57
  67. data/lib/assets/javascripts/twitter_cldr/ur.js +214 -57
  68. data/lib/assets/javascripts/twitter_cldr/vi.js +214 -57
  69. data/lib/assets/javascripts/twitter_cldr/zh-cn.js +214 -57
  70. data/lib/assets/javascripts/twitter_cldr/zh-tw.js +214 -57
  71. data/lib/twitter_cldr/js/compiler.rb +13 -10
  72. data/lib/twitter_cldr/js/mustache/bundle.coffee +1 -1
  73. data/lib/twitter_cldr/js/mustache/calendars/datetime.coffee +1 -1
  74. data/lib/twitter_cldr/js/mustache/calendars/timespan.coffee +2 -3
  75. data/lib/twitter_cldr/js/mustache/numbers/numbers.coffee +27 -15
  76. data/lib/twitter_cldr/js/mustache/parsers/number_parser.coffee +1 -1
  77. data/lib/twitter_cldr/js/mustache/shared/calendar.coffee +10 -1
  78. data/lib/twitter_cldr/js/mustache/shared/languages.coffee +15 -0
  79. data/lib/twitter_cldr/js/mustache/shared/lists.coffee +3 -5
  80. data/lib/twitter_cldr/js/mustache/shared/phone_codes.coffee +2 -6
  81. data/lib/twitter_cldr/js/mustache/shared/postal_codes.coffee +22 -0
  82. data/lib/twitter_cldr/js/mustache/shared/territories_containment.coffee +48 -0
  83. data/lib/twitter_cldr/js/renderers/base.rb +4 -0
  84. data/lib/twitter_cldr/js/renderers/bundle.rb +4 -0
  85. data/lib/twitter_cldr/js/renderers/calendars/additional_date_format_selector_renderer.rb +1 -1
  86. data/lib/twitter_cldr/js/renderers/calendars/datetime_renderer.rb +19 -9
  87. data/lib/twitter_cldr/js/renderers/calendars/timespan_renderer.rb +16 -10
  88. data/lib/twitter_cldr/js/renderers/numbers/numbers_renderer.rb +24 -13
  89. data/lib/twitter_cldr/js/renderers/parsers/number_parser.rb +1 -3
  90. data/lib/twitter_cldr/js/renderers/plurals/rules/plural_rules_renderer.rb +35 -4
  91. data/lib/twitter_cldr/js/renderers/shared/bidi_renderer.rb +1 -1
  92. data/lib/twitter_cldr/js/renderers/shared/calendar_renderer.rb +2 -2
  93. data/lib/twitter_cldr/js/renderers/shared/currencies_renderer.rb +1 -1
  94. data/lib/twitter_cldr/js/renderers/shared/languages_renderer.rb +27 -0
  95. data/lib/twitter_cldr/js/renderers/shared/list_renderer.rb +2 -2
  96. data/lib/twitter_cldr/js/renderers/shared/phone_codes_renderer.rb +1 -1
  97. data/lib/twitter_cldr/js/renderers/shared/postal_codes_renderer.rb +23 -0
  98. data/lib/twitter_cldr/js/renderers/shared/territories_containment_renderer.rb +20 -0
  99. data/lib/twitter_cldr/js/renderers.rb +6 -3
  100. data/lib/twitter_cldr/js/version.rb +1 -1
  101. data/spec/js/calendars/datetime.spec.js +16 -8
  102. data/spec/js/calendars/timespan.spec.js +2 -2
  103. data/spec/js/numbers/abbreviated/abbreviated_number.spec.js +9 -15
  104. data/spec/js/numbers/abbreviated/long_decimal.ko.spec.js +20 -0
  105. data/spec/js/numbers/abbreviated/short_decimal.ko.spec.js +20 -0
  106. data/spec/js/numbers/abbreviated/short_decimal.ru.spec.js +16 -0
  107. data/spec/js/numbers/currency.spec.js +12 -4
  108. data/spec/js/parsers/number_parser.spec.js +5 -1
  109. data/spec/js/shared/languages.spec.js +41 -0
  110. data/spec/js/shared/lists.spec.js +20 -0
  111. data/spec/js/shared/phone_codes.spec.js +1 -1
  112. data/spec/js/shared/postal_codes.spec.js +46 -0
  113. data/spec/js/shared/territories_containment.spec.js +89 -0
  114. data/twitter_cldr_js.gemspec +2 -3
  115. metadata +38 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7605ffd931d11a0eb0a81fbcff8115d86f53e948
4
- data.tar.gz: 84af792cbd6668372a7cdcc8d7aaaa977c69222d
3
+ metadata.gz: 670b501bc9099173d458000e6b723d83fd2b1af5
4
+ data.tar.gz: 095765a29f80d71b134a87c7c6be6ad1b062da5c
5
5
  SHA512:
6
- metadata.gz: 61afec7294b57face9371425456b76372597dbbbf15ee4288553edb920b64a3bb2b3ae68dd0f4271b91a793e6001f4c4780499aa389ba46bca5942757caf79fb
7
- data.tar.gz: 76dd252b3533c5e2bded08f27f69dc0268a45f8ebf0400a48c0bd257f465509ff1fe853dd50d33c5bfea08dad1db7c73d91a91d0f6758bbd740568dde5823074
6
+ metadata.gz: 1e5a8052a20e233fdae1955e9f59031ae17009655dcd2f181fcc73cbf680bca672bd493d05cf3ea9e184fa55abf33843527e19130536f8bf2c26699e8b344f10
7
+ data.tar.gz: 52f8961a8eff10a87885ac592595ace3dbde4e9bdcdd6a1e92277b4cd2349c01d26d810adb6bcac645d2322ab1ad338509b8e2c26148672cb4302c4782d4ff58
data/Gemfile CHANGED
@@ -14,4 +14,5 @@ end
14
14
  group :development, :test do
15
15
  gem 'pry'
16
16
  gem 'pry-nav'
17
- end
17
+ gem 'twitter_cldr', '~> 3.0.0'
18
+ end
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 2.3.0
2
+
3
+ * Fixed issue affecting additional date/time formats that was causing pattern tokens to be interpreted as plaintext.
4
+ * Moved twitter-cldr-rb from a runtime to a development dependency.
5
+
1
6
  === 2.2.4
2
7
 
3
8
  * Upgrading to twitter-cldr-rb 2.4.3 to fix abbreviated timespan issue in en-GB.
data/README.md CHANGED
@@ -222,6 +222,36 @@ bidi_str.toString();
222
222
  ```
223
223
  **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 :)
224
224
 
225
+ ### Postal Codes
226
+
227
+ The CLDR contains postal code validation regexes for a number of countries.
228
+
229
+ ```javascript
230
+ // United States
231
+ TwitterCldr.PostalCodes.is_valid("us", "94103"); // true
232
+ TwitterCldr.PostalCodes.is_valid("us", "9410"); // false
233
+
234
+ // England (Great Britain)
235
+ TwitterCldr.PostalCodes.is_valid("gb", "BS98 1TL"); // true
236
+
237
+ // Sweden
238
+ TwitterCldr.PostalCodes.is_valid("se", "280 12"); // true
239
+
240
+ // Canada
241
+ TwitterCldr.PostalCodes.is_valid("ca", "V3H 1Z7"); // true
242
+ ```
243
+
244
+ Get a list of supported territories by using the `territories` method:
245
+
246
+ ```javascript
247
+ TwitterCldr.PostalCodes.territories(); // ["ad", "am", "ar", "as", "at", ... ]
248
+ ```
249
+
250
+ Just want the regex? No problem:
251
+
252
+ ```javascript
253
+ TwitterCldr.PostalCodes.regex_for_territory("us"); // /\d{5}([ \-]\d{4})?/
254
+ ```
225
255
 
226
256
  ### Phone Codes
227
257
 
@@ -229,22 +259,38 @@ Look up phone codes by territory:
229
259
 
230
260
  ```javascript
231
261
  // United States
232
- TwitterCldr.PhoneCodes.code_for_territory("us") // "1"
262
+ TwitterCldr.PhoneCodes.code_for_territory("us"); // "1"
233
263
 
234
264
  // Perú
235
- TwitterCldr.PhoneCodes.code_for_territory("pe") // "51"
265
+ TwitterCldr.PhoneCodes.code_for_territory("pe"); // "51"
236
266
 
237
267
  // Egypt
238
- TwitterCldr.PhoneCodes.code_for_territory("eg") // "20"
268
+ TwitterCldr.PhoneCodes.code_for_territory("eg"); // "20"
239
269
 
240
270
  // Denmark
241
- TwitterCldr.PhoneCodes.code_for_territory("dk") // "45"
271
+ TwitterCldr.PhoneCodes.code_for_territory("dk"); // "45"
242
272
  ```
243
273
 
244
274
  Get a list of supported territories by using the `territories` method:
245
275
 
246
276
  ```javascript
247
- TwitterCldr.PhoneCodes.territories() // [:zw, :an, :tr, :by, :mh, ...]
277
+ TwitterCldr.PhoneCodes.territories(); // ["zw", "an", "tr", "by", "mh", ...]
278
+ ```
279
+
280
+ ### Territories Containment
281
+
282
+ Determine if a territory/region contains another region or a country (as describe [here](http://www.unicode.org/cldr/charts/25/supplemental/territory_containment_un_m_49.html)):
283
+
284
+ ```javascript
285
+ TwitterCldr.TerritoriesContainment.children('151') // ["BG", "BY", "CZ", "HU", "MD", "PL", ...]
286
+ TwitterCldr.TerritoriesContainment.children('RU') // []
287
+
288
+ TwitterCldr.TerritoriesContainment.parents('013') // ["419", "003", "019"]
289
+ TwitterCldr.TerritoriesContainment.parents('001') // []
290
+
291
+ TwitterCldr.TerritoriesContainment.contains('151', 'RU') // true
292
+ TwitterCldr.TerritoriesContainment.contains('419', 'BZ') // true
293
+ TwitterCldr.TerritoriesContainment.contains('419', 'FR') // false
248
294
  ```
249
295
 
250
296
 
data/Rakefile CHANGED
@@ -31,7 +31,7 @@ end
31
31
 
32
32
  desc 'Run JavaScript specs'
33
33
  task "spec:js" do
34
- ENV["LOCALES"] = "en,ar"
34
+ ENV["LOCALES"] = "en,ar,ko,ru"
35
35
  Rake::Task["twitter_cldr:js:update"].invoke
36
36
 
37
37
  puts "\nJasmine Specs"