i18n-js 3.9.0 → 3.9.1

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: '08599ed12ef6edb132d1a71b74e5ca2f3b3c04dc4463286414540f4631676984'
4
- data.tar.gz: 3dd94b7a9974952a5cb7996c222d1aaeb3e5c756cc811a8890e4d5fa79ffccb3
3
+ metadata.gz: af88256d90ed5aa70fdaf88ce224e2b3bdb378b65d3e4a826dd9073484d6d691
4
+ data.tar.gz: 3a6409f3e78871438978ebaeb10853e6c49b38eddb3be679a4bf5f550ebc1b17
5
5
  SHA512:
6
- metadata.gz: 26138b1fafc184b7858a97969130f29f9562cdaab41d1f05c1e31a37064a2f40a31b4d0a349e12ddaa6f769ab229618a854efaee0102f99821edd489b9d1deb5
7
- data.tar.gz: d763f7ebe8d1bba649c521bba03fa7fb77e4283b90ce6f1a1bb78ebf22dc7146f4e2eb02484f7d9f104d4d5454d90d0622af14128c6b383cd399e52aabaaf08b
6
+ metadata.gz: 93da6d4965b27b83a8064a0665b3689e8a55bf750881b4cfd00d220e3e73379c56840ff452a3fe586c66c69ff7b1f5132193160913ced2d956e2145ff4567894
7
+ data.tar.gz: 9ce7b91903ac75ee8e7c320058d45893330033eb5628b2ef1a3d8e29466053d21b931a6f1c87c15f7bb1f83bbce0c5c33a8b785c8be79c5acbdbb48eafb459ba
data/.editorconfig CHANGED
@@ -1,4 +1,4 @@
1
- # EditorConfig is awesome: http://EditorConfig.org
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
2
 
3
3
  # top-most EditorConfig file
4
4
  root = true
@@ -4,11 +4,13 @@ on:
4
4
  pull_request:
5
5
  branches:
6
6
  - main
7
+ - v3
7
8
  paths-ignore:
8
9
  - 'README.md'
9
10
  push:
10
11
  branches:
11
12
  - main
13
+ - v3
12
14
  paths-ignore:
13
15
  - 'README.md'
14
16
 
@@ -26,6 +28,8 @@ jobs:
26
28
  - 2.5
27
29
  - 2.6
28
30
  - 2.7
31
+ - '3.0'
32
+ - 3.1
29
33
  gemfile:
30
34
  - gemfiles/i18n_0_6.gemfile
31
35
  - gemfiles/i18n_0_7.gemfile
@@ -40,6 +44,7 @@ jobs:
40
44
  - gemfiles/i18n_1_6.gemfile
41
45
  - gemfiles/i18n_1_7.gemfile
42
46
  - gemfiles/i18n_1_8.gemfile
47
+ - gemfiles/i18n_1_9.gemfile
43
48
  allow_failures:
44
49
  - false
45
50
  include:
data/Appraisals CHANGED
@@ -42,3 +42,7 @@ end
42
42
  appraise "i18n_1_8" do
43
43
  gem "i18n", "~> 1.8.0"
44
44
  end
45
+
46
+ appraise "i18n_1_9" do
47
+ gem "i18n", "~> 1.9.0"
48
+ end
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
- This project adheres to [Semantic Versioning](http://semver.org/).
3
+ This project adheres to [Semantic Versioning](https://semver.org/).
4
4
 
5
5
 
6
6
  ## [Unreleased]
@@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
+ ## [3.9.1] - 2022-02-08
22
+
23
+ ### Changed
24
+
25
+ - [Ruby] Allow rails 7
26
+ (PR: https://github.com/fnando/i18n-js/pull/638)
27
+
28
+
21
29
  ## [3.9.0]
22
30
 
23
31
  ### Added
@@ -517,7 +525,8 @@ And today is not April Fools' Day
517
525
 
518
526
 
519
527
 
520
- [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.9.0...HEAD
528
+ [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.9.1...HEAD
529
+ [3.9.1]: https://github.com/fnando/i18n-js/compare/v3.9.0...v3.9.1
521
530
  [3.9.0]: https://github.com/fnando/i18n-js/compare/v3.8.4...v3.9.0
522
531
  [3.8.4]: https://github.com/fnando/i18n-js/compare/v3.8.3...v3.8.4
523
532
  [3.8.3]: https://github.com/fnando/i18n-js/compare/v3.8.2...v3.8.3
data/README.md CHANGED
@@ -8,11 +8,10 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://github.com/fnando/i18n-js/actions?query=workflow%3ATests"><img src="https://github.com/fnando/i18n-js/workflows/Tests/badge.svg" alt="Tests"></a>
11
- <a href="http://badge.fury.io/rb/i18n-js"><img src="http://img.shields.io/gem/v/i18n-js.svg" alt="Gem Version"></a>
11
+ <a href="https://badge.fury.io/rb/i18n-js"><img src="https://img.shields.io/gem/v/i18n-js.svg" alt="Gem Version"></a>
12
12
  <a href="https://www.npmjs.com/package/i18n-js"><img src="https://img.shields.io/npm/v/i18n-js.svg" alt="npm"></a>
13
13
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
14
- <a href="https://travis-ci.org/fnando/i18n-js"><img src="http://img.shields.io/travis/fnando/i18n-js.svg" alt="Build Status"></a>
15
- <a href="https://coveralls.io/r/fnando/i18n-js"><img src="http://img.shields.io/coveralls/fnando/i18n-js.svg" alt="Coverage Status"></a>
14
+ <a href="https://coveralls.io/r/fnando/i18n-js"><img src="https://img.shields.io/coveralls/fnando/i18n-js.svg" alt="Coverage Status"></a>
16
15
  <a href="https://gitter.im/fnando/i18n-js"><img src="https://img.shields.io/badge/gitter-join%20chat-1dce73.svg" alt="Gitter"></a>
17
16
  </p>
18
17
 
@@ -59,10 +58,10 @@ For more details, see:
59
58
  - [this gist](https://gist.github.com/bazzel/ecdff4718962e57c2d5569cf01d332fe)
60
59
  - https://github.com/fnando/i18n-js/issues/597
61
60
 
62
- #### Rails app with [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)
61
+ #### Rails app with [Asset Pipeline](https://guides.rubyonrails.org/asset_pipeline.html)
63
62
 
64
63
  If you're using the
65
- [asset pipeline](http://guides.rubyonrails.org/asset_pipeline.html), then you
64
+ [asset pipeline](https://guides.rubyonrails.org/asset_pipeline.html), then you
66
65
  must add the following line to your `app/assets/javascripts/application.js`.
67
66
 
68
67
  ```javascript
@@ -77,7 +76,7 @@ must add the following line to your `app/assets/javascripts/application.js`.
77
76
  //= require i18n/translations
78
77
  ```
79
78
 
80
- #### Rails app without [Asset Pipeline](http://guides.rubyonrails.org/asset_pipeline.html)
79
+ #### Rails app without [Asset Pipeline](https://guides.rubyonrails.org/asset_pipeline.html)
81
80
 
82
81
  First, put this in your `application.html` (layout file). Then get the JS files
83
82
  following the instructions below.
@@ -987,23 +986,26 @@ more details and discussion of this issue.
987
986
  ### JS `I18n.toCurrency` & `I18n.toNumber` cannot handle large integers
988
987
 
989
988
  The above methods use `toFixed` and it only supports 53 bit integers. Ref:
990
- http://2ality.com/2012/07/large-integers.html
989
+ https://2ality.com/2012/07/large-integers.html
991
990
 
992
991
  Feel free to find & discuss possible solution(s) at issue
993
992
  [#511](https://github.com/fnando/i18n-js/issues/511)
994
993
 
995
- ### Only works with `Simple` backend
994
+ ### May not work with all backend implementations
996
995
 
997
- If you set `I18n.backend` to something other than the default `Simple` backend,
998
- you will likely get an exception like this:
996
+ I18n backend implementations have to conform to a specific interface to work
997
+ with i18n-js. For backends that do not conform to the interface, you will likely
998
+ get an exception like this:
999
999
 
1000
1000
  ```
1001
1001
  Undefined method 'initialized?' for <your backend class>
1002
1002
  ```
1003
1003
 
1004
- For now, i18n-js is only compatible with the `Simple` backend. If you need a
1005
- more sophisticated backend for your rails application, like
1006
- `I18n::Backend::ActiveRecord`, you can setup i18n-js to get translations from a
1004
+ For now, i18n-js is compatible with the `Simple` backend and with
1005
+ `I18n::Backend::ActiveRecord` (>= 0.4.0).
1006
+
1007
+ If you need a more sophisticated backend for your rails application that doesn't
1008
+ implement the required methods, you can setup i18n-js to get translations from a
1007
1009
  separate `Simple` backend, by adding the following in an initializer:
1008
1010
 
1009
1011
  ```ruby
@@ -1042,18 +1044,18 @@ and discussion of this issue.
1042
1044
 
1043
1045
  ## Maintainer
1044
1046
 
1045
- - Nando Vieira - <http://nandovieira.com>
1047
+ - Nando Vieira - <https://nandovieira.com>
1046
1048
 
1047
1049
  ## Contributing
1048
1050
 
1049
1051
  Once you've made your great commits:
1050
1052
 
1051
- 1. [Fork](http://help.github.com/forking/) I18n.js
1053
+ 1. [Fork](https://help.github.com/forking/) I18n.js
1052
1054
  2. Create a branch with a clear name
1053
1055
  3. Make your changes (Please also add/change spec, README and CHANGELOG if
1054
1056
  applicable)
1055
1057
  4. Push changes to the created branch
1056
- 5. [Create an Pull Request](http://github.com/fnando/i18n-js/pulls)
1058
+ 5. [Create an Pull Request](https://github.com/fnando/i18n-js/pulls)
1057
1059
  6. That's it!
1058
1060
 
1059
1061
  Please respect the indentation rules and code style. And use 2 spaces, not tabs.
@@ -33,7 +33,7 @@ if (!Array.prototype.indexOf) {
33
33
  }
34
34
 
35
35
  // Production steps of ECMA-262, Edition 5, 15.4.4.18
36
- // Reference: http://es5.github.com/#x15.4.4.18
36
+ // Reference: https://es5.github.com/#x15.4.4.18
37
37
  // https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach
38
38
  if ( !Array.prototype.forEach ) {
39
39
 
@@ -53,7 +53,7 @@ if ( !Array.prototype.forEach ) {
53
53
  var len = O.length >>> 0; // Hack to convert O.length to a UInt32
54
54
 
55
55
  // 4. If IsCallable(callback) is false, throw a TypeError exception.
56
- // See: http://es5.github.com/#x9.11
56
+ // See: https://es5.github.com/#x9.11
57
57
  if ( {}.toString.call(callback) !== "[object Function]" ) {
58
58
  throw new TypeError( callback + " is not a function" );
59
59
  }
@@ -139,7 +139,7 @@ if (!Array.prototype.map) {
139
139
  var len = O.length >>> 0;
140
140
 
141
141
  // 4. If IsCallable(callback) is false, throw a TypeError exception.
142
- // See: http://es5.github.com/#x9.11
142
+ // See: https://es5.github.com/#x9.11
143
143
  if (typeof callback !== 'function') {
144
144
  throw new TypeError(callback + ' is not a function');
145
145
  }
@@ -269,23 +269,23 @@
269
269
  }
270
270
 
271
271
  // Locale code format 1:
272
- // According to RFC4646 (http://www.ietf.org/rfc/rfc4646.txt)
272
+ // According to RFC4646 (https://www.ietf.org/rfc/rfc4646.txt)
273
273
  // language codes for Traditional Chinese should be `zh-Hant`
274
274
  //
275
275
  // But due to backward compatibility
276
276
  // We use older version of IETF language tag
277
- // @see http://www.w3.org/TR/html401/struct/dirlang.html
278
- // @see http://en.wikipedia.org/wiki/IETF_language_tag
277
+ // @see https://www.w3.org/TR/html401/struct/dirlang.html
278
+ // @see https://en.wikipedia.org/wiki/IETF_language_tag
279
279
  //
280
280
  // Format: `language-code = primary-code ( "-" subcode )*`
281
281
  //
282
282
  // primary-code uses ISO639-1
283
- // @see http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
284
- // @see http://www.iso.org/iso/home/standards/language_codes.htm
283
+ // @see https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
284
+ // @see https://www.iso.org/iso/home/standards/language_codes.htm
285
285
  //
286
286
  // subcode uses ISO 3166-1 alpha-2
287
- // @see http://en.wikipedia.org/wiki/ISO_3166
288
- // @see http://www.iso.org/iso/country_codes.htm
287
+ // @see https://en.wikipedia.org/wiki/ISO_3166
288
+ // @see https://www.iso.org/iso/country_codes.htm
289
289
  //
290
290
  // @note
291
291
  // subcode can be in upper case or lower case
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "i18n", "~> 1.9.0"
6
+
7
+ gemspec path: "../"
data/i18n-js.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Nando Vieira"]
10
10
  s.email = ["fnando.vieira@gmail.com"]
11
- s.homepage = "http://rubygems.org/gems/i18n-js"
11
+ s.homepage = "https://rubygems.org/gems/i18n-js"
12
12
  s.summary = "It's a small library to provide the Rails I18n translations on the Javascript."
13
13
  s.description = s.summary
14
14
  s.license = "MIT"
@@ -18,7 +18,7 @@ module I18n
18
18
  # Call this in an initializer
19
19
  def using_asset_pipeline?
20
20
  assets_pipeline_available =
21
- (rails3? || rails4? || rails5? || rails6?) &&
21
+ (rails3? || rails4? || rails5? || rails6? || rails7?) &&
22
22
  Rails.respond_to?(:application) &&
23
23
  Rails.application.config.respond_to?(:assets)
24
24
  rails3_assets_enabled =
@@ -26,7 +26,7 @@ module I18n
26
26
  assets_pipeline_available &&
27
27
  Rails.application.config.assets.enabled != false
28
28
 
29
- assets_pipeline_available && (rails4? || rails5? || rails6? || rails3_assets_enabled)
29
+ assets_pipeline_available && (rails4? || rails5? || rails6? || rails7? || rails3_assets_enabled)
30
30
  end
31
31
 
32
32
  private
@@ -46,6 +46,10 @@ module I18n
46
46
  def rails6?
47
47
  rails? && Rails.version.to_i == 6
48
48
  end
49
+
50
+ def rails7?
51
+ rails? && Rails.version.to_i == 7
52
+ end
49
53
 
50
54
  def safe_gem_check(*args)
51
55
  if Gem::Specification.respond_to?(:find_by_name)
@@ -21,7 +21,7 @@ module I18n
21
21
  # https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/railtie.rb
22
22
  #
23
23
  # Finisher hook is the place which should be used as border.
24
- # http://guides.rubyonrails.org/configuring.html#initializers
24
+ # https://guides.rubyonrails.org/configuring.html#initializers
25
25
  #
26
26
  # For detail see Pull Request:
27
27
  # https://github.com/fnando/i18n-js/pull/371
data/lib/i18n/js/utils.rb CHANGED
@@ -3,7 +3,7 @@ module I18n
3
3
  module Utils
4
4
  PLURAL_KEYS = %i[zero one two few many other].freeze
5
5
 
6
- # Based on deep_merge by Stefan Rusterholz, see <http://www.ruby-forum.com/topic/142809>.
6
+ # Based on deep_merge by Stefan Rusterholz, see <https://www.ruby-forum.com/topic/142809>.
7
7
  # This method is used to handle I18n fallbacks. Given two equivalent path nodes in two locale trees:
8
8
  # 1. If the node in the current locale appears to be an I18n pluralization (:one, :other, etc.),
9
9
  # use the node, but merge in any missing/non-nil keys from the fallback (default) locale.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module I18n
4
4
  module JS
5
- VERSION = "3.9.0"
5
+ VERSION = "3.9.1"
6
6
  end
7
7
  end
data/spec/js/require.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** vim: et:ts=4:sw=4:sts=4
2
2
  * @license RequireJS 2.1.16 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
3
3
  * Available via the MIT or new BSD license.
4
- * see: http://github.com/jrburke/requirejs for details
4
+ * see: https://github.com/jrburke/requirejs for details
5
5
  */
6
6
  //Not using strict: uneven strict support in browsers, #392, and causes
7
7
  //problems with requirejs.exec()/transpiler plugins that may not be strict.
@@ -163,7 +163,7 @@ var requirejs, require, define;
163
163
  * @returns {Error}
164
164
  */
165
165
  function makeError(id, msg, err, requireModules) {
166
- var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
166
+ var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id);
167
167
  e.requireType = id;
168
168
  e.requireModules = requireModules;
169
169
  if (err) {
@@ -1810,7 +1810,7 @@ var requirejs, require, define;
1810
1810
  head = s.head = document.getElementsByTagName('head')[0];
1811
1811
  //If BASE tag is in play, using appendChild is a problem for IE6.
1812
1812
  //When that browser dies, this can be removed. Details in this jQuery bug:
1813
- //http://dev.jquery.com/ticket/2709
1813
+ //https://dev.jquery.com/ticket/2709
1814
1814
  baseElement = document.getElementsByTagName('base')[0];
1815
1815
  if (baseElement) {
1816
1816
  head = s.head = baseElement.parentNode;
@@ -1829,7 +1829,7 @@ var requirejs, require, define;
1829
1829
  */
1830
1830
  req.createNode = function (config, moduleName, url) {
1831
1831
  var node = config.xhtml ?
1832
- document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
1832
+ document.createElementNS('https://www.w3.org/1999/xhtml', 'html:script') :
1833
1833
  document.createElement('script');
1834
1834
  node.type = config.scriptType || 'text/javascript';
1835
1835
  node.charset = 'utf-8';
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.9.0
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-30 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -128,6 +128,7 @@ files:
128
128
  - gemfiles/i18n_1_6.gemfile
129
129
  - gemfiles/i18n_1_7.gemfile
130
130
  - gemfiles/i18n_1_8.gemfile
131
+ - gemfiles/i18n_1_9.gemfile
131
132
  - i18n-js.gemspec
132
133
  - i18njs.png
133
134
  - lib/i18n-js.rb
@@ -209,11 +210,11 @@ files:
209
210
  - spec/ruby/i18n/js_spec.rb
210
211
  - spec/spec_helper.rb
211
212
  - yarn.lock
212
- homepage: http://rubygems.org/gems/i18n-js
213
+ homepage: https://rubygems.org/gems/i18n-js
213
214
  licenses:
214
215
  - MIT
215
216
  metadata: {}
216
- post_install_message:
217
+ post_install_message:
217
218
  rdoc_options: []
218
219
  require_paths:
219
220
  - lib
@@ -228,8 +229,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
229
  - !ruby/object:Gem::Version
229
230
  version: '0'
230
231
  requirements: []
231
- rubygems_version: 3.2.24
232
- signing_key:
232
+ rubygems_version: 3.3.6
233
+ signing_key:
233
234
  specification_version: 4
234
235
  summary: It's a small library to provide the Rails I18n translations on the Javascript.
235
236
  test_files: