i18n-js 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +9 -8
- data/README.md +1 -1
- data/app/assets/javascripts/i18n.js +1 -1
- data/lib/i18n/js/version.rb +1 -1
- data/spec/js/extend.spec.js +23 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cf663bf5df9a67831d1c4990bbe6dfe643ee3295032e0acb3daf3da73848206b
|
4
|
+
data.tar.gz: 3a7b7747572c76a3917c2ea93d327d8018bd53b038fbb0df57e5ce7ef8c5918d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a57c84a20c207670352bad0f45fcaf206eff8c698fc5ad03d1f75931dac7c6ab8da7dce677a75414c85120a9f448546451cd710107342aab26337080d606dc7
|
7
|
+
data.tar.gz: fbd08b7587afb1271e5ba9217ebeab00be5f1ad8df87a32ded2ac51a3d7e82eddc8e1f05fbd4c0c83280c9aac22b9d6cc1569ee01a39b9f3c564fcf87002b79f
|
data/CHANGELOG.md
CHANGED
@@ -18,11 +18,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
-
## [3.0.
|
21
|
+
## [3.0.3] - 2018-01-02
|
22
22
|
|
23
|
-
###
|
23
|
+
### Fixed
|
24
|
+
|
25
|
+
- [Ruby] Fix extend method when translations has array values
|
26
|
+
(PR: https://github.com/fnando/i18n-js/pull/487)
|
24
27
|
|
25
|
-
|
28
|
+
|
29
|
+
## [3.0.2] - 2017-10-26
|
26
30
|
|
27
31
|
### Changed
|
28
32
|
|
@@ -32,10 +36,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
32
36
|
It was falling back to `zh` first instead of `zh-Hant` (see new test case added)
|
33
37
|
(PR: https://github.com/fnando/i18n-js/pull/475)
|
34
38
|
|
35
|
-
### Fixed
|
36
|
-
|
37
|
-
- Nothing
|
38
|
-
|
39
39
|
|
40
40
|
## [3.0.1] - 2017-08-02
|
41
41
|
|
@@ -270,7 +270,8 @@ And today is not April Fools' Day
|
|
270
270
|
|
271
271
|
|
272
272
|
|
273
|
-
[Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.
|
273
|
+
[Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.3...HEAD
|
274
|
+
[3.0.3]: https://github.com/fnando/i18n-js/compare/v3.0.2...v3.0.3
|
274
275
|
[3.0.2]: https://github.com/fnando/i18n-js/compare/v3.0.1...v3.0.2
|
275
276
|
[3.0.1]: https://github.com/fnando/i18n-js/compare/v3.0.0...v3.0.1
|
276
277
|
[3.0.0]: https://github.com/fnando/i18n-js/compare/v3.0.0.rc16...v3.0.0
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ Then get the JS files following the instructions below.
|
|
61
61
|
<%# This is just an example, you can put `i18n.js` and `translations.js` anywhere you like %>
|
62
62
|
<%# Unlike the Asset Pipeline example, you need to require both **in order** %>
|
63
63
|
<%= javascript_include_tag "i18n" %>
|
64
|
-
<%= javascript_include_tag "translations" %>
|
64
|
+
<%= javascript_include_tag "translations", skip_pipeline: true %>
|
65
65
|
```
|
66
66
|
|
67
67
|
**There are two ways to get `translations.js`.**
|
@@ -117,7 +117,7 @@
|
|
117
117
|
var key, value;
|
118
118
|
for (key in obj) if (obj.hasOwnProperty(key)) {
|
119
119
|
value = obj[key];
|
120
|
-
if (isString(value) || isNumber(value) || isBoolean(value)) {
|
120
|
+
if (isString(value) || isNumber(value) || isBoolean(value) || isArray(value)) {
|
121
121
|
dest[key] = value;
|
122
122
|
} else {
|
123
123
|
if (dest[key] == null) dest[key] = {};
|
data/lib/i18n/js/version.rb
CHANGED
data/spec/js/extend.spec.js
CHANGED
@@ -82,4 +82,27 @@ describe("Extend", function () {
|
|
82
82
|
|
83
83
|
expect(I18n.extend(obj1, obj2)).toEqual(expected);
|
84
84
|
});
|
85
|
+
|
86
|
+
it("should merge array values", function() {
|
87
|
+
var obj1 = {
|
88
|
+
array1: [1, 2]
|
89
|
+
},
|
90
|
+
obj2 = {
|
91
|
+
array2: [1, 2],
|
92
|
+
obj3: {
|
93
|
+
array3: [1, 2],
|
94
|
+
array4: [{obj4: 1}, 2]
|
95
|
+
}
|
96
|
+
},
|
97
|
+
expected = {
|
98
|
+
array1: [1, 2],
|
99
|
+
array2: [1, 2],
|
100
|
+
obj3: {
|
101
|
+
array3: [1, 2],
|
102
|
+
array4: [{obj4: 1}, 2]
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
expect(JSON.stringify(I18n.extend(obj1, obj2))).toEqual(JSON.stringify(expected));
|
107
|
+
});
|
85
108
|
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -198,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
198
|
version: '0'
|
199
199
|
requirements: []
|
200
200
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.
|
201
|
+
rubygems_version: 2.7.3
|
202
202
|
signing_key:
|
203
203
|
specification_version: 4
|
204
204
|
summary: It's a small library to provide the Rails I18n translations on the Javascript.
|