i18n-js 3.0.8 → 3.0.9

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
2
  SHA256:
3
- metadata.gz: 820d6beeaa53ffbe74afc97313260ee0a77412a7ff576e906a1c4291a50970d0
4
- data.tar.gz: e7a97db0d132db4de65bb1ae5c37b1ca47670f6ce76ea02e356d4bc8906343c5
3
+ metadata.gz: 39b2813fcbbec8bbb3dc23712043e5bbb9c34ad5a6a91c617f8fb7c43a6012df
4
+ data.tar.gz: 209aed0138760420e27694a6b18747aaae0ba38cc81856cb25a5d00a1e88e100
5
5
  SHA512:
6
- metadata.gz: c7657ce121aba975ba1b1d0acad226786ef867494e9fc1d1ec3d118f499f475ab27567cb121433f9af54c0080ac2b899edfdd1079de5497da7b936c18afe4bbb
7
- data.tar.gz: 38a12230b043fb9f014bb33a056498071b1871155f77e27ed062a8678409a550db346c31a4264cc07bea6494601f1cc43643c0b47afad328f3aba05d0b2b8cbc
6
+ metadata.gz: 3a3e2a7b297f31c95064f81603623206f1e43b9d384858c56d8127243f121753ca0c441a6c5027a3e074f030211d737b8b34d15fe95c911c9367a9720b55d34e
7
+ data.tar.gz: c94a433c6c4a720f454ff4fbd920d86c3605934c3b79c38d4e5935c60ae38a4f885e6b60cb338fb1a71d3cd93c1555af2df1d379daa8764607292d1ddbc5f2fa
data/CHANGELOG.md CHANGED
@@ -18,6 +18,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
+ ## [3.0.9] - 2018-06-21
22
+
23
+ ### Fixed
24
+
25
+ - [JS] Fix translation array interpolation for array with null
26
+
27
+
21
28
  ## [3.0.8] - 2018-06-06
22
29
 
23
30
  ### Changed
@@ -309,7 +316,8 @@ And today is not April Fools' Day
309
316
 
310
317
 
311
318
 
312
- [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.8...HEAD
319
+ [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.9...HEAD
320
+ [3.0.9]: https://github.com/fnando/i18n-js/compare/v3.0.8...v3.0.9
313
321
  [3.0.8]: https://github.com/fnando/i18n-js/compare/v3.0.7...v3.0.8
314
322
  [3.0.7]: https://github.com/fnando/i18n-js/compare/v3.0.6...v3.0.7
315
323
  [3.0.6]: https://github.com/fnando/i18n-js/compare/v3.0.5...v3.0.6
@@ -388,7 +388,6 @@
388
388
  options = options || {}
389
389
 
390
390
  var locales = this.locales.get(options.locale).slice()
391
- , requestedLocale = locales[0]
392
391
  , locale
393
392
  , scopes
394
393
  , fullScope
@@ -447,7 +446,6 @@
447
446
  I18n.pluralizationLookup = function(count, scope, options) {
448
447
  options = options || {}
449
448
  var locales = this.locales.get(options.locale).slice()
450
- , requestedLocale = locales[0]
451
449
  , locale
452
450
  , scopes
453
451
  , translations
@@ -611,6 +609,10 @@
611
609
 
612
610
  // This function interpolates the all variables in the given message.
613
611
  I18n.interpolate = function(message, options) {
612
+ if (message === null) {
613
+ return message;
614
+ }
615
+
614
616
  options = options || {}
615
617
  var matches = message.match(this.placeholder)
616
618
  , placeholder
@@ -2,6 +2,6 @@
2
2
 
3
3
  module I18n
4
4
  module JS
5
- VERSION = "3.0.8"
5
+ VERSION = "3.0.9"
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18n-js",
3
- "version": "3.0.3",
3
+ "version": "3.0.9",
4
4
  "description": "A javascript library similar to Ruby on Rails i18n gem",
5
5
  "author": "Nando Vieira",
6
6
  "license": "MIT",
@@ -260,9 +260,10 @@ describe("Translate", function(){
260
260
  it("returns an array with values interpolated", function(){
261
261
  var options = {value: 314};
262
262
  expect(I18n.t("arrayWithParams", options)).toEqual([
263
- `An item with a param of ${options.value}`,
264
- `Another item with a param of ${options.value}`,
265
- `A last item with a param of ${options.value}`,
263
+ null,
264
+ "An item with a param of " + options.value,
265
+ "Another item with a param of " + options.value,
266
+ "A last item with a param of " + options.value
266
267
  ]);
267
268
  });
268
269
  });
@@ -60,9 +60,10 @@ var DEBUG = false;
60
60
  }
61
61
 
62
62
  , arrayWithParams: [
63
+ null,
63
64
  "An item with a param of {{value}}",
64
65
  "Another item with a param of {{value}}",
65
- "A last item with a param of {{value}}",
66
+ "A last item with a param of {{value}}"
66
67
  ]
67
68
  };
68
69
 
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.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2018-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n