gettext_i18n_rails 1.9.0 → 1.10.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: 3259e666c1481870b3fc42ef15f9122f550dacb20676dc94ed6f2626a85d881f
4
- data.tar.gz: f9c946d849eefe7fb3bc282e82075e05c1e1343f3bea58b57466a77c0a95dfe3
3
+ metadata.gz: 7b2bd7b5e4d51e8b0c80eb37d3971b1fbc79ef33b9a35d06813e8910cba26bc2
4
+ data.tar.gz: ab2815bbe31652338bde0dd6e02bced7dc19f7fee67d21cd62dc5572ddc6e4d1
5
5
  SHA512:
6
- metadata.gz: 8cf6c57bfb859e54b78ee70b4dc19429b49d9d5eb328ccc4b281f1217b81626daa61a68fefd48fee422305678eeab649a3f936d2e5b25d7d3dc4d1d182cf3ff5
7
- data.tar.gz: c7e08204399174c13dec49e3d10389eb1a2316e1aa2e3cfad9e40b5eaf6bf40aebfc7230fef67dcdb831e443c25960065e0fd970962f68775e2b54efeae2a8ba
6
+ metadata.gz: efa9360667d77c06a174969242cd4febf1e77400ac3292a4fa8fb3cd8e804101342986004a91478ed8753a50875f305b0e29baf1f11004ef713b78ba296d0f1a
7
+ data.tar.gz: 75050454e7a7ba7777a7841d42d79d9dde0d703829d5d6f9202919e2933363967fb346ec7b635eaf6b46bc52de55b9842f9de615f109c026104a450a9dd8b9bb
@@ -16,17 +16,16 @@ module GettextI18nRails
16
16
  end
17
17
 
18
18
  def translate(locale, key, options)
19
- current_locale = FastGettext.set_locale locale
20
- if gettext_key = gettext_key(key, options)
21
- translation =
22
- plural_translate(gettext_key, options) || FastGettext._(gettext_key)
23
- interpolate(translation, options)
24
- else
25
- result = backend.translate(locale, key, options)
26
- (RUBY19 and result.is_a?(String)) ? result.force_encoding("UTF-8") : result
19
+ I18n.with_locale(locale) do
20
+ if gettext_key = gettext_key(key, options)
21
+ translation =
22
+ plural_translate(gettext_key, options) || FastGettext._(gettext_key)
23
+ interpolate(translation, options)
24
+ else
25
+ result = backend.translate(locale, key, options)
26
+ (RUBY19 and result.is_a?(String)) ? result.force_encoding("UTF-8") : result
27
+ end
27
28
  end
28
- ensure
29
- FastGettext.set_locale current_locale
30
29
  end
31
30
 
32
31
  def method_missing(method, *args)
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '1.9.0'
2
+ Version = VERSION = '1.10.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.9.0
4
+ version: 1.10.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: 2022-10-13 00:00:00.000000000 Z
11
+ date: 2023-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fast_gettext