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 +4 -4
- data/lib/gettext_i18n_rails/backend.rb +9 -10
- data/lib/gettext_i18n_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b2bd7b5e4d51e8b0c80eb37d3971b1fbc79ef33b9a35d06813e8910cba26bc2
|
4
|
+
data.tar.gz: ab2815bbe31652338bde0dd6e02bced7dc19f7fee67d21cd62dc5572ddc6e4d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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)
|
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.
|
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:
|
11
|
+
date: 2023-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_gettext
|