i18n-js 3.7.1 → 4.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +4 -0
  3. data/.github/FUNDING.yml +3 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  7. data/.github/dependabot.yml +15 -0
  8. data/.github/workflows/ruby-tests.yml +61 -0
  9. data/.gitignore +11 -7
  10. data/.rubocop.yml +12 -0
  11. data/CHANGELOG.md +12 -495
  12. data/CODE_OF_CONDUCT.md +74 -0
  13. data/CONTRIBUTING.md +79 -0
  14. data/Gemfile +3 -0
  15. data/LICENSE.md +20 -0
  16. data/README.md +89 -903
  17. data/Rakefile +10 -20
  18. data/exe/i18n +5 -0
  19. data/i18n-js.gemspec +47 -29
  20. data/lib/guard/i18n-js.rb +78 -0
  21. data/lib/guard/i18n-js/templates/Guardfile +10 -0
  22. data/lib/guard/i18n-js/version.rb +13 -0
  23. data/lib/i18n-js.rb +66 -1
  24. data/lib/i18n-js/cli.rb +47 -0
  25. data/lib/i18n-js/cli/command.rb +43 -0
  26. data/lib/i18n-js/cli/export_command.rb +108 -0
  27. data/lib/i18n-js/cli/init_command.rb +50 -0
  28. data/lib/i18n-js/cli/ui.rb +30 -0
  29. data/lib/i18n-js/cli/version_command.rb +18 -0
  30. data/lib/i18n-js/listen.rb +80 -0
  31. data/lib/i18n-js/schema.rb +92 -0
  32. data/lib/i18n-js/version.rb +5 -0
  33. metadata +123 -190
  34. data/.editorconfig +0 -24
  35. data/.npmignore +0 -27
  36. data/.travis.yml +0 -39
  37. data/Appraisals +0 -44
  38. data/app/assets/javascripts/i18n.js +0 -1092
  39. data/app/assets/javascripts/i18n/filtered.js.erb +0 -23
  40. data/app/assets/javascripts/i18n/shims.js +0 -240
  41. data/app/assets/javascripts/i18n/translations.js +0 -3
  42. data/gemfiles/i18n_0_6.gemfile +0 -7
  43. data/gemfiles/i18n_0_7.gemfile +0 -7
  44. data/gemfiles/i18n_0_8.gemfile +0 -7
  45. data/gemfiles/i18n_0_9.gemfile +0 -7
  46. data/gemfiles/i18n_1_0.gemfile +0 -7
  47. data/gemfiles/i18n_1_1.gemfile +0 -7
  48. data/gemfiles/i18n_1_2.gemfile +0 -7
  49. data/gemfiles/i18n_1_3.gemfile +0 -7
  50. data/gemfiles/i18n_1_4.gemfile +0 -7
  51. data/gemfiles/i18n_1_5.gemfile +0 -7
  52. data/gemfiles/i18n_1_6.gemfile +0 -7
  53. data/gemfiles/i18n_1_7.gemfile +0 -7
  54. data/gemfiles/i18n_1_8.gemfile +0 -7
  55. data/lib/i18n/js.rb +0 -259
  56. data/lib/i18n/js/dependencies.rb +0 -63
  57. data/lib/i18n/js/engine.rb +0 -87
  58. data/lib/i18n/js/fallback_locales.rb +0 -70
  59. data/lib/i18n/js/formatters/base.rb +0 -25
  60. data/lib/i18n/js/formatters/js.rb +0 -32
  61. data/lib/i18n/js/formatters/json.rb +0 -13
  62. data/lib/i18n/js/middleware.rb +0 -82
  63. data/lib/i18n/js/private/hash_with_symbol_keys.rb +0 -36
  64. data/lib/i18n/js/segment.rb +0 -80
  65. data/lib/i18n/js/utils.rb +0 -78
  66. data/lib/i18n/js/version.rb +0 -7
  67. data/lib/rails/generators/i18n/js/config/config_generator.rb +0 -19
  68. data/lib/rails/generators/i18n/js/config/templates/i18n-js.yml +0 -27
  69. data/lib/tasks/export.rake +0 -8
  70. data/package.json +0 -25
  71. data/spec/fixtures/custom_path.yml +0 -5
  72. data/spec/fixtures/default.yml +0 -5
  73. data/spec/fixtures/erb.yml +0 -5
  74. data/spec/fixtures/except_condition.yml +0 -7
  75. data/spec/fixtures/js_export_dir_custom.yml +0 -7
  76. data/spec/fixtures/js_export_dir_none.yml +0 -6
  77. data/spec/fixtures/js_extend_parent.yml +0 -6
  78. data/spec/fixtures/js_extend_segment.yml +0 -6
  79. data/spec/fixtures/js_file_per_locale.yml +0 -7
  80. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml +0 -4
  81. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml +0 -6
  82. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml +0 -4
  83. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml +0 -4
  84. data/spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml +0 -4
  85. data/spec/fixtures/js_file_per_locale_without_fallbacks.yml +0 -4
  86. data/spec/fixtures/js_file_with_namespace_prefix_and_pretty_print.yml +0 -9
  87. data/spec/fixtures/js_sort_translation_keys_false.yml +0 -6
  88. data/spec/fixtures/js_sort_translation_keys_true.yml +0 -6
  89. data/spec/fixtures/json_only.yml +0 -18
  90. data/spec/fixtures/locales.yml +0 -133
  91. data/spec/fixtures/merge_plurals.yml +0 -6
  92. data/spec/fixtures/merge_plurals_with_no_overrides.yml +0 -4
  93. data/spec/fixtures/merge_plurals_with_partial_overrides.yml +0 -4
  94. data/spec/fixtures/millions.yml +0 -4
  95. data/spec/fixtures/multiple_conditions.yml +0 -7
  96. data/spec/fixtures/multiple_conditions_per_locale.yml +0 -7
  97. data/spec/fixtures/multiple_files.yml +0 -7
  98. data/spec/fixtures/no_config.yml +0 -2
  99. data/spec/fixtures/no_scope.yml +0 -4
  100. data/spec/fixtures/simple_scope.yml +0 -5
  101. data/spec/js/currency.spec.js +0 -62
  102. data/spec/js/current_locale.spec.js +0 -19
  103. data/spec/js/dates.spec.js +0 -276
  104. data/spec/js/defaults.spec.js +0 -31
  105. data/spec/js/extend.spec.js +0 -110
  106. data/spec/js/interpolation.spec.js +0 -124
  107. data/spec/js/jasmine/MIT.LICENSE +0 -20
  108. data/spec/js/jasmine/jasmine-html.js +0 -190
  109. data/spec/js/jasmine/jasmine.css +0 -166
  110. data/spec/js/jasmine/jasmine.js +0 -2476
  111. data/spec/js/jasmine/jasmine_favicon.png +0 -0
  112. data/spec/js/locales.spec.js +0 -31
  113. data/spec/js/localization.spec.js +0 -78
  114. data/spec/js/numbers.spec.js +0 -170
  115. data/spec/js/placeholder.spec.js +0 -24
  116. data/spec/js/pluralization.spec.js +0 -219
  117. data/spec/js/prepare_options.spec.js +0 -41
  118. data/spec/js/require.js +0 -2083
  119. data/spec/js/specs.html +0 -49
  120. data/spec/js/specs_requirejs.html +0 -72
  121. data/spec/js/translate.spec.js +0 -299
  122. data/spec/js/translations.js +0 -172
  123. data/spec/js/utility_functions.spec.js +0 -20
  124. data/spec/ruby/i18n/js/fallback_locales_spec.rb +0 -84
  125. data/spec/ruby/i18n/js/segment_spec.rb +0 -219
  126. data/spec/ruby/i18n/js/utils_spec.rb +0 -106
  127. data/spec/ruby/i18n/js_spec.rb +0 -748
  128. data/spec/spec_helper.rb +0 -79
  129. data/yarn.lock +0 -131
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8b0336b575e1fcbf19bc557cb7fd709db85f8831a842970c03f34517baa90c2
4
- data.tar.gz: 4f86f0c6d7e05b0aeb4b8f7898d5947b6a06dd402593d34c068f98da28ed09ff
3
+ metadata.gz: d07791eb7f9b879e4d5e6edd43d10564a5efad2f44e3ac0ddd2c892696dbd28b
4
+ data.tar.gz: cab23b9274ee26513b48974dd307ad020a1ad3ba88bb36756397d6c47223ffb4
5
5
  SHA512:
6
- metadata.gz: 20f3d107d1e745c7948ff2fa10173712e84bf58894cab7f1d21f58b5c647bf17fb0a664cc2bb4363d3def74898c0a85dda1a8de6c64161400bd1044663a61cc0
7
- data.tar.gz: bc0fa3a90ff5ef2a23c4f084845238564b6c66d9deb96abb79478f719e37e065744cd775b3d8de33765f1d72a266325672b8bcfe95fc1dbd9c0aceb507538d5c
6
+ metadata.gz: 0d0bb95c8e0f01bed11eced7859d6f40d032ca85a03f458d515a4cdcc444a194f315b22db39f0d6956c45951a1cf8e3e28ab06a11abb6165ca7dc5d6fa07baa1
7
+ data.tar.gz: a7afe30f6f81a9b7536cb5be2a26112825bd5324443d9fe7edb43779c6084e2c4d4e439814f4458853a6ffaf540afdfc0640f8be2a7cb428b46c45c83313d0bb
@@ -0,0 +1,4 @@
1
+ # You can read more about CODEOWNERS at
2
+ # https://help.github.com/github/creating-cloning-and-archiving-repositories/about-code-owners
3
+
4
+ * @fnando
@@ -0,0 +1,3 @@
1
+ ---
2
+ github: [fnando]
3
+ custom: ["https://paypal.me/nandovieira/🍕"]
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: "🐛 Bug Report"
3
+ about: Report a reproducible bug or regression.
4
+ title: 'Bug: '
5
+ labels: 'Status: Unconfirmed'
6
+
7
+ ---
8
+
9
+ <!--
10
+ - Please provide a clear and concise description of what the bug is.
11
+ - If possible, add an example reproducing your issue.
12
+ - Please test using the latest version of i18n-js
13
+ to make sure your issue has not already been fixed.
14
+ -->
15
+
16
+ ## Description
17
+
18
+ [Add bug description here]
19
+
20
+ ## How to reproduce
21
+
22
+ [Add steps on how to reproduce this issue]
23
+
24
+ ## What do you expect
25
+
26
+ [Describe what do you expect to happen]
27
+
28
+ ## What happened instead
29
+
30
+ [Describe the actual results]
31
+
32
+ ## Software:
33
+
34
+ - Gem version: [Add gem version here]
35
+ - Ruby version: [Add version here]
36
+
37
+ ## Full backtrace
38
+
39
+ ```text
40
+ [Paste full backtrace here]
41
+ ```
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: "💡 Feature request"
3
+ about: Have an idea that may be useful? Make a suggestion!
4
+ title: 'Feature Request: '
5
+ labels: 'Feature request'
6
+
7
+ ---
8
+
9
+ ## Description
10
+
11
+ _A clear and concise description of what the problem is._
12
+
13
+ ## Describe the solution
14
+
15
+ _A clear and concise description of what you want to happen._
16
+
17
+ ## Alternatives you considered
18
+
19
+ _A clear and concise description of any alternative solutions or features you've considered._
20
+
21
+ ## Additional context
22
+
23
+ _Add any other context, screenshots, links, etc about the feature request here._
@@ -0,0 +1,38 @@
1
+ <!--
2
+ If you're making a doc PR or something tiny where the below is irrelevant,
3
+ delete this template and use a short description, but in your description aim to
4
+ include both what the change is, and why it is being made, with enough context
5
+ for anyone to understand.
6
+ -->
7
+
8
+ <details>
9
+ <summary>PR Checklist</summary>
10
+
11
+ ### PR Structure
12
+
13
+ - [ ] This PR has reasonably narrow scope (if not, break it down into smaller
14
+ PRs).
15
+ - [ ] This PR avoids mixing refactoring changes with feature changes (split into
16
+ two PRs otherwise).
17
+ - [ ] This PR's title starts is concise and descriptive.
18
+
19
+ ### Thoroughness
20
+
21
+ - [ ] This PR adds tests for the most critical parts of the new functionality or
22
+ fixes.
23
+ - [ ] I've updated any docs, `.md` files, etc… affected by this change.
24
+
25
+ </details>
26
+
27
+ ### What
28
+
29
+ [TODO: Short statement about what is changing.]
30
+
31
+ ### Why
32
+
33
+ [TODO: Why this change is being made. Include any context required to understand
34
+ the why.]
35
+
36
+ ### Known limitations
37
+
38
+ [TODO or N/A]
@@ -0,0 +1,15 @@
1
+ ---
2
+ # Documentation:
3
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
4
+
5
+ version: 2
6
+ updates:
7
+ - package-ecosystem: "github-actions"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "daily"
11
+
12
+ - package-ecosystem: "bundler"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "daily"
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: ruby-tests
3
+
4
+ on:
5
+ pull_request:
6
+ branches:
7
+ - main
8
+
9
+ push:
10
+ branches:
11
+ - main
12
+ - v4
13
+
14
+ schedule:
15
+ - cron: "0 10 * * *"
16
+
17
+ workflow_dispatch:
18
+ inputs: {}
19
+
20
+ jobs:
21
+ build:
22
+ name: Tests with Ruby ${{ matrix.ruby }} and ${{ matrix.gemfile }}
23
+ runs-on: "ubuntu-latest"
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ ruby: [2.6.x, 2.7.x, 3.0.x]
28
+ gemfile:
29
+ - Gemfile
30
+
31
+ steps:
32
+ - uses: actions/checkout@v1
33
+
34
+ - uses: actions/cache@v2
35
+ with:
36
+ path: vendor/bundle
37
+ key: >
38
+ ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
39
+ hashFiles(matrix.gemfile) }}
40
+ restore-keys: >
41
+ ${{ runner.os }}-${{ matrix.ruby }}-gems-${{
42
+ hashFiles(matrix.gemfile) }}
43
+
44
+ - name: Set up Ruby
45
+ uses: actions/setup-ruby@v1
46
+ with:
47
+ ruby-version: ${{ matrix.ruby }}
48
+
49
+ - name: Install gem dependencies
50
+ env:
51
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
52
+ run: |
53
+ gem install bundler
54
+ bundle config path vendor/bundle
55
+ bundle update --jobs 4 --retry 3
56
+
57
+ - name: Run Tests
58
+ env:
59
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
60
+ run: |
61
+ bundle exec rake
data/.gitignore CHANGED
@@ -1,7 +1,11 @@
1
- pkg
2
- node_modules
3
- Gemfile.lock
4
- .idea/
5
- coverage/
6
- gemfiles/*.gemfile.lock
7
- gemfiles/.bundle
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /vendor/
10
+ *.log
11
+ *.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ ---
2
+ inherit_gem:
3
+ rubocop-fnando: .rubocop.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.6
7
+ NewCops: enable
8
+
9
+ Naming/FileName:
10
+ Exclude:
11
+ - lib/i18n-js.rb
12
+ - lib/guard/i18n-js.rb
data/CHANGELOG.md CHANGED
@@ -1,499 +1,16 @@
1
- # Change Log
2
- All notable changes to this project will be documented in this file.
3
- This project adheres to [Semantic Versioning](http://semver.org/).
1
+ # Changelog
4
2
 
3
+ <!--
4
+ Prefix your message with one of the following:
5
5
 
6
- ## [Unreleased]
6
+ - [Added] for new features.
7
+ - [Changed] for changes in existing functionality.
8
+ - [Deprecated] for soon-to-be removed features.
9
+ - [Removed] for now removed features.
10
+ - [Fixed] for any bug fixes.
11
+ - [Security] in case of vulnerabilities.
12
+ -->
7
13
 
8
- ### Added
14
+ ## Unreleased
9
15
 
10
- - Nothing
11
-
12
- ### Changed
13
-
14
- - Nothing
15
-
16
- ### Fixed
17
-
18
- - Nothing
19
-
20
-
21
- ## [3.7.1] - 2020-06-30
22
-
23
- ### Fixed
24
-
25
- - [JS] For translation missing behaviour `guess`, replace all underscores to spaces properly
26
- (PR: https://github.com/fnando/i18n-js/pull/574)
27
-
28
-
29
- ## [3.7.0] - 2020-05-29
30
-
31
- ### Added
32
-
33
- - [JS] Allow options to be passed in when calling `I18n.localize`/`I18n.l`
34
- (PR: https://github.com/fnando/i18n-js/pull/570)
35
-
36
-
37
- ## [3.6.0] - 2020-02-14
38
-
39
- ### Added
40
-
41
- - [Ruby] Allow `suffix` to be added to generated translations files
42
- (PR: https://github.com/fnando/i18n-js/pull/561)
43
-
44
-
45
- ## [3.5.1] - 2019-12-21
46
-
47
- ### Changed
48
-
49
- - [JS] Bound shortcut functions
50
- (PR: https://github.com/fnando/i18n-js/pull/560)
51
-
52
-
53
- ## [3.5.0] - 2019-11-12
54
-
55
- ### Added
56
-
57
- - [JS] Support for `%k` strftime format to match Ruby strftime
58
- (PR: https://github.com/fnando/i18n-js/pull/554)
59
-
60
-
61
- ## [3.4.2] - 2019-11-11
62
-
63
- ### Fixed
64
-
65
- - [Ruby] Fix regression introduced in PR #551
66
- (PR: https://github.com/fnando/i18n-js/pull/555)
67
-
68
-
69
- ## [3.4.1] - 2019-11-01
70
-
71
- ### Fixed
72
-
73
- - [Ruby] Fix merging of plural keys to work with fallbacks that aren't overridden
74
- (PR: https://github.com/fnando/i18n-js/pull/551)
75
-
76
-
77
- ## [3.4.0] - 2019-10-15
78
-
79
- ### Added
80
-
81
- - [Ruby] Allow `prefix` to be added to generated translations files
82
- (PR: https://github.com/fnando/i18n-js/pull/549)
83
-
84
-
85
- ## [3.3.0] - 2019-06-06
86
-
87
- ### Added
88
-
89
- - [JS] Support for `%P`, `%Z`, and `%l` strftime formats to match Ruby strftime
90
- (PR: https://github.com/fnando/i18n-js/pull/537)
91
-
92
-
93
- ## [3.2.3] - 2019-05-24
94
-
95
- ### Changed
96
-
97
- - [Ruby] Allow rails 6 to be used with this gem
98
- (PR: https://github.com/fnando/i18n-js/pull/536)
99
-
100
-
101
- ## [3.2.2] - 2019-05-09
102
-
103
- ### Fixed
104
-
105
- - [JS] Return invalid date/time input values (null & undefined) as-is
106
- (Commit: https://github.com/fnando/i18n-js/commit/869d1689ed788ff50121de492db354652971c23d)
107
-
108
-
109
- ## [3.2.1] - 2019-01-22
110
-
111
- ### Changed
112
-
113
- - [Ruby] `json_only` option should allow multiple locales.
114
- (PR: https://github.com/fnando/i18n-js/pull/531)
115
- - [Ruby] Simplified and cleaned code related to JS/JSON formatting.
116
- (PR: https://github.com/fnando/i18n-js/pull/531)
117
- - [JS] Use strict value comparison
118
-
119
- ### Fixed
120
-
121
- - [Ruby] Relax `i18n` version requirement back to `>= 0.6.6`
122
- (PR: https://github.com/fnando/i18n-js/pull/530)
123
- - [Ruby] Fix merging of plural keys across locales.
124
- (PR: https://github.com/fnando/i18n-js/pull/472)
125
-
126
-
127
- ## [3.2.0] - 2018-11-16
128
-
129
- ### Added
130
-
131
- - [Ruby] Add option `json_only` to generate translations in JSON
132
- (PR: https://github.com/fnando/i18n-js/pull/524)
133
-
134
- ### Changed
135
-
136
- - [Ruby] Requires `i18n` to be `>= 0.8.0` for CVE-2014-10077
137
-
138
-
139
- ## [3.1.0] - 2018-11-01
140
-
141
- ### Added
142
-
143
- - [Ruby] Add option to allow setting a different I18n backend
144
- (PR: https://github.com/fnando/i18n-js/pull/519)
145
-
146
- ### Fixed
147
-
148
- - [JS] Fix missing translation when pluralizing with default scopes
149
- (PR: https://github.com/fnando/i18n-js/pull/516)
150
-
151
-
152
- ## [3.0.11] - 2018-07-06
153
-
154
- ### Fixed
155
-
156
- - [JS] Fix interpolation for array with non string/null elements
157
- (PR: https://github.com/fnando/i18n-js/pull/505)
158
-
159
-
160
- ## [3.0.10] - 2018-06-21
161
-
162
- ### Fixed
163
-
164
- - [JS] Fix extend method changing keys with `null` to empty objects
165
- (PR: https://github.com/fnando/i18n-js/pull/503)
166
- - [JS] Fix variable name in an internal method
167
- (PR: https://github.com/fnando/i18n-js/pull/501)
168
-
169
-
170
- ## [3.0.9] - 2018-06-21
171
-
172
- ### Fixed
173
-
174
- - [JS] Fix translation array interpolation for array with null
175
-
176
-
177
- ## [3.0.8] - 2018-06-06
178
-
179
- ### Changed
180
-
181
- - [JS] Interpolate translation array too
182
- (PR: https://github.com/fnando/i18n-js/pull/498)
183
-
184
-
185
- ## [3.0.7] - 2018-05-30
186
-
187
- ### Fixed
188
-
189
- - [Ruby] Fix new bug occuring when config file is absent
190
-
191
-
192
- ## [3.0.6] - 2018-05-30
193
-
194
- ### Fixed
195
-
196
- - [Ruby] Make JS `i18n/filtered` depends on i18n-js config too
197
- (PR: https://github.com/fnando/i18n-js/pull/497)
198
-
199
-
200
- ## [3.0.5] - 2018-02-26
201
-
202
- ### Changed
203
-
204
- - [Ruby] Support `I18n` `1.0.x`
205
- (PR: https://github.com/fnando/i18n-js/pull/492)
206
-
207
-
208
- ## [3.0.4] - 2018-01-26
209
-
210
- ### Fixed
211
-
212
- - [Ruby] Fix `JS::Dependencies.using_asset_pipeline?` returning true when sprockets installed but disabled
213
- (PR: https://github.com/fnando/i18n-js/pull/488)
214
-
215
-
216
- ## [3.0.3] - 2018-01-02
217
-
218
- ### Fixed
219
-
220
- - [Ruby] Fix extend method when translations has array values
221
- (PR: https://github.com/fnando/i18n-js/pull/487)
222
-
223
-
224
- ## [3.0.2] - 2017-10-26
225
-
226
- ### Changed
227
-
228
- - [Ruby] Avoid writing new file if a file with same content already exists
229
- (PR: https://github.com/fnando/i18n-js/pull/473)
230
- - [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
231
- It was falling back to `zh` first instead of `zh-Hant` (see new test case added)
232
- (PR: https://github.com/fnando/i18n-js/pull/475)
233
-
234
-
235
- ## [3.0.1] - 2017-08-02
236
-
237
- ### Changed
238
-
239
- - [Ruby] Relax Rails detection code to work with alternative installation methods
240
- (PR: https://github.com/fnando/i18n-js/pull/467)
241
- - [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
242
- It fallbacks to `zh` only before, now it fallbacks to `zh-Hant`
243
- (PR: https://github.com/fnando/i18n-js/pull/465)
244
-
245
-
246
- ## [3.0.0] - 2017-04-01
247
-
248
- This is a fake official release, the *real* one will be `3.0.0.rc17`
249
- And today is not April Fools' Day
250
-
251
- ### Fixed
252
-
253
- - Ends the longest Release Candidate period among all ruby gems
254
- (v3.0.0.rc1 released at 2012-05-10)
255
-
256
-
257
- ## [3.0.0.rc16] - 2017-03-13
258
-
259
- ### Changed
260
-
261
- - [Ruby] Drop support for Ruby < `2.1.0`
262
-
263
- ### Fixed
264
-
265
- - [JS] Make defaultValue works on plural translation
266
- - [JS] Fix UMD pattern so the global/root won’t be undefined
267
-
268
-
269
- ## [3.0.0.rc15] - 2016-12-07
270
-
271
- ### Added
272
-
273
- - Nothing
274
-
275
- ### Changed
276
-
277
- - [JS] Allow `defaultValue` to work in pluralization
278
- (PR: https://github.com/fnando/i18n-js/pull/433)
279
- - [Ruby] Stop validating the fallback locales against `I18n.available_locales`
280
- This allows some locales to be used as fallback locales, but not to be generated in JS.
281
- (PR: https://github.com/fnando/i18n-js/pull/425)
282
- - [Ruby] Remove dependency on gem `activesupport`
283
-
284
- ### Fixed
285
-
286
- - [JS] Stop converting numeric & boolean values into objects
287
- when merging objects with `I18n.extend`
288
- (PR: https://github.com/fnando/i18n-js/pull/420)
289
- - [JS] Fix I18n pluralization fallback when tree is empty
290
- (PR: https://github.com/fnando/i18n-js/pull/435)
291
- - [Ruby] Use old syntax to define lambda for compatibility with older Rubies
292
- (Issue: https://github.com/fnando/i18n-js/issues/419)
293
- - [Ruby] Fix error raised in middleware cache cleaning in parallel test
294
- (Issue: https://github.com/fnando/i18n-js/issues/436)
295
-
296
-
297
- ## [3.0.0.rc14] - 2016-08-29
298
-
299
- ### Changed
300
-
301
- - [JS] Method `I18n.extend()` behave as deep merging instead of shallow merging. (https://github.com/fnando/i18n-js/pull/416)
302
- - [Ruby] Use object/class instead of block when registering Sprockets preprocessor (https://github.com/fnando/i18n-js/pull/418)
303
- To ensure that your cache will expire properly based on locale file content after upgrading,
304
- you should run `rake assets:clobber` and/or other rake tasks that clear the asset cache once gem updated
305
- - [Ruby] Detect & support rails 5 (https://github.com/fnando/i18n-js/pull/413)
306
-
307
-
308
- ## [3.0.0.rc13] - 2016-06-29
309
-
310
- ### Added
311
-
312
- - [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))
313
-
314
- ### Changed
315
-
316
- - Nothing
317
-
318
- ### Fixed
319
-
320
- - [JS] Initialize option `missingBehaviour` & `missingTranslationPrefix` with default values ([#398](https://github.com/fnando/i18n-js/pull/398))
321
- - [JS] Throw an error when `I18n.strftime()` takes an invalid date ([#383](https://github.com/fnando/i18n-js/pull/383))
322
- - [JS] Fix default error message when translation missing to consider locale passed in options
323
- - [Ruby] Reset middleware cache on rails startup
324
- ([#402](https://github.com/fnando/i18n-js/pull/402))
325
-
326
-
327
- ## [3.0.0.rc12] - 2015-12-30
328
-
329
- ### Added
330
-
331
- - [JS] Allow extending of translation files ([#354](https://github.com/fnando/i18n-js/pull/354))
332
- - [JS] Allow missingPlaceholder to receive extra data for debugging ([#380](https://github.com/fnando/i18n-js/pull/380))
333
-
334
- ### Changed
335
-
336
- - Nothing
337
-
338
- ### Fixed
339
-
340
- - [Ruby] Fix of missing initializer at sprockets. ([#371](https://github.com/fnando/i18n-js/pull/371))
341
- - [Ruby] Use proper method to register preprocessor documented by sprockets-rails. ([#376](https://github.com/fnando/i18n-js/pull/376))
342
- - [JS] Correctly round unprecise floating point numbers.
343
- - [JS] Ensure objects are recognized when passed in from an iframe. ([#375](https://github.com/fnando/i18n-js/pull/375))
344
-
345
-
346
- ## 3.0.0.rc11
347
-
348
- ### breaking changes
349
-
350
- ### enhancements
351
-
352
- ### bug fixes
353
-
354
- - [Ruby] Handle fallback locale without any translation properly ([#338](https://github.com/fnando/i18n-js/pull/338))
355
- - [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))
356
-
357
-
358
- ## 3.0.0.rc10
359
-
360
- ### breaking changes
361
-
362
- - [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))
363
- - [Ruby] The `:except` option to exclude certain phrases now (only) accepts the same patterns the `:only` option accepts
364
-
365
- ### enhancements
366
-
367
- - [Ruby] Make handling of per-locale and not-per-locale exporting to be more consistent ([#320](https://github.com/fnando/i18n-js/pull/320))
368
- - [Ruby] Add option `sort_translation_keys` to sort translation keys alphabetically ([#318](https://github.com/fnando/i18n-js/pull/318))
369
-
370
- ### bug fixes
371
-
372
- - [Ruby] Fix fallback logic to work with not-per-locale files ([#320](https://github.com/fnando/i18n-js/pull/320))
373
-
374
-
375
- ## 3.0.0.rc9
376
-
377
- ### enhancements
378
-
379
- - [JS] Force currency number sign to be at first place using `sign_first` option, default to `true`
380
- - [Ruby] Add option `namespace` & `pretty_print` ([#300](https://github.com/fnando/i18n-js/pull/300))
381
- - [Ruby] Add option `export_i18n_js` ([#301](https://github.com/fnando/i18n-js/pull/301))
382
- - [Ruby] Now the gem also detects pre-release versions of `rails`
383
- - [Ruby] Add `:except` option to exclude certain phrases or groups of phrases from the
384
- outputted translations ([#312](https://github.com/fnando/i18n-js/pull/312))
385
- - [JS] You can now set `I18n.missingBehavior='guess'` to have the scope string output as text instead of of the
386
- "[missing `scope`]" message when no translation is available.
387
- Combined that with `I18n.missingTranslationPrefix='SOMETHING'` and you can
388
- still identify those missing strings.
389
- ([#304](https://github.com/fnando/i18n-js/pull/304))
390
-
391
- ### bug fixes
392
-
393
- - [JS] Fix missing translation message when scope is passed in options
394
- - [Ruby] Fix save cache directory verification when path is a symbolic link ([#329](https://github.com/fnando/i18n-js/pull/329))
395
-
396
-
397
- ## 3.0.0.rc8
398
-
399
- ### enhancements
400
-
401
- - Add support for loading via AMD and CommonJS module loaders ([#266](https://github.com/fnando/i18n-js/pull/266))
402
- - Add `I18n.nullPlaceholder`
403
- Defaults to I18n.missingPlaceholder (`[missing {{name}} value]`)
404
- Set to `function() {return "";}` to match Ruby `I18n.t("name: %{name}", name: nil)`
405
- - For date formatting, you can now also add placeholders to the date format, see README for detail
406
- - Add fallbacks option to `i18n-js.yml`, defaults to `true`
407
-
408
- ### bug fixes
409
-
410
- - Fix factory initialization so that the Node/CommonJS branch only gets executed if the environment is Node/CommonJS
411
- (it currently will execute if module is defined in the global scope, which occurs with QUnit, for example)
412
- - 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))
413
- - Remove check for `Rails.configuration.assets.compile` before telling Sprockets the dependency of translations JS file
414
- This might be the reason of many "cache not expired" issues
415
- Discovered/reported in #277
416
-
417
- ## 3.0.0.rc7
418
-
419
- ### enhancements
420
-
421
- - The Rails Engine initializer is now named as `i18n-js.register_preprocessor` (https://github.com/fnando/i18n-js/pull/261)
422
- - Rename `I18n::JS.config_file` to `I18n::JS.config_file_path` and make it configurable
423
- Expected a `String`, default is still `config/i18n-js.yml`
424
- - When running `rake i18n:js:export`, the `i18n.js` will also be exported to `I18n::JS.export_i18n_js_dir_path` by default
425
- - Add `I18n::JS.export_i18n_js_dir_path`
426
- Expected a `String`, default is `public/javascripts`
427
- Set to `nil` will disable exporting `i18n.js`
428
-
429
- ### bug fixes
430
-
431
- - Prevent toString() call on `undefined` when there is a missing interpolation value
432
- - Added support for Rails instances without Sprockets object (https://github.com/fnando/i18n-js/pull/241)
433
- - Fix `DEFAULT_OPTIONS` in `i18n.js` which contained an excessive comma
434
- - Fix `nil` values are exported into JS files which causes strange translation error
435
- - Fix pattern to replace all escaped $ in I18n.translate
436
- - Fix JS `I18n.lookup` modifies existing locales accidentally
437
-
438
- ## 3.0.0.rc6
439
-
440
- ### enhancements
441
-
442
- - You can now assign `I18n.locale` & `I18n.default_locale` before loading `i18n.js` in `application.html.*`
443
- (merged to `i18n-js-pika` already)
444
- - You can include ERB in `config/i18n-js.yml`(https://github.com/fnando/i18n-js/pull/224)
445
- - Add support for +00:00 style time zone designator (https://github.com/fnando/i18n-js/pull/167)
446
- - Add back rake task for export (`rake i18n:js:export`)
447
- - Not overriding translation when manually run `I18n::JS.export` (https://github.com/fnando/i18n-js/pull/171)
448
- - Move missing placeholder text generation into its own function (for easier debugging) (https://github.com/fnando/i18n-js/pull/169)
449
- - Add support for milliseconds (`lll` in `yyyy-mm-ddThh:mm:ss.lllZ`) (https://github.com/fnando/i18n-js/pull/192)
450
- - Add back i18n-js.yml config file generator : `rails generate i18n:js:config` (https://github.com/fnando/i18n-js/pull/225)
451
-
452
- ### bug fixes
453
-
454
- - `I18n::JS.export` no longer exports locales other than those in `I18n.available_locales`, if `I18n.available_locales` is set
455
- - I18.t supports the base scope through the options argument
456
- - I18.t accepts an array as the scope
457
- - Fix regression: asset not being reloaded in development when translation changed
458
- - Requires `i18n` to be `~> 0.6`, `0.5` does not work at all
459
- - Fix using multi-star scope with top-level translation key (https://github.com/fnando/i18n-js/pull/221)
460
-
461
-
462
- ## Before 3.0.0.rc5
463
-
464
- - Things happened.
465
-
466
-
467
-
468
- [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.7.1...HEAD
469
- [3.7.1]: https://github.com/fnando/i18n-js/compare/v3.7.0...v3.7.1
470
- [3.7.0]: https://github.com/fnando/i18n-js/compare/v3.6.0...v3.7.0
471
- [3.6.0]: https://github.com/fnando/i18n-js/compare/v3.5.1...v3.6.0
472
- [3.5.1]: https://github.com/fnando/i18n-js/compare/v3.5.0...v3.5.1
473
- [3.5.0]: https://github.com/fnando/i18n-js/compare/v3.4.2...v3.5.0
474
- [3.4.2]: https://github.com/fnando/i18n-js/compare/v3.4.1...v3.4.2
475
- [3.4.1]: https://github.com/fnando/i18n-js/compare/v3.4.0...v3.4.1
476
- [3.4.0]: https://github.com/fnando/i18n-js/compare/v3.3.0...v3.4.0
477
- [3.3.0]: https://github.com/fnando/i18n-js/compare/v3.2.3...v3.3.0
478
- [3.2.3]: https://github.com/fnando/i18n-js/compare/v3.2.2...v3.2.3
479
- [3.2.2]: https://github.com/fnando/i18n-js/compare/v3.2.1...v3.2.2
480
- [3.2.1]: https://github.com/fnando/i18n-js/compare/v3.2.0...v3.2.1
481
- [3.2.0]: https://github.com/fnando/i18n-js/compare/v3.1.0...v3.2.0
482
- [3.1.0]: https://github.com/fnando/i18n-js/compare/v3.0.11...v3.1.0
483
- [3.0.11]: https://github.com/fnando/i18n-js/compare/v3.0.10...v3.0.11
484
- [3.0.10]: https://github.com/fnando/i18n-js/compare/v3.0.9...v3.0.10
485
- [3.0.9]: https://github.com/fnando/i18n-js/compare/v3.0.8...v3.0.9
486
- [3.0.8]: https://github.com/fnando/i18n-js/compare/v3.0.7...v3.0.8
487
- [3.0.7]: https://github.com/fnando/i18n-js/compare/v3.0.6...v3.0.7
488
- [3.0.6]: https://github.com/fnando/i18n-js/compare/v3.0.5...v3.0.6
489
- [3.0.5]: https://github.com/fnando/i18n-js/compare/v3.0.4...v3.0.5
490
- [3.0.4]: https://github.com/fnando/i18n-js/compare/v3.0.3...v3.0.4
491
- [3.0.3]: https://github.com/fnando/i18n-js/compare/v3.0.2...v3.0.3
492
- [3.0.2]: https://github.com/fnando/i18n-js/compare/v3.0.1...v3.0.2
493
- [3.0.1]: https://github.com/fnando/i18n-js/compare/v3.0.0...v3.0.1
494
- [3.0.0]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc16...v3.0.0
495
- [3.0.0.rc16]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc15...v3.0.0.rc16
496
- [3.0.0.rc15]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc14...v3.0.0.rc15
497
- [3.0.0.rc14]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc13...v3.0.0.rc14
498
- [3.0.0.rc13]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc12...v3.0.0.rc13
499
- [3.0.0.rc12]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc11...v3.0.0.rc12
16
+ - Initial release.