i18n 1.14.7 → 1.14.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cca63854d9dd69dfe1d36eb0388926fc5e7a7cd297ece21e2fdc431ef9c4c286
4
- data.tar.gz: 1ab0f78752eabfd6a03b7c1f4a6f4e45c03689e9fbc0936cd65d6cd1f4103363
3
+ metadata.gz: edf1a48f0dd110066260f4d93cd2af16e73e9f91845a16126794d4c9af5b664c
4
+ data.tar.gz: 36a488fcbbaefdabb42e1a6f42af534fa36f640de5674d31a92407d6dfd1835d
5
5
  SHA512:
6
- metadata.gz: e8dd4e1cf010b24d748b4e2713794296964301234b9dbed36c96ae591677fb9ca3d5df7f5aedd86a48a1f470ad81de07997f2103107af32786486892204222d4
7
- data.tar.gz: 9e2008459e303dc8e87742231d2468faa3f2edcb61a30c3c26f5240cc5606a8132bccc70ec3e45a9cfcc38eaf04d84c74c6d643ef54f1df2534c66706677180d
6
+ metadata.gz: 82897d5266dfb62379930d6f94346dc0e62c14e619995e3933dc6339d0dd6d06d4b491449d1f4eb43128de995e3d9837624e4132b7b506455e0169dece108b7f
7
+ data.tar.gz: 8938b0f8d862e989f7427ccb2299722914bd485af9afff24bf0bda6cd8f438dc750cacd8c85d45292787f2e78438ead7c7533d6c696f5d5b9fc7109535a48ee4
@@ -25,6 +25,7 @@ module I18n
25
25
 
26
26
  def compile_if_an_interpolation(string)
27
27
  if interpolated_str?(string)
28
+ string = +string
28
29
  string.instance_eval <<-RUBY_EVAL, __FILE__, __LINE__
29
30
  def i18n_interpolate(v = {})
30
31
  "#{compiled_interpolation_body(string)}"
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cgi'
4
-
5
3
  module I18n
6
4
  class ExceptionHandler
7
5
  def call(exception, _locale, _key, _options)
@@ -10,7 +10,7 @@ module I18n
10
10
  def call(env)
11
11
  @app.call(env)
12
12
  ensure
13
- Thread.current[:i18n_config] = I18n::Config.new
13
+ Thread.current.thread_variable_set(:i18n_config, I18n::Config.new)
14
14
  end
15
15
 
16
16
  end
@@ -89,14 +89,14 @@ module I18n
89
89
  end
90
90
 
91
91
  test "interpolation: ASCII strings in the backend should be encoded to UTF8 if interpolation options are in UTF8" do
92
- I18n.backend.store_translations 'en', 'encoding' => ('%{who} let me go'.force_encoding("ASCII"))
92
+ I18n.backend.store_translations 'en', 'encoding' => ('%{who} let me go'.dup.force_encoding(Encoding::US_ASCII))
93
93
  result = I18n.t 'encoding', :who => "måmmå miå"
94
94
  assert_equal Encoding::UTF_8, result.encoding
95
95
  end
96
96
 
97
97
  test "interpolation: UTF8 strings in the backend are still returned as UTF8 with ASCII interpolation" do
98
98
  I18n.backend.store_translations 'en', 'encoding' => 'måmmå miå %{what}'
99
- result = I18n.t 'encoding', :what => 'let me go'.force_encoding("ASCII")
99
+ result = I18n.t 'encoding', :what => 'let me go'.dup.force_encoding(Encoding::US_ASCII)
100
100
  assert_equal Encoding::UTF_8, result.encoding
101
101
  end
102
102
 
@@ -172,7 +172,7 @@ module I18n
172
172
  end
173
173
 
174
174
  def euc_jp(string)
175
- string.encode!(Encoding::EUC_JP)
175
+ string.encode(Encoding::EUC_JP)
176
176
  end
177
177
 
178
178
  def interpolate(*args)
data/lib/i18n/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18n
4
- VERSION = "1.14.7"
4
+ VERSION = "1.14.8"
5
5
  end
data/lib/i18n.rb CHANGED
@@ -55,12 +55,13 @@ module I18n
55
55
  module Base
56
56
  # Gets I18n configuration object.
57
57
  def config
58
- Thread.current[:i18n_config] ||= I18n::Config.new
58
+ Thread.current.thread_variable_get(:i18n_config) ||
59
+ Thread.current.thread_variable_set(:i18n_config, I18n::Config.new)
59
60
  end
60
61
 
61
62
  # Sets I18n configuration object.
62
63
  def config=(value)
63
- Thread.current[:i18n_config] = value
64
+ Thread.current.thread_variable_set(:i18n_config, value)
64
65
  end
65
66
 
66
67
  # Write methods which delegates to the configuration object
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.7
4
+ version: 1.14.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2025-01-19 00:00:00.000000000 Z
16
+ date: 2025-12-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: concurrent-ruby