i18n-js 2.1.2 → 3.0.11
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.
- checksums.yaml +7 -0
- data/.editorconfig +24 -0
- data/.gitignore +5 -4
- data/.npmignore +27 -0
- data/.travis.yml +37 -0
- data/Appraisals +20 -0
- data/CHANGELOG.md +354 -0
- data/Gemfile +1 -1
- data/README.md +872 -0
- data/Rakefile +19 -7
- data/app/assets/javascripts/i18n/filtered.js.erb +23 -0
- data/app/assets/javascripts/i18n/shims.js +208 -0
- data/app/assets/javascripts/i18n/translations.js +3 -0
- data/app/assets/javascripts/i18n.js +1077 -0
- data/gemfiles/i18n_0_6.gemfile +7 -0
- data/gemfiles/i18n_0_7.gemfile +7 -0
- data/gemfiles/i18n_0_8.gemfile +7 -0
- data/gemfiles/i18n_0_9.gemfile +7 -0
- data/gemfiles/i18n_1_0.gemfile +7 -0
- data/i18n-js.gemspec +11 -9
- data/lib/i18n/js/dependencies.rb +59 -0
- data/lib/i18n/js/engine.rb +87 -0
- data/lib/i18n/js/fallback_locales.rb +70 -0
- data/lib/{i18n-js → i18n/js}/middleware.rb +32 -9
- data/lib/i18n/js/private/hash_with_symbol_keys.rb +36 -0
- data/lib/i18n/js/segment.rb +88 -0
- data/lib/i18n/js/utils.rb +52 -0
- data/lib/i18n/js/version.rb +7 -0
- data/lib/i18n/js.rb +242 -0
- data/lib/i18n-js.rb +1 -177
- data/lib/rails/generators/i18n/js/config/config_generator.rb +19 -0
- data/{config → lib/rails/generators/i18n/js/config/templates}/i18n-js.yml +11 -6
- data/lib/tasks/export.rake +8 -0
- data/package.json +25 -0
- data/spec/fixtures/custom_path.yml +5 -0
- data/spec/fixtures/default.yml +5 -0
- data/spec/fixtures/erb.yml +5 -0
- data/spec/fixtures/except_condition.yml +7 -0
- data/spec/fixtures/js_export_dir_custom.yml +7 -0
- data/spec/fixtures/js_export_dir_none.yml +6 -0
- data/spec/fixtures/js_extend_parent.yml +6 -0
- data/spec/fixtures/js_extend_segment.yml +6 -0
- data/spec/fixtures/js_file_per_locale.yml +7 -0
- data/spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml +4 -0
- data/spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml +6 -0
- data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml +4 -0
- data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml +4 -0
- data/spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml +4 -0
- data/spec/fixtures/js_file_per_locale_without_fallbacks.yml +4 -0
- data/spec/fixtures/js_file_with_namespace_and_pretty_print.yml +7 -0
- data/spec/fixtures/js_sort_translation_keys_false.yml +6 -0
- data/spec/fixtures/js_sort_translation_keys_true.yml +6 -0
- data/spec/{resources → fixtures}/locales.yml +13 -1
- data/spec/fixtures/multiple_conditions.yml +7 -0
- data/spec/fixtures/multiple_conditions_per_locale.yml +7 -0
- data/spec/fixtures/multiple_files.yml +7 -0
- data/spec/{resources → fixtures}/no_config.yml +0 -0
- data/spec/fixtures/no_scope.yml +4 -0
- data/spec/fixtures/simple_scope.yml +5 -0
- data/spec/js/currency.spec.js +62 -0
- data/spec/js/current_locale.spec.js +19 -0
- data/spec/js/dates.spec.js +265 -0
- data/spec/js/defaults.spec.js +31 -0
- data/spec/js/extend.spec.js +110 -0
- data/spec/js/interpolation.spec.js +124 -0
- data/spec/js/jasmine/MIT.LICENSE +20 -0
- data/spec/js/jasmine/jasmine-html.js +190 -0
- data/spec/js/jasmine/jasmine.css +166 -0
- data/spec/js/jasmine/jasmine.js +2476 -0
- data/spec/js/jasmine/jasmine_favicon.png +0 -0
- data/spec/js/locales.spec.js +31 -0
- data/spec/js/localization.spec.js +48 -0
- data/spec/js/numbers.spec.js +170 -0
- data/spec/js/placeholder.spec.js +24 -0
- data/spec/js/pluralization.spec.js +211 -0
- data/spec/js/prepare_options.spec.js +41 -0
- data/spec/js/require.js +2083 -0
- data/spec/js/specs.html +49 -0
- data/spec/js/specs_requirejs.html +72 -0
- data/spec/js/translate.spec.js +277 -0
- data/spec/js/translations.js +164 -0
- data/spec/js/utility_functions.spec.js +20 -0
- data/spec/ruby/i18n/js/fallback_locales_spec.rb +84 -0
- data/spec/ruby/i18n/js/segment_spec.rb +157 -0
- data/spec/ruby/i18n/js/utils_spec.rb +106 -0
- data/spec/ruby/i18n/js_spec.rb +627 -0
- data/spec/spec_helper.rb +55 -14
- data/yarn.lock +131 -0
- metadata +188 -96
- data/.rspec +0 -1
- data/Gemfile.lock +0 -51
- data/README.rdoc +0 -305
- data/lib/i18n-js/engine.rb +0 -62
- data/lib/i18n-js/railtie.rb +0 -13
- data/lib/i18n-js/rake.rb +0 -16
- data/lib/i18n-js/version.rb +0 -10
- data/spec/i18n_spec.js +0 -768
- data/spec/i18n_spec.rb +0 -205
- data/spec/resources/custom_path.yml +0 -4
- data/spec/resources/default.yml +0 -4
- data/spec/resources/js_file_per_locale.yml +0 -3
- data/spec/resources/multiple_conditions.yml +0 -6
- data/spec/resources/multiple_files.yml +0 -6
- data/spec/resources/no_scope.yml +0 -3
- data/spec/resources/simple_scope.yml +0 -4
- data/vendor/assets/javascripts/i18n/translations.js.erb +0 -7
- data/vendor/assets/javascripts/i18n.js +0 -450
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7710293eab5e7adff0b04ffe9183dd61ab18c70e93d75a4680570e8da83deb81
|
4
|
+
data.tar.gz: 8111e523870314db2f1aa49c305797ad1876523fccb9276fc8bd98c2b1a3bff5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a7f2f4b3b52dbd1528b5dde88292a4b44401c58d59d7a41da253961948ae9c7d2c1233bac4fba8208d5391e9ea6397ed019f1dda3034c89eab9774b9a86b8c3b
|
7
|
+
data.tar.gz: 11be532db0104cec86932f67776754ba7f885c3f00f0335d130ebd8844abcb6fb30703b96e6e9a9827099548166963b642d5bee0f9f687ebd5e24c5598ce6971
|
data/.editorconfig
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# EditorConfig is awesome: http://EditorConfig.org
|
2
|
+
|
3
|
+
# top-most EditorConfig file
|
4
|
+
root = true
|
5
|
+
|
6
|
+
# default configuration
|
7
|
+
[*]
|
8
|
+
indent_style = space
|
9
|
+
indent_size = 2
|
10
|
+
insert_final_newline = true
|
11
|
+
trim_trailing_whitespace = true
|
12
|
+
|
13
|
+
# Unix-style newlines with a newline ending every file
|
14
|
+
end_of_line = lf
|
15
|
+
|
16
|
+
# Set default charset
|
17
|
+
charset = utf-8
|
18
|
+
|
19
|
+
# Tab indentation (no size specified)
|
20
|
+
[Makefile]
|
21
|
+
indent_style = tab
|
22
|
+
|
23
|
+
[*.{md,markdown}]
|
24
|
+
trim_trailing_whitespace = false
|
data/.gitignore
CHANGED
data/.npmignore
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
|
2
|
+
|
3
|
+
# tests
|
4
|
+
spec
|
5
|
+
coverage
|
6
|
+
|
7
|
+
# build tools
|
8
|
+
.travis.yml
|
9
|
+
|
10
|
+
# linters
|
11
|
+
.jscsrc
|
12
|
+
.jshintrc
|
13
|
+
.eslintrc*
|
14
|
+
|
15
|
+
# editor settings
|
16
|
+
.idea
|
17
|
+
.editorconfig
|
18
|
+
|
19
|
+
# Ruby code
|
20
|
+
app/assets/javascripts/i18n/
|
21
|
+
gemfiles
|
22
|
+
lib
|
23
|
+
Gemfile*
|
24
|
+
*.gemspec
|
25
|
+
Rakefile
|
26
|
+
Appraisals
|
27
|
+
|
data/.travis.yml
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Send builds to container-based infrastructure
|
2
|
+
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
|
3
|
+
sudo: false
|
4
|
+
language: ruby
|
5
|
+
cache:
|
6
|
+
bundler: true
|
7
|
+
yarn: true
|
8
|
+
directories:
|
9
|
+
- node_modules
|
10
|
+
rvm:
|
11
|
+
- 2.1.10
|
12
|
+
- 2.2.8
|
13
|
+
# Since the Travis Build Env does not recognize `2.3` alias yet
|
14
|
+
# We need to specify the version precisely
|
15
|
+
- 2.3.6
|
16
|
+
- 2.4.3
|
17
|
+
- 2.5.0
|
18
|
+
- ruby-head
|
19
|
+
before_install:
|
20
|
+
# Need to install something extra to test JS
|
21
|
+
- yarn install
|
22
|
+
# Bundler 1.16.1 and rubygems 2.7.3 got issue
|
23
|
+
# https://github.com/travis-ci/travis-ci/issues/8978#issuecomment-354036443
|
24
|
+
- gem update --system
|
25
|
+
gemfile:
|
26
|
+
- gemfiles/i18n_0_6.gemfile
|
27
|
+
- gemfiles/i18n_0_7.gemfile
|
28
|
+
- gemfiles/i18n_0_8.gemfile
|
29
|
+
- gemfiles/i18n_0_9.gemfile
|
30
|
+
- gemfiles/i18n_1_0.gemfile
|
31
|
+
matrix:
|
32
|
+
fast_finish: true
|
33
|
+
allow_failures:
|
34
|
+
- rvm: ruby-head
|
35
|
+
notifications:
|
36
|
+
webhooks: https://www.travisbuddy.com/
|
37
|
+
on_success: never
|
data/Appraisals
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
appraise "i18n_0_6" do
|
3
|
+
gem "i18n", "~> 0.6.0", ">= 0.6.6"
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise "i18n_0_7" do
|
7
|
+
gem "i18n", "~> 0.7.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
appraise "i18n_0_8" do
|
11
|
+
gem "i18n", "~> 0.8.0"
|
12
|
+
end
|
13
|
+
|
14
|
+
appraise "i18n_0_9" do
|
15
|
+
gem "i18n", "~> 0.9.0"
|
16
|
+
end
|
17
|
+
|
18
|
+
appraise "i18n_1_0" do
|
19
|
+
gem "i18n", "~> 1.0.0"
|
20
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,354 @@
|
|
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/).
|
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.0.11] - 2018-07-06
|
22
|
+
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- [JS] Fix interpolation for array with non string/null elements
|
26
|
+
(PR: https://github.com/fnando/i18n-js/pull/505)
|
27
|
+
|
28
|
+
|
29
|
+
## [3.0.10] - 2018-06-21
|
30
|
+
|
31
|
+
### Fixed
|
32
|
+
|
33
|
+
- [JS] Fix extend method changing keys with `null` to empty objects
|
34
|
+
(PR: https://github.com/fnando/i18n-js/pull/503)
|
35
|
+
- [JS] Fix variable name in an internal method
|
36
|
+
(PR: https://github.com/fnando/i18n-js/pull/501)
|
37
|
+
|
38
|
+
|
39
|
+
## [3.0.9] - 2018-06-21
|
40
|
+
|
41
|
+
### Fixed
|
42
|
+
|
43
|
+
- [JS] Fix translation array interpolation for array with null
|
44
|
+
|
45
|
+
|
46
|
+
## [3.0.8] - 2018-06-06
|
47
|
+
|
48
|
+
### Changed
|
49
|
+
|
50
|
+
- [JS] Interpolate translation array too
|
51
|
+
(PR: https://github.com/fnando/i18n-js/pull/498)
|
52
|
+
|
53
|
+
|
54
|
+
## [3.0.7] - 2018-05-30
|
55
|
+
|
56
|
+
### Fixed
|
57
|
+
|
58
|
+
- [Ruby] Fix new bug occuring when config file is absent
|
59
|
+
|
60
|
+
|
61
|
+
## [3.0.6] - 2018-05-30
|
62
|
+
|
63
|
+
### Fixed
|
64
|
+
|
65
|
+
- [Ruby] Make JS `i18n/filtered` depends on i18n-js config too
|
66
|
+
(PR: https://github.com/fnando/i18n-js/pull/497)
|
67
|
+
|
68
|
+
|
69
|
+
## [3.0.5] - 2018-02-26
|
70
|
+
|
71
|
+
### Changed
|
72
|
+
|
73
|
+
- [Ruby] Support `I18n` `1.0.x`
|
74
|
+
(PR: https://github.com/fnando/i18n-js/pull/492)
|
75
|
+
|
76
|
+
|
77
|
+
## [3.0.4] - 2018-01-26
|
78
|
+
|
79
|
+
### Fixed
|
80
|
+
|
81
|
+
- [Ruby] Fix `JS::Dependencies.using_asset_pipeline?` returning true when sprockets installed but disabled
|
82
|
+
(PR: https://github.com/fnando/i18n-js/pull/488)
|
83
|
+
|
84
|
+
|
85
|
+
## [3.0.3] - 2018-01-02
|
86
|
+
|
87
|
+
### Fixed
|
88
|
+
|
89
|
+
- [Ruby] Fix extend method when translations has array values
|
90
|
+
(PR: https://github.com/fnando/i18n-js/pull/487)
|
91
|
+
|
92
|
+
|
93
|
+
## [3.0.2] - 2017-10-26
|
94
|
+
|
95
|
+
### Changed
|
96
|
+
|
97
|
+
- [Ruby] Avoid writing new file if a file with same content already exists
|
98
|
+
(PR: https://github.com/fnando/i18n-js/pull/473)
|
99
|
+
- [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
|
100
|
+
It was falling back to `zh` first instead of `zh-Hant` (see new test case added)
|
101
|
+
(PR: https://github.com/fnando/i18n-js/pull/475)
|
102
|
+
|
103
|
+
|
104
|
+
## [3.0.1] - 2017-08-02
|
105
|
+
|
106
|
+
### Changed
|
107
|
+
|
108
|
+
- [Ruby] Relax Rails detection code to work with alternative installation methods
|
109
|
+
(PR: https://github.com/fnando/i18n-js/pull/467)
|
110
|
+
- [JS] Fix fallback when "3-part" locale like `zh-Hant-TW` is used
|
111
|
+
It fallbacks to `zh` only before, now it fallbacks to `zh-Hant`
|
112
|
+
(PR: https://github.com/fnando/i18n-js/pull/465)
|
113
|
+
|
114
|
+
|
115
|
+
## [3.0.0] - 2017-04-01
|
116
|
+
|
117
|
+
This is a fake official release, the *real* one will be `3.0.0.rc17`
|
118
|
+
And today is not April Fools' Day
|
119
|
+
|
120
|
+
### Fixed
|
121
|
+
|
122
|
+
- Ends the longest Release Candidate period among all ruby gems
|
123
|
+
(v3.0.0.rc1 released at 2012-05-10)
|
124
|
+
|
125
|
+
|
126
|
+
## [3.0.0.rc16] - 2017-03-13
|
127
|
+
|
128
|
+
### Changed
|
129
|
+
|
130
|
+
- [Ruby] Drop support for Ruby < `2.1.0`
|
131
|
+
|
132
|
+
### Fixed
|
133
|
+
|
134
|
+
- [JS] Make defaultValue works on plural translation
|
135
|
+
- [JS] Fix UMD pattern so the global/root won’t be undefined
|
136
|
+
|
137
|
+
|
138
|
+
## [3.0.0.rc15] - 2016-12-07
|
139
|
+
|
140
|
+
### Added
|
141
|
+
|
142
|
+
- Nothing
|
143
|
+
|
144
|
+
### Changed
|
145
|
+
|
146
|
+
- [JS] Allow `defaultValue` to work in pluralization
|
147
|
+
(PR: https://github.com/fnando/i18n-js/pull/433)
|
148
|
+
- [Ruby] Stop validating the fallback locales against `I18n.available_locales`
|
149
|
+
This allows some locales to be used as fallback locales, but not to be generated in JS.
|
150
|
+
(PR: https://github.com/fnando/i18n-js/pull/425)
|
151
|
+
- [Ruby] Remove dependency on gem `activesupport`
|
152
|
+
|
153
|
+
### Fixed
|
154
|
+
|
155
|
+
- [JS] Stop converting numeric & boolean values into objects
|
156
|
+
when merging objects with `I18n.extend`
|
157
|
+
(PR: https://github.com/fnando/i18n-js/pull/420)
|
158
|
+
- [JS] Fix I18n pluralization fallback when tree is empty
|
159
|
+
(PR: https://github.com/fnando/i18n-js/pull/435)
|
160
|
+
- [Ruby] Use old syntax to define lambda for compatibility with older Rubies
|
161
|
+
(Issue: https://github.com/fnando/i18n-js/issues/419)
|
162
|
+
- [Ruby] Fix error raised in middleware cache cleaning in parallel test
|
163
|
+
(Issue: https://github.com/fnando/i18n-js/issues/436)
|
164
|
+
|
165
|
+
|
166
|
+
## [3.0.0.rc14] - 2016-08-29
|
167
|
+
|
168
|
+
### Changed
|
169
|
+
|
170
|
+
- [JS] Method `I18n.extend()` behave as deep merging instead of shallow merging. (https://github.com/fnando/i18n-js/pull/416)
|
171
|
+
- [Ruby] Use object/class instead of block when registering Sprockets preprocessor (https://github.com/fnando/i18n-js/pull/418)
|
172
|
+
To ensure that your cache will expire properly based on locale file content after upgrading,
|
173
|
+
you should run `rake assets:clobber` and/or other rake tasks that clear the asset cache once gem updated
|
174
|
+
- [Ruby] Detect & support rails 5 (https://github.com/fnando/i18n-js/pull/413)
|
175
|
+
|
176
|
+
|
177
|
+
## [3.0.0.rc13] - 2016-06-29
|
178
|
+
|
179
|
+
### Added
|
180
|
+
|
181
|
+
- [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))
|
182
|
+
|
183
|
+
### Changed
|
184
|
+
|
185
|
+
- Nothing
|
186
|
+
|
187
|
+
### Fixed
|
188
|
+
|
189
|
+
- [JS] Initialize option `missingBehaviour` & `missingTranslationPrefix` with default values ([#398](https://github.com/fnando/i18n-js/pull/398))
|
190
|
+
- [JS] Throw an error when `I18n.strftime()` takes an invalid date ([#383](https://github.com/fnando/i18n-js/pull/383))
|
191
|
+
- [JS] Fix default error message when translation missing to consider locale passed in options
|
192
|
+
- [Ruby] Reset middleware cache on rails startup
|
193
|
+
([#402](https://github.com/fnando/i18n-js/pull/402))
|
194
|
+
|
195
|
+
|
196
|
+
## [3.0.0.rc12] - 2015-12-30
|
197
|
+
|
198
|
+
### Added
|
199
|
+
|
200
|
+
- [JS] Allow extending of translation files ([#354](https://github.com/fnando/i18n-js/pull/354))
|
201
|
+
- [JS] Allow missingPlaceholder to receive extra data for debugging ([#380](https://github.com/fnando/i18n-js/pull/380))
|
202
|
+
|
203
|
+
### Changed
|
204
|
+
|
205
|
+
- Nothing
|
206
|
+
|
207
|
+
### Fixed
|
208
|
+
|
209
|
+
- [Ruby] Fix of missing initializer at sprockets. ([#371](https://github.com/fnando/i18n-js/pull/371))
|
210
|
+
- [Ruby] Use proper method to register preprocessor documented by sprockets-rails. ([#376](https://github.com/fnando/i18n-js/pull/376))
|
211
|
+
- [JS] Correctly round unprecise floating point numbers.
|
212
|
+
- [JS] Ensure objects are recognized when passed in from an iframe. ([#375](https://github.com/fnando/i18n-js/pull/375))
|
213
|
+
|
214
|
+
|
215
|
+
## 3.0.0.rc11
|
216
|
+
|
217
|
+
### breaking changes
|
218
|
+
|
219
|
+
### enhancements
|
220
|
+
|
221
|
+
### bug fixes
|
222
|
+
|
223
|
+
- [Ruby] Handle fallback locale without any translation properly ([#338](https://github.com/fnando/i18n-js/pull/338))
|
224
|
+
- [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))
|
225
|
+
|
226
|
+
|
227
|
+
## 3.0.0.rc10
|
228
|
+
|
229
|
+
### breaking changes
|
230
|
+
|
231
|
+
- [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))
|
232
|
+
- [Ruby] The `:except` option to exclude certain phrases now (only) accepts the same patterns the `:only` option accepts
|
233
|
+
|
234
|
+
### enhancements
|
235
|
+
|
236
|
+
- [Ruby] Make handling of per-locale and not-per-locale exporting to be more consistent ([#320](https://github.com/fnando/i18n-js/pull/320))
|
237
|
+
- [Ruby] Add option `sort_translation_keys` to sort translation keys alphabetically ([#318](https://github.com/fnando/i18n-js/pull/318))
|
238
|
+
|
239
|
+
### bug fixes
|
240
|
+
|
241
|
+
- [Ruby] Fix fallback logic to work with not-per-locale files ([#320](https://github.com/fnando/i18n-js/pull/320))
|
242
|
+
|
243
|
+
|
244
|
+
## 3.0.0.rc9
|
245
|
+
|
246
|
+
### enhancements
|
247
|
+
|
248
|
+
- [JS] Force currency number sign to be at first place using `sign_first` option, default to `true`
|
249
|
+
- [Ruby] Add option `namespace` & `pretty_print` ([#300](https://github.com/fnando/i18n-js/pull/300))
|
250
|
+
- [Ruby] Add option `export_i18n_js` ([#301](https://github.com/fnando/i18n-js/pull/301))
|
251
|
+
- [Ruby] Now the gem also detects pre-release versions of `rails`
|
252
|
+
- [Ruby] Add `:except` option to exclude certain phrases or groups of phrases from the
|
253
|
+
outputted translations ([#312](https://github.com/fnando/i18n-js/pull/312))
|
254
|
+
- [JS] You can now set `I18n.missingBehavior='guess'` to have the scope string output as text instead of of the
|
255
|
+
"[missing `scope`]" message when no translation is available.
|
256
|
+
Combined that with `I18n.missingTranslationPrefix='SOMETHING'` and you can
|
257
|
+
still identify those missing strings.
|
258
|
+
([#304](https://github.com/fnando/i18n-js/pull/304))
|
259
|
+
|
260
|
+
### bug fixes
|
261
|
+
|
262
|
+
- [JS] Fix missing translation message when scope is passed in options
|
263
|
+
- [Ruby] Fix save cache directory verification when path is a symbolic link ([#329](https://github.com/fnando/i18n-js/pull/329))
|
264
|
+
|
265
|
+
|
266
|
+
## 3.0.0.rc8
|
267
|
+
|
268
|
+
### enhancements
|
269
|
+
|
270
|
+
- Add support for loading via AMD and CommonJS module loaders ([#266](https://github.com/fnando/i18n-js/pull/266))
|
271
|
+
- Add `I18n.nullPlaceholder`
|
272
|
+
Defaults to I18n.missingPlaceholder (`[missing {{name}} value]`)
|
273
|
+
Set to `function() {return "";}` to match Ruby `I18n.t("name: %{name}", name: nil)`
|
274
|
+
- For date formatting, you can now also add placeholders to the date format, see README for detail
|
275
|
+
- Add fallbacks option to `i18n-js.yml`, defaults to `true`
|
276
|
+
|
277
|
+
### bug fixes
|
278
|
+
|
279
|
+
- Fix factory initialization so that the Node/CommonJS branch only gets executed if the environment is Node/CommonJS
|
280
|
+
(it currently will execute if module is defined in the global scope, which occurs with QUnit, for example)
|
281
|
+
- 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))
|
282
|
+
- Remove check for `Rails.configuration.assets.compile` before telling Sprockets the dependency of translations JS file
|
283
|
+
This might be the reason of many "cache not expired" issues
|
284
|
+
Discovered/reported in #277
|
285
|
+
|
286
|
+
## 3.0.0.rc7
|
287
|
+
|
288
|
+
### enhancements
|
289
|
+
|
290
|
+
- The Rails Engine initializer is now named as `i18n-js.register_preprocessor` (https://github.com/fnando/i18n-js/pull/261)
|
291
|
+
- Rename `I18n::JS.config_file` to `I18n::JS.config_file_path` and make it configurable
|
292
|
+
Expected a `String`, default is still `config/i18n-js.yml`
|
293
|
+
- When running `rake i18n:js:export`, the `i18n.js` will also be exported to `I18n::JS.export_i18n_js_dir_path` by default
|
294
|
+
- Add `I18n::JS.export_i18n_js_dir_path`
|
295
|
+
Expected a `String`, default is `public/javascripts`
|
296
|
+
Set to `nil` will disable exporting `i18n.js`
|
297
|
+
|
298
|
+
### bug fixes
|
299
|
+
|
300
|
+
- Prevent toString() call on `undefined` when there is a missing interpolation value
|
301
|
+
- Added support for Rails instances without Sprockets object (https://github.com/fnando/i18n-js/pull/241)
|
302
|
+
- Fix `DEFAULT_OPTIONS` in `i18n.js` which contained an excessive comma
|
303
|
+
- Fix `nil` values are exported into JS files which causes strange translation error
|
304
|
+
- Fix pattern to replace all escaped $ in I18n.translate
|
305
|
+
- Fix JS `I18n.lookup` modifies existing locales accidentally
|
306
|
+
|
307
|
+
## 3.0.0.rc6
|
308
|
+
|
309
|
+
### enhancements
|
310
|
+
|
311
|
+
- You can now assign `I18n.locale` & `I18n.default_locale` before loading `i18n.js` in `application.html.*`
|
312
|
+
(merged to `i18n-js-pika` already)
|
313
|
+
- You can include ERB in `config/i18n-js.yml`(https://github.com/fnando/i18n-js/pull/224)
|
314
|
+
- Add support for +00:00 style time zone designator (https://github.com/fnando/i18n-js/pull/167)
|
315
|
+
- Add back rake task for export (`rake i18n:js:export`)
|
316
|
+
- Not overriding translation when manually run `I18n::JS.export` (https://github.com/fnando/i18n-js/pull/171)
|
317
|
+
- Move missing placeholder text generation into its own function (for easier debugging) (https://github.com/fnando/i18n-js/pull/169)
|
318
|
+
- Add support for milliseconds (`lll` in `yyyy-mm-ddThh:mm:ss.lllZ`) (https://github.com/fnando/i18n-js/pull/192)
|
319
|
+
- Add back i18n-js.yml config file generator : `rails generate i18n:js:config` (https://github.com/fnando/i18n-js/pull/225)
|
320
|
+
|
321
|
+
### bug fixes
|
322
|
+
|
323
|
+
- `I18n::JS.export` no longer exports locales other than those in `I18n.available_locales`, if `I18n.available_locales` is set
|
324
|
+
- I18.t supports the base scope through the options argument
|
325
|
+
- I18.t accepts an array as the scope
|
326
|
+
- Fix regression: asset not being reloaded in development when translation changed
|
327
|
+
- Requires `i18n` to be `~> 0.6`, `0.5` does not work at all
|
328
|
+
- Fix using multi-star scope with top-level translation key (https://github.com/fnando/i18n-js/pull/221)
|
329
|
+
|
330
|
+
|
331
|
+
## Before 3.0.0.rc5
|
332
|
+
|
333
|
+
- Things happened.
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
[Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.11...HEAD
|
338
|
+
[3.0.11]: https://github.com/fnando/i18n-js/compare/v3.0.10...v3.0.11
|
339
|
+
[3.0.10]: https://github.com/fnando/i18n-js/compare/v3.0.9...v3.0.10
|
340
|
+
[3.0.9]: https://github.com/fnando/i18n-js/compare/v3.0.8...v3.0.9
|
341
|
+
[3.0.8]: https://github.com/fnando/i18n-js/compare/v3.0.7...v3.0.8
|
342
|
+
[3.0.7]: https://github.com/fnando/i18n-js/compare/v3.0.6...v3.0.7
|
343
|
+
[3.0.6]: https://github.com/fnando/i18n-js/compare/v3.0.5...v3.0.6
|
344
|
+
[3.0.5]: https://github.com/fnando/i18n-js/compare/v3.0.4...v3.0.5
|
345
|
+
[3.0.4]: https://github.com/fnando/i18n-js/compare/v3.0.3...v3.0.4
|
346
|
+
[3.0.3]: https://github.com/fnando/i18n-js/compare/v3.0.2...v3.0.3
|
347
|
+
[3.0.2]: https://github.com/fnando/i18n-js/compare/v3.0.1...v3.0.2
|
348
|
+
[3.0.1]: https://github.com/fnando/i18n-js/compare/v3.0.0...v3.0.1
|
349
|
+
[3.0.0]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc16...v3.0.0
|
350
|
+
[3.0.0.rc16]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc15...v3.0.0.rc16
|
351
|
+
[3.0.0.rc15]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc14...v3.0.0.rc15
|
352
|
+
[3.0.0.rc14]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc13...v3.0.0.rc14
|
353
|
+
[3.0.0.rc13]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc12...v3.0.0.rc13
|
354
|
+
[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
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|