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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 519170473917cd23758ec9b9f02cc359aff46d30
4
- data.tar.gz: 94de0b38416dd8e7ec05a107e100a0960ca1d310
2
+ SHA256:
3
+ metadata.gz: 3c4c76be23e0dc2fcfb13e839d1c2089bfe2eab1b16519e54e78bd75bcda5c12
4
+ data.tar.gz: 8d881ca0a6c73df1f8c2f555bb2d3bfa8bed18bee79c4bf7330f3b950f53ab77
5
5
  SHA512:
6
- metadata.gz: 26b8fe3d2c87bb01feaba7681cf1ddff6d8caee96e5451becca1e2f4716532c2ce8e97423eb7c10ccead868b3056046dc04a5f2e97e3272dace8b3ca14d73d49
7
- data.tar.gz: cdaa0acf5582e760d741d687f4ddb89ce7dbe7069dbeed85d8acceec114872d14f6e2b29403abecb82bafd2264f8ecfd2aa41a963671cb5f7b672ca5791dce10
6
+ metadata.gz: c5c3d41e097f5d2e9a680e1676265a9e67a1d0b9070c558d859f912422716bedb2a0a15bf24804e38a2cdea1caff4ebce6165ad34b6af74983088780964d49b3
7
+ data.tar.gz: 689ad5412cf0ec59571abd312fb75f4ca176c0909074e48325cc7ee25410f8ff469930c50fcc6cf63be15fdf5ed0ae92beaac3ad1131a8989512a44fe1f8ecea
@@ -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 unless ::I18n.respond_to?(:fallbacks)
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]
@@ -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 i18n_admin:translate #{ self.model_name.element }` " +
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
 
@@ -1,5 +1,5 @@
1
1
  module Para
2
2
  module I18n
3
- VERSION = "0.3.4"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
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
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-04 00:00:00.000000000 Z
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
- rubyforge_project:
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