para-i18n 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/para/i18n/fallbacks.rb +10 -1
- data/lib/para/i18n/model.rb +1 -1
- data/lib/para/i18n/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3c4c76be23e0dc2fcfb13e839d1c2089bfe2eab1b16519e54e78bd75bcda5c12
|
4
|
+
data.tar.gz: 8d881ca0a6c73df1f8c2f555bb2d3bfa8bed18bee79c4bf7330f3b950f53ab77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c3d41e097f5d2e9a680e1676265a9e67a1d0b9070c558d859f912422716bedb2a0a15bf24804e38a2cdea1caff4ebce6165ad34b6af74983088780964d49b3
|
7
|
+
data.tar.gz: 689ad5412cf0ec59571abd312fb75f4ca176c0909074e48325cc7ee25410f8ff469930c50fcc6cf63be15fdf5ed0ae92beaac3ad1131a8989512a44fe1f8ecea
|
data/lib/para/i18n/fallbacks.rb
CHANGED
@@ -1,8 +1,17 @@
|
|
1
1
|
module Para
|
2
2
|
module I18n
|
3
3
|
module Fallbacks
|
4
|
+
mattr_accessor :_disable_fallbacks
|
5
|
+
|
6
|
+
def self.without_i18n_fallbacks(&block)
|
7
|
+
self._disable_fallbacks = true
|
8
|
+
block.call
|
9
|
+
ensure
|
10
|
+
self._disable_fallbacks = false
|
11
|
+
end
|
12
|
+
|
4
13
|
def self.i18n_fallback_for(locale)
|
5
|
-
return
|
14
|
+
return if _disable_fallbacks || !::I18n.respond_to?(:fallbacks)
|
6
15
|
|
7
16
|
if (fallbacks = ::I18n.fallbacks[locale]) && fallbacks.length > 1
|
8
17
|
fallbacks[1]
|
data/lib/para/i18n/model.rb
CHANGED
@@ -35,7 +35,7 @@ module Para
|
|
35
35
|
def model_translations
|
36
36
|
unless respond_to?(:_translations)
|
37
37
|
raise "The model #{ self.class.name } is not translatable. " +
|
38
|
-
"Please run `rails g
|
38
|
+
"Please run `rails g para:i18n:translate #{ self.model_name.element }` " +
|
39
39
|
"generator to create the model's migration."
|
40
40
|
end
|
41
41
|
|
data/lib/para/i18n/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: para-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valentin Ballestrino
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: para
|
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.6.11
|
128
|
+
rubygems_version: 3.0.3
|
130
129
|
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Para CMS I18n admin module for models
|