i18n-js 2.1.2 → 3.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +24 -0
  3. data/.github/FUNDING.yml +3 -0
  4. data/.github/workflows/tests.yaml +106 -0
  5. data/.gitignore +6 -4
  6. data/.npmignore +27 -0
  7. data/Appraisals +52 -0
  8. data/CHANGELOG.md +575 -0
  9. data/Gemfile +1 -1
  10. data/README.md +1099 -0
  11. data/Rakefile +19 -7
  12. data/app/assets/javascripts/i18n/filtered.js.erb +23 -0
  13. data/app/assets/javascripts/i18n/shims.js +240 -0
  14. data/app/assets/javascripts/i18n/translations.js +3 -0
  15. data/app/assets/javascripts/i18n.js +1095 -0
  16. data/gemfiles/i18n_0_6.gemfile +7 -0
  17. data/gemfiles/i18n_0_7.gemfile +7 -0
  18. data/gemfiles/i18n_0_8.gemfile +7 -0
  19. data/gemfiles/i18n_0_9.gemfile +7 -0
  20. data/gemfiles/i18n_1_0.gemfile +7 -0
  21. data/gemfiles/i18n_1_1.gemfile +7 -0
  22. data/gemfiles/i18n_1_10.gemfile +7 -0
  23. data/gemfiles/i18n_1_2.gemfile +7 -0
  24. data/gemfiles/i18n_1_3.gemfile +7 -0
  25. data/gemfiles/i18n_1_4.gemfile +7 -0
  26. data/gemfiles/i18n_1_5.gemfile +7 -0
  27. data/gemfiles/i18n_1_6.gemfile +7 -0
  28. data/gemfiles/i18n_1_7.gemfile +7 -0
  29. data/gemfiles/i18n_1_8.gemfile +7 -0
  30. data/gemfiles/i18n_1_9.gemfile +7 -0
  31. data/i18n-js.gemspec +13 -10
  32. data/i18njs.png +0 -0
  33. data/lib/i18n/js/dependencies.rb +67 -0
  34. data/lib/i18n/js/engine.rb +87 -0
  35. data/lib/i18n/js/fallback_locales.rb +70 -0
  36. data/lib/i18n/js/formatters/base.rb +25 -0
  37. data/lib/i18n/js/formatters/js.rb +39 -0
  38. data/lib/i18n/js/formatters/json.rb +13 -0
  39. data/lib/{i18n-js → i18n/js}/middleware.rb +32 -9
  40. data/lib/i18n/js/private/config_store.rb +31 -0
  41. data/lib/i18n/js/private/hash_with_symbol_keys.rb +36 -0
  42. data/lib/i18n/js/segment.rb +81 -0
  43. data/lib/i18n/js/utils.rb +91 -0
  44. data/lib/i18n/js/version.rb +7 -0
  45. data/lib/i18n/js.rb +274 -0
  46. data/lib/i18n-js.rb +1 -177
  47. data/lib/rails/generators/i18n/js/config/config_generator.rb +19 -0
  48. data/{config → lib/rails/generators/i18n/js/config/templates}/i18n-js.yml +11 -6
  49. data/lib/tasks/export.rake +8 -0
  50. data/package.json +25 -0
  51. data/spec/fixtures/custom_path.yml +5 -0
  52. data/spec/fixtures/default.yml +5 -0
  53. data/spec/fixtures/erb.yml +5 -0
  54. data/spec/fixtures/except_condition.yml +7 -0
  55. data/spec/fixtures/js_available_locales_custom.yml +1 -0
  56. data/spec/fixtures/js_export_dir_custom.yml +7 -0
  57. data/spec/fixtures/js_export_dir_none.yml +6 -0
  58. data/spec/fixtures/js_extend_parent.yml +6 -0
  59. data/spec/fixtures/js_extend_segment.yml +6 -0
  60. data/spec/fixtures/js_file_per_locale.yml +7 -0
  61. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml +4 -0
  62. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml +6 -0
  63. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml +4 -0
  64. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml +4 -0
  65. data/spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml +4 -0
  66. data/spec/fixtures/js_file_per_locale_without_fallbacks.yml +4 -0
  67. data/spec/fixtures/js_file_with_namespace_prefix_and_pretty_print.yml +9 -0
  68. data/spec/fixtures/js_sort_translation_keys_false.yml +6 -0
  69. data/spec/fixtures/js_sort_translation_keys_true.yml +6 -0
  70. data/spec/fixtures/json_only.yml +18 -0
  71. data/spec/{resources → fixtures}/locales.yml +58 -1
  72. data/spec/fixtures/merge_plurals.yml +6 -0
  73. data/spec/fixtures/merge_plurals_with_no_overrides.yml +4 -0
  74. data/spec/fixtures/merge_plurals_with_partial_overrides.yml +4 -0
  75. data/spec/fixtures/millions.yml +4 -0
  76. data/spec/fixtures/multiple_conditions.yml +7 -0
  77. data/spec/fixtures/multiple_conditions_per_locale.yml +7 -0
  78. data/spec/fixtures/multiple_files.yml +7 -0
  79. data/spec/{resources → fixtures}/no_config.yml +0 -0
  80. data/spec/fixtures/no_scope.yml +4 -0
  81. data/spec/fixtures/simple_scope.yml +5 -0
  82. data/spec/js/currency.spec.js +62 -0
  83. data/spec/js/current_locale.spec.js +19 -0
  84. data/spec/js/dates.spec.js +276 -0
  85. data/spec/js/defaults.spec.js +31 -0
  86. data/spec/js/extend.spec.js +110 -0
  87. data/spec/js/interpolation.spec.js +124 -0
  88. data/spec/js/jasmine/MIT.LICENSE +20 -0
  89. data/spec/js/jasmine/jasmine-html.js +190 -0
  90. data/spec/js/jasmine/jasmine.css +166 -0
  91. data/spec/js/jasmine/jasmine.js +2476 -0
  92. data/spec/js/jasmine/jasmine_favicon.png +0 -0
  93. data/spec/js/json_parsable.spec.js +14 -0
  94. data/spec/js/locales.spec.js +31 -0
  95. data/spec/js/localization.spec.js +78 -0
  96. data/spec/js/numbers.spec.js +174 -0
  97. data/spec/js/placeholder.spec.js +24 -0
  98. data/spec/js/pluralization.spec.js +228 -0
  99. data/spec/js/prepare_options.spec.js +41 -0
  100. data/spec/js/require.js +2083 -0
  101. data/spec/js/specs.html +49 -0
  102. data/spec/js/specs_requirejs.html +72 -0
  103. data/spec/js/translate.spec.js +304 -0
  104. data/spec/js/translations.js +188 -0
  105. data/spec/js/utility_functions.spec.js +20 -0
  106. data/spec/ruby/i18n/js/fallback_locales_spec.rb +84 -0
  107. data/spec/ruby/i18n/js/segment_spec.rb +286 -0
  108. data/spec/ruby/i18n/js/utils_spec.rb +138 -0
  109. data/spec/ruby/i18n/js_spec.rb +797 -0
  110. data/spec/spec_helper.rb +75 -14
  111. data/yarn.lock +138 -0
  112. metadata +225 -96
  113. data/.rspec +0 -1
  114. data/Gemfile.lock +0 -51
  115. data/README.rdoc +0 -305
  116. data/lib/i18n-js/engine.rb +0 -62
  117. data/lib/i18n-js/railtie.rb +0 -13
  118. data/lib/i18n-js/rake.rb +0 -16
  119. data/lib/i18n-js/version.rb +0 -10
  120. data/spec/i18n_spec.js +0 -768
  121. data/spec/i18n_spec.rb +0 -205
  122. data/spec/resources/custom_path.yml +0 -4
  123. data/spec/resources/default.yml +0 -4
  124. data/spec/resources/js_file_per_locale.yml +0 -3
  125. data/spec/resources/multiple_conditions.yml +0 -6
  126. data/spec/resources/multiple_files.yml +0 -6
  127. data/spec/resources/no_scope.yml +0 -3
  128. data/spec/resources/simple_scope.yml +0 -4
  129. data/vendor/assets/javascripts/i18n/translations.js.erb +0 -7
  130. data/vendor/assets/javascripts/i18n.js +0 -450
data/CHANGELOG.md ADDED
@@ -0,0 +1,575 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](https://semver.org/).
4
+
5
+
6
+ ## [Unreleased]
7
+
8
+ ### Added
9
+
10
+ - Nothing
11
+
12
+ ### Changed
13
+
14
+ - Nothing
15
+
16
+ ### Fixed
17
+
18
+ - Nothing
19
+
20
+
21
+ ## [3.9.2] - 2022-03-31
22
+
23
+ ### Fixed
24
+
25
+ - [JS] Fix pluralization fallback in i18n.js
26
+ (PR: https://github.com/fnando/i18n-js/pull/645)
27
+
28
+
29
+ ## [3.9.1] - 2022-02-08
30
+
31
+ ### Changed
32
+
33
+ - [Ruby] Allow rails 7
34
+ (PR: https://github.com/fnando/i18n-js/pull/638)
35
+
36
+
37
+ ## [3.9.0] - 2021-07-30
38
+
39
+ ### Added
40
+
41
+ - [Ruby] Allow to set custom locales instead of using only `I18n.available_locales`.
42
+ (PR: https://github.com/fnando/i18n-js/pull/617)
43
+
44
+
45
+ ## [3.8.4] - 2021-07-27
46
+
47
+ ### Fixed
48
+
49
+ - [Ruby] Fix proc exported to JS/JSON file(s) causing issues like git merge conflicts
50
+ (PR: https://github.com/fnando/i18n-js/pull/591)
51
+
52
+
53
+ ## [3.8.3] - 2021-05-21
54
+
55
+ ### Changed
56
+
57
+ - [Ruby] Generate translations in JS as `JSON.parse` instead of object literal for performance
58
+ (PR: https://github.com/fnando/i18n-js/pull/605)
59
+ (PR: https://github.com/fnando/i18n-js/pull/606)
60
+ (PR: https://github.com/fnando/i18n-js/pull/607)
61
+
62
+
63
+ ## [3.8.2] - 2021-03-18
64
+
65
+ ### Fixed
66
+
67
+ - [Ruby] Stop using deprecated method
68
+ (PR: https://github.com/fnando/i18n-js/pull/598)
69
+ - [Ruby] Fix typo in error class reference
70
+ (Commit: https://github.com/fnando/i18n-js/commit/cc075ad0a36e940205d0a14390379d69013d188e)
71
+
72
+
73
+ ## [3.8.1] - 2021-02-25
74
+
75
+ ### Fixed
76
+
77
+ - [Ruby] Fix performance issue reading config
78
+ (PR: https://github.com/fnando/i18n-js/pull/593)
79
+
80
+
81
+ ## [3.8.0] - 2020-10-15
82
+
83
+ ### Added
84
+
85
+ - [JS] Add option `scope` for `toHumanSize()`
86
+ (PR: https://github.com/fnando/i18n-js/pull/583)
87
+
88
+
89
+ ## [3.7.1] - 2020-06-30
90
+
91
+ ### Fixed
92
+
93
+ - [JS] For translation missing behaviour `guess`, replace all underscores to spaces properly
94
+ (PR: https://github.com/fnando/i18n-js/pull/574)
95
+
96
+
97
+ ## [3.7.0] - 2020-05-29
98
+
99
+ ### Added
100
+
101
+ - [JS] Allow options to be passed in when calling `I18n.localize`/`I18n.l`
102
+ (PR: https://github.com/fnando/i18n-js/pull/570)
103
+
104
+
105
+ ## [3.6.0] - 2020-02-14
106
+
107
+ ### Added
108
+
109
+ - [Ruby] Allow `suffix` to be added to generated translations files
110
+ (PR: https://github.com/fnando/i18n-js/pull/561)
111
+
112
+
113
+ ## [3.5.1] - 2019-12-21
114
+
115
+ ### Changed
116
+
117
+ - [JS] Bound shortcut functions
118
+ (PR: https://github.com/fnando/i18n-js/pull/560)
119
+
120
+
121
+ ## [3.5.0] - 2019-11-12
122
+
123
+ ### Added
124
+
125
+ - [JS] Support for `%k` strftime format to match Ruby strftime
126
+ (PR: https://github.com/fnando/i18n-js/pull/554)
127
+
128
+
129
+ ## [3.4.2] - 2019-11-11
130
+
131
+ ### Fixed
132
+
133
+ - [Ruby] Fix regression introduced in PR #551
134
+ (PR: https://github.com/fnando/i18n-js/pull/555)
135
+
136
+
137
+ ## [3.4.1] - 2019-11-01
138
+
139
+ ### Fixed
140
+
141
+ - [Ruby] Fix merging of plural keys to work with fallbacks that aren't overridden
142
+ (PR: https://github.com/fnando/i18n-js/pull/551)
143
+
144
+
145
+ ## [3.4.0] - 2019-10-15
146
+
147
+ ### Added
148
+
149
+ - [Ruby] Allow `prefix` to be added to generated translations files
150
+ (PR: https://github.com/fnando/i18n-js/pull/549)
151
+
152
+
153
+ ## [3.3.0] - 2019-06-06
154
+
155
+ ### Added
156
+
157
+ - [JS] Support for `%P`, `%Z`, and `%l` strftime formats to match Ruby strftime
158
+ (PR: https://github.com/fnando/i18n-js/pull/537)
159
+
160
+
161
+ ## [3.2.3] - 2019-05-24
162
+
163
+ ### Changed
164
+
165
+ - [Ruby] Allow rails 6 to be used with this gem
166
+ (PR: https://github.com/fnando/i18n-js/pull/536)
167
+
168
+
169
+ ## [3.2.2] - 2019-05-09
170
+
171
+ ### Fixed
172
+
173
+ - [JS] Return invalid date/time input values (null & undefined) as-is
174
+ (Commit: https://github.com/fnando/i18n-js/commit/869d1689ed788ff50121de492db354652971c23d)
175
+
176
+
177
+ ## [3.2.1] - 2019-01-22
178
+
179
+ ### Changed
180
+
181
+ - [Ruby] `json_only` option should allow multiple locales.
182
+ (PR: https://github.com/fnando/i18n-js/pull/531)
183
+ - [Ruby] Simplified and cleaned code related to JS/JSON formatting.
184
+ (PR: https://github.com/fnando/i18n-js/pull/531)
185
+ - [JS] Use strict value comparison
186
+
187
+ ### Fixed
188
+
189
+ - [Ruby] Relax `i18n` version requirement back to `>= 0.6.6`
190
+ (PR: https://github.com/fnando/i18n-js/pull/530)
191
+ - [Ruby] Fix merging of plural keys across locales.
192
+ (PR: https://github.com/fnando/i18n-js/pull/472)
193
+
194
+
195
+ ## [3.2.0] - 2018-11-16
196
+
197
+ ### Added
198
+
199
+ - [Ruby] Add option `json_only` to generate translations in JSON
200
+ (PR: https://github.com/fnando/i18n-js/pull/524)
201
+
202
+ ### Changed
203
+
204
+ - [Ruby] Requires `i18n` to be `>= 0.8.0` for CVE-2014-10077
205
+
206
+
207
+ ## [3.1.0] - 2018-11-01
208
+
209
+ ### Added
210
+
211
+ - [Ruby] Add option to allow setting a different I18n backend
212
+ (PR: https://github.com/fnando/i18n-js/pull/519)
213
+
214
+ ### Fixed
215
+
216
+ - [JS] Fix missing translation when pluralizing with default scopes
217
+ (PR: https://github.com/fnando/i18n-js/pull/516)
218
+
219
+
220
+ ## [3.0.11] - 2018-07-06
221
+
222
+ ### Fixed
223
+
224
+ - [JS] Fix interpolation for array with non string/null elements
225
+ (PR: https://github.com/fnando/i18n-js/pull/505)
226
+
227
+
228
+ ## [3.0.10] - 2018-06-21
229
+
230
+ ### Fixed
231
+
232
+ - [JS] Fix extend method changing keys with `null` to empty objects
233
+ (PR: https://github.com/fnando/i18n-js/pull/503)
234
+ - [JS] Fix variable name in an internal method
235
+ (PR: https://github.com/fnando/i18n-js/pull/501)
236
+
237
+
238
+ ## [3.0.9] - 2018-06-21
239
+
240
+ ### Fixed
241
+
242
+ - [JS] Fix translation array interpolation for array with null
243
+
244
+
245
+ ## [3.0.8] - 2018-06-06
246
+
247
+ ### Changed
248
+
249
+ - [JS] Interpolate translation array too
250
+ (PR: https://github.com/fnando/i18n-js/pull/498)
251
+
252
+
253
+ ## [3.0.7] - 2018-05-30
254
+
255
+ ### Fixed
256
+
257
+ - [Ruby] Fix new bug occuring when config file is absent
258
+
259
+
260
+ ## [3.0.6] - 2018-05-30
261
+
262
+ ### Fixed
263
+
264
+ - [Ruby] Make JS `i18n/filtered` depends on i18n-js config too
265
+ (PR: https://github.com/fnando/i18n-js/pull/497)
266
+
267
+
268
+ ## [3.0.5] - 2018-02-26
269
+
270
+ ### Changed
271
+
272
+ - [Ruby] Support `I18n` `1.0.x`
273
+ (PR: https://github.com/fnando/i18n-js/pull/492)
274
+
275
+
276
+ ## [3.0.4] - 2018-01-26
277
+
278
+ ### Fixed
279
+
280
+ - [Ruby] Fix `JS::Dependencies.using_asset_pipeline?` returning true when sprockets installed but disabled
281
+ (PR: https://github.com/fnando/i18n-js/pull/488)
282
+
283
+
284
+ ## [3.0.3] - 2018-01-02
285
+
286
+ ### Fixed
287
+
288
+ - [Ruby] Fix extend method when translations has array values
289
+ (PR: https://github.com/fnando/i18n-js/pull/487)
290
+
291
+
292
+ ## [3.0.2] - 2017-10-26
293
+
294
+ ### Changed
295
+
296
+ - [Ruby] Avoid writing new file if a file with same content already exists
297
+ (PR: https://github.com/fnando/i18n-js/pull/473)
298
+ - [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
299
+ It was falling back to `zh` first instead of `zh-Hant` (see new test case added)
300
+ (PR: https://github.com/fnando/i18n-js/pull/475)
301
+
302
+
303
+ ## [3.0.1] - 2017-08-02
304
+
305
+ ### Changed
306
+
307
+ - [Ruby] Relax Rails detection code to work with alternative installation methods
308
+ (PR: https://github.com/fnando/i18n-js/pull/467)
309
+ - [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
310
+ It fallbacks to `zh` only before, now it fallbacks to `zh-Hant`
311
+ (PR: https://github.com/fnando/i18n-js/pull/465)
312
+
313
+
314
+ ## [3.0.0] - 2017-04-01
315
+
316
+ This is a fake official release, the *real* one will be `3.0.0.rc17`
317
+ And today is not April Fools' Day
318
+
319
+ ### Fixed
320
+
321
+ - Ends the longest Release Candidate period among all ruby gems
322
+ (v3.0.0.rc1 released at 2012-05-10)
323
+
324
+
325
+ ## [3.0.0.rc16] - 2017-03-13
326
+
327
+ ### Changed
328
+
329
+ - [Ruby] Drop support for Ruby < `2.1.0`
330
+
331
+ ### Fixed
332
+
333
+ - [JS] Make defaultValue works on plural translation
334
+ - [JS] Fix UMD pattern so the global/root won’t be undefined
335
+
336
+
337
+ ## [3.0.0.rc15] - 2016-12-07
338
+
339
+ ### Added
340
+
341
+ - Nothing
342
+
343
+ ### Changed
344
+
345
+ - [JS] Allow `defaultValue` to work in pluralization
346
+ (PR: https://github.com/fnando/i18n-js/pull/433)
347
+ - [Ruby] Stop validating the fallback locales against `I18n.available_locales`
348
+ This allows some locales to be used as fallback locales, but not to be generated in JS.
349
+ (PR: https://github.com/fnando/i18n-js/pull/425)
350
+ - [Ruby] Remove dependency on gem `activesupport`
351
+
352
+ ### Fixed
353
+
354
+ - [JS] Stop converting numeric & boolean values into objects
355
+ when merging objects with `I18n.extend`
356
+ (PR: https://github.com/fnando/i18n-js/pull/420)
357
+ - [JS] Fix I18n pluralization fallback when tree is empty
358
+ (PR: https://github.com/fnando/i18n-js/pull/435)
359
+ - [Ruby] Use old syntax to define lambda for compatibility with older Rubies
360
+ (Issue: https://github.com/fnando/i18n-js/issues/419)
361
+ - [Ruby] Fix error raised in middleware cache cleaning in parallel test
362
+ (Issue: https://github.com/fnando/i18n-js/issues/436)
363
+
364
+
365
+ ## [3.0.0.rc14] - 2016-08-29
366
+
367
+ ### Changed
368
+
369
+ - [JS] Method `I18n.extend()` behave as deep merging instead of shallow merging. (https://github.com/fnando/i18n-js/pull/416)
370
+ - [Ruby] Use object/class instead of block when registering Sprockets preprocessor (https://github.com/fnando/i18n-js/pull/418)
371
+ To ensure that your cache will expire properly based on locale file content after upgrading,
372
+ you should run `rake assets:clobber` and/or other rake tasks that clear the asset cache once gem updated
373
+ - [Ruby] Detect & support rails 5 (https://github.com/fnando/i18n-js/pull/413)
374
+
375
+
376
+ ## [3.0.0.rc13] - 2016-06-29
377
+
378
+ ### Added
379
+
380
+ - [Ruby] Added option `js_extend` to not generate JS code for translations with usage of `I18n.extend` ([#397](https://github.com/fnando/i18n-js/pull/397))
381
+
382
+ ### Changed
383
+
384
+ - Nothing
385
+
386
+ ### Fixed
387
+
388
+ - [JS] Initialize option `missingBehaviour` & `missingTranslationPrefix` with default values ([#398](https://github.com/fnando/i18n-js/pull/398))
389
+ - [JS] Throw an error when `I18n.strftime()` takes an invalid date ([#383](https://github.com/fnando/i18n-js/pull/383))
390
+ - [JS] Fix default error message when translation missing to consider locale passed in options
391
+ - [Ruby] Reset middleware cache on rails startup
392
+ ([#402](https://github.com/fnando/i18n-js/pull/402))
393
+
394
+
395
+ ## [3.0.0.rc12] - 2015-12-30
396
+
397
+ ### Added
398
+
399
+ - [JS] Allow extending of translation files ([#354](https://github.com/fnando/i18n-js/pull/354))
400
+ - [JS] Allow missingPlaceholder to receive extra data for debugging ([#380](https://github.com/fnando/i18n-js/pull/380))
401
+
402
+ ### Changed
403
+
404
+ - Nothing
405
+
406
+ ### Fixed
407
+
408
+ - [Ruby] Fix of missing initializer at sprockets. ([#371](https://github.com/fnando/i18n-js/pull/371))
409
+ - [Ruby] Use proper method to register preprocessor documented by sprockets-rails. ([#376](https://github.com/fnando/i18n-js/pull/376))
410
+ - [JS] Correctly round unprecise floating point numbers.
411
+ - [JS] Ensure objects are recognized when passed in from an iframe. ([#375](https://github.com/fnando/i18n-js/pull/375))
412
+
413
+
414
+ ## 3.0.0.rc11
415
+
416
+ ### breaking changes
417
+
418
+ ### enhancements
419
+
420
+ ### bug fixes
421
+
422
+ - [Ruby] Handle fallback locale without any translation properly ([#338](https://github.com/fnando/i18n-js/pull/338))
423
+ - [Ruby] Prevent translation entry with null value to override value in fallback locale(s), if enabled ([#334](https://github.com/fnando/i18n-js/pull/334))
424
+
425
+
426
+ ## 3.0.0.rc10
427
+
428
+ ### breaking changes
429
+
430
+ - [Ruby] In `config/i18n-js.yml`, if you are using `%{locale}` in your filename and are referencing specific translations keys, please add `*.` to the beginning of those keys. ([#320](https://github.com/fnando/i18n-js/pull/320))
431
+ - [Ruby] The `:except` option to exclude certain phrases now (only) accepts the same patterns the `:only` option accepts
432
+
433
+ ### enhancements
434
+
435
+ - [Ruby] Make handling of per-locale and not-per-locale exporting to be more consistent ([#320](https://github.com/fnando/i18n-js/pull/320))
436
+ - [Ruby] Add option `sort_translation_keys` to sort translation keys alphabetically ([#318](https://github.com/fnando/i18n-js/pull/318))
437
+
438
+ ### bug fixes
439
+
440
+ - [Ruby] Fix fallback logic to work with not-per-locale files ([#320](https://github.com/fnando/i18n-js/pull/320))
441
+
442
+
443
+ ## 3.0.0.rc9
444
+
445
+ ### enhancements
446
+
447
+ - [JS] Force currency number sign to be at first place using `sign_first` option, default to `true`
448
+ - [Ruby] Add option `namespace` & `pretty_print` ([#300](https://github.com/fnando/i18n-js/pull/300))
449
+ - [Ruby] Add option `export_i18n_js` ([#301](https://github.com/fnando/i18n-js/pull/301))
450
+ - [Ruby] Now the gem also detects pre-release versions of `rails`
451
+ - [Ruby] Add `:except` option to exclude certain phrases or groups of phrases from the
452
+ outputted translations ([#312](https://github.com/fnando/i18n-js/pull/312))
453
+ - [JS] You can now set `I18n.missingBehavior='guess'` to have the scope string output as text instead of of the
454
+ "[missing `scope`]" message when no translation is available.
455
+ Combined that with `I18n.missingTranslationPrefix='SOMETHING'` and you can
456
+ still identify those missing strings.
457
+ ([#304](https://github.com/fnando/i18n-js/pull/304))
458
+
459
+ ### bug fixes
460
+
461
+ - [JS] Fix missing translation message when scope is passed in options
462
+ - [Ruby] Fix save cache directory verification when path is a symbolic link ([#329](https://github.com/fnando/i18n-js/pull/329))
463
+
464
+
465
+ ## 3.0.0.rc8
466
+
467
+ ### enhancements
468
+
469
+ - Add support for loading via AMD and CommonJS module loaders ([#266](https://github.com/fnando/i18n-js/pull/266))
470
+ - Add `I18n.nullPlaceholder`
471
+ Defaults to I18n.missingPlaceholder (`[missing {{name}} value]`)
472
+ Set to `function() {return "";}` to match Ruby `I18n.t("name: %{name}", name: nil)`
473
+ - For date formatting, you can now also add placeholders to the date format, see README for detail
474
+ - Add fallbacks option to `i18n-js.yml`, defaults to `true`
475
+
476
+ ### bug fixes
477
+
478
+ - Fix factory initialization so that the Node/CommonJS branch only gets executed if the environment is Node/CommonJS
479
+ (it currently will execute if module is defined in the global scope, which occurs with QUnit, for example)
480
+ - Fix pluralization rules selection for negative `count` (e.g. `-1` was lead to use `one` for pluralization) ([#268](https://github.com/fnando/i18n-js/pull/268))
481
+ - Remove check for `Rails.configuration.assets.compile` before telling Sprockets the dependency of translations JS file
482
+ This might be the reason of many "cache not expired" issues
483
+ Discovered/reported in #277
484
+
485
+ ## 3.0.0.rc7
486
+
487
+ ### enhancements
488
+
489
+ - The Rails Engine initializer is now named as `i18n-js.register_preprocessor` (https://github.com/fnando/i18n-js/pull/261)
490
+ - Rename `I18n::JS.config_file` to `I18n::JS.config_file_path` and make it configurable
491
+ Expected a `String`, default is still `config/i18n-js.yml`
492
+ - When running `rake i18n:js:export`, the `i18n.js` will also be exported to `I18n::JS.export_i18n_js_dir_path` by default
493
+ - Add `I18n::JS.export_i18n_js_dir_path`
494
+ Expected a `String`, default is `public/javascripts`
495
+ Set to `nil` will disable exporting `i18n.js`
496
+
497
+ ### bug fixes
498
+
499
+ - Prevent toString() call on `undefined` when there is a missing interpolation value
500
+ - Added support for Rails instances without Sprockets object (https://github.com/fnando/i18n-js/pull/241)
501
+ - Fix `DEFAULT_OPTIONS` in `i18n.js` which contained an excessive comma
502
+ - Fix `nil` values are exported into JS files which causes strange translation error
503
+ - Fix pattern to replace all escaped $ in I18n.translate
504
+ - Fix JS `I18n.lookup` modifies existing locales accidentally
505
+
506
+ ## 3.0.0.rc6
507
+
508
+ ### enhancements
509
+
510
+ - You can now assign `I18n.locale` & `I18n.default_locale` before loading `i18n.js` in `application.html.*`
511
+ (merged to `i18n-js-pika` already)
512
+ - You can include ERB in `config/i18n-js.yml`(https://github.com/fnando/i18n-js/pull/224)
513
+ - Add support for +00:00 style time zone designator (https://github.com/fnando/i18n-js/pull/167)
514
+ - Add back rake task for export (`rake i18n:js:export`)
515
+ - Not overriding translation when manually run `I18n::JS.export` (https://github.com/fnando/i18n-js/pull/171)
516
+ - Move missing placeholder text generation into its own function (for easier debugging) (https://github.com/fnando/i18n-js/pull/169)
517
+ - Add support for milliseconds (`lll` in `yyyy-mm-ddThh:mm:ss.lllZ`) (https://github.com/fnando/i18n-js/pull/192)
518
+ - Add back i18n-js.yml config file generator : `rails generate i18n:js:config` (https://github.com/fnando/i18n-js/pull/225)
519
+
520
+ ### bug fixes
521
+
522
+ - `I18n::JS.export` no longer exports locales other than those in `I18n.available_locales`, if `I18n.available_locales` is set
523
+ - I18.t supports the base scope through the options argument
524
+ - I18.t accepts an array as the scope
525
+ - Fix regression: asset not being reloaded in development when translation changed
526
+ - Requires `i18n` to be `~> 0.6`, `0.5` does not work at all
527
+ - Fix using multi-star scope with top-level translation key (https://github.com/fnando/i18n-js/pull/221)
528
+
529
+
530
+ ## Before 3.0.0.rc5
531
+
532
+ - Things happened.
533
+
534
+
535
+
536
+ [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.9.2...HEAD
537
+ [3.9.2]: https://github.com/fnando/i18n-js/compare/v3.9.1...v3.9.2
538
+ [3.9.1]: https://github.com/fnando/i18n-js/compare/v3.9.0...v3.9.1
539
+ [3.9.0]: https://github.com/fnando/i18n-js/compare/v3.8.4...v3.9.0
540
+ [3.8.4]: https://github.com/fnando/i18n-js/compare/v3.8.3...v3.8.4
541
+ [3.8.3]: https://github.com/fnando/i18n-js/compare/v3.8.2...v3.8.3
542
+ [3.8.2]: https://github.com/fnando/i18n-js/compare/v3.8.1...v3.8.2
543
+ [3.8.1]: https://github.com/fnando/i18n-js/compare/v3.8.0...v3.8.1
544
+ [3.8.0]: https://github.com/fnando/i18n-js/compare/v3.7.1...v3.8.0
545
+ [3.7.1]: https://github.com/fnando/i18n-js/compare/v3.7.0...v3.7.1
546
+ [3.7.0]: https://github.com/fnando/i18n-js/compare/v3.6.0...v3.7.0
547
+ [3.6.0]: https://github.com/fnando/i18n-js/compare/v3.5.1...v3.6.0
548
+ [3.5.1]: https://github.com/fnando/i18n-js/compare/v3.5.0...v3.5.1
549
+ [3.5.0]: https://github.com/fnando/i18n-js/compare/v3.4.2...v3.5.0
550
+ [3.4.2]: https://github.com/fnando/i18n-js/compare/v3.4.1...v3.4.2
551
+ [3.4.1]: https://github.com/fnando/i18n-js/compare/v3.4.0...v3.4.1
552
+ [3.4.0]: https://github.com/fnando/i18n-js/compare/v3.3.0...v3.4.0
553
+ [3.3.0]: https://github.com/fnando/i18n-js/compare/v3.2.3...v3.3.0
554
+ [3.2.3]: https://github.com/fnando/i18n-js/compare/v3.2.2...v3.2.3
555
+ [3.2.2]: https://github.com/fnando/i18n-js/compare/v3.2.1...v3.2.2
556
+ [3.2.1]: https://github.com/fnando/i18n-js/compare/v3.2.0...v3.2.1
557
+ [3.2.0]: https://github.com/fnando/i18n-js/compare/v3.1.0...v3.2.0
558
+ [3.1.0]: https://github.com/fnando/i18n-js/compare/v3.0.11...v3.1.0
559
+ [3.0.11]: https://github.com/fnando/i18n-js/compare/v3.0.10...v3.0.11
560
+ [3.0.10]: https://github.com/fnando/i18n-js/compare/v3.0.9...v3.0.10
561
+ [3.0.9]: https://github.com/fnando/i18n-js/compare/v3.0.8...v3.0.9
562
+ [3.0.8]: https://github.com/fnando/i18n-js/compare/v3.0.7...v3.0.8
563
+ [3.0.7]: https://github.com/fnando/i18n-js/compare/v3.0.6...v3.0.7
564
+ [3.0.6]: https://github.com/fnando/i18n-js/compare/v3.0.5...v3.0.6
565
+ [3.0.5]: https://github.com/fnando/i18n-js/compare/v3.0.4...v3.0.5
566
+ [3.0.4]: https://github.com/fnando/i18n-js/compare/v3.0.3...v3.0.4
567
+ [3.0.3]: https://github.com/fnando/i18n-js/compare/v3.0.2...v3.0.3
568
+ [3.0.2]: https://github.com/fnando/i18n-js/compare/v3.0.1...v3.0.2
569
+ [3.0.1]: https://github.com/fnando/i18n-js/compare/v3.0.0...v3.0.1
570
+ [3.0.0]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc16...v3.0.0
571
+ [3.0.0.rc16]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc15...v3.0.0.rc16
572
+ [3.0.0.rc15]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc14...v3.0.0.rc15
573
+ [3.0.0.rc14]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc13...v3.0.0.rc14
574
+ [3.0.0.rc13]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc12...v3.0.0.rc13
575
+ [3.0.0.rc12]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc11...v3.0.0.rc12
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
  gemspec