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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1ebec2528bae57b4e38d4fbf4fe2241197dfc36d
4
- data.tar.gz: 5b5cc7647e6dabbd1fe607a438737f156b6e9e54
2
+ SHA256:
3
+ metadata.gz: cf663bf5df9a67831d1c4990bbe6dfe643ee3295032e0acb3daf3da73848206b
4
+ data.tar.gz: 3a7b7747572c76a3917c2ea93d327d8018bd53b038fbb0df57e5ce7ef8c5918d
5
5
  SHA512:
6
- metadata.gz: 1e9b528236405cf0d44016d62ecbc892bd9ffec07e8266bd2cbd5760c17a852f95d38dd230779b1eab7a9db25c80394d4aa36231522227c51e5b28e2222a7ce0
7
- data.tar.gz: 2fd596c5e48d2e570a930bf714278571c49944251247217b93f65a192338bbb3f72cf41d1f80bc8136a173792f2af705f1a97887a3ea1f182809c9f8d134f362
6
+ metadata.gz: 8a57c84a20c207670352bad0f45fcaf206eff8c698fc5ad03d1f75931dac7c6ab8da7dce677a75414c85120a9f448546451cd710107342aab26337080d606dc7
7
+ data.tar.gz: fbd08b7587afb1271e5ba9217ebeab00be5f1ad8df87a32ded2ac51a3d7e82eddc8e1f05fbd4c0c83280c9aac22b9d6cc1569ee01a39b9f3c564fcf87002b79f
@@ -18,11 +18,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
- ## [3.0.2] - 2017-10-26
21
+ ## [3.0.3] - 2018-01-02
22
22
 
23
- ### Added
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
- - Nothing
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.2...HEAD
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] = {};
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module JS
3
- VERSION = "3.0.2"
3
+ VERSION = "3.0.3"
4
4
  end
5
5
  end
@@ -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.2
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: 2017-10-26 00:00:00.000000000 Z
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.6.13
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.