gettext_i18n_rails 1.10.0 → 1.11.0

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: 7b2bd7b5e4d51e8b0c80eb37d3971b1fbc79ef33b9a35d06813e8910cba26bc2
4
- data.tar.gz: ab2815bbe31652338bde0dd6e02bced7dc19f7fee67d21cd62dc5572ddc6e4d1
3
+ metadata.gz: dae7769503d78af47afa65bce415dcf9ed13465b6a561ea91b314ccc624149ff
4
+ data.tar.gz: 801ac8e2d1a5c02911e27112ba80c4478de3f41aaf2cb0aef16c518c5231ac47
5
5
  SHA512:
6
- metadata.gz: efa9360667d77c06a174969242cd4febf1e77400ac3292a4fa8fb3cd8e804101342986004a91478ed8753a50875f305b0e29baf1f11004ef713b78ba296d0f1a
7
- data.tar.gz: 75050454e7a7ba7777a7841d42d79d9dde0d703829d5d6f9202919e2933363967fb346ec7b635eaf6b46bc52de55b9842f9de615f109c026104a450a9dd8b9bb
6
+ metadata.gz: cce87a14ed24586cb8617d78b10f4e9b7888ed88e7e1c18789a6543992f990a102bf6517e04507158d63c08d9a43218f97705bd5c8f22709cbf5e0b76e8bde37
7
+ data.tar.gz: 3453bc4d44067f5927880805ebd51d9d74fc3cf4f8a83ac8db3bdc6cedf7ade2f9db523d5f0e5ba6d16b0819856c911bf4f7df783c267560df64e430be2056b7
@@ -5,8 +5,6 @@ module GettextI18nRails
5
5
  cattr_accessor :translate_defaults
6
6
  attr_accessor :backend
7
7
 
8
- RUBY19 = (RUBY_VERSION > "1.9")
9
-
10
8
  def initialize(*args)
11
9
  self.backend = I18n::Backend::Simple.new(*args)
12
10
  end
@@ -23,7 +21,12 @@ module GettextI18nRails
23
21
  interpolate(translation, options)
24
22
  else
25
23
  result = backend.translate(locale, key, options)
26
- (RUBY19 and result.is_a?(String)) ? result.force_encoding("UTF-8") : result
24
+ if result.is_a?(String)
25
+ result = result.dup if result.frozen?
26
+ result.force_encoding("UTF-8")
27
+ else
28
+ result
29
+ end
27
30
  end
28
31
  end
29
32
  end
@@ -65,6 +65,8 @@ module GettextI18nRails
65
65
 
66
66
  def models
67
67
  if Rails::VERSION::MAJOR >= 3
68
+ # Ensure autoloaders are set up before we attempt to eager load!
69
+ Rails.application.autoloaders.each(&:setup) if Rails.application.respond_to?(:autoloaders)
68
70
  Rails.application.eager_load! # make sure that all models are loaded so that direct_descendants works
69
71
  descendants = ::ActiveRecord::Base.direct_descendants
70
72
 
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '1.10.0'
2
+ Version = VERSION = '1.11.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-07 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_gettext