refinerycms-i18n 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Gemfile +1 -1
- data/lib/refinery/i18n/engine.rb +2 -2
- data/refinerycms-i18n.gemspec +1 -1
- data/spec/controllers/refinery/admin/resources_controller_spec.rb +36 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac37504ad8f7f3a48dd97a244f5a9d064c4eabb7
|
4
|
+
data.tar.gz: 68f1b485fa2104ed15c8adf58751e9310796130b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709f5b24238d70b604c95a0ba690154aced4a66036d4a67b44ef6f6430eacbd9ab91ca829e4812d8bea34f7df37b6bdcba67085507bb683508cbb5ae4d7ba92e
|
7
|
+
data.tar.gz: b5baabbb16b7ad7dc288b098f258999cdf0b55873a3cf024f967bfcc8c41f4b849c603fbb1b37a543459c9c59a0d15bc746d218f0d4d8ae17071f8b49ce382cb
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/lib/refinery/i18n/engine.rb
CHANGED
@@ -57,10 +57,10 @@ module Refinery
|
|
57
57
|
Globalize.locale = params[:switch_locale].to_sym
|
58
58
|
elsif ::I18n.locale != ::Refinery::I18n.default_frontend_locale
|
59
59
|
Globalize.locale = ::Refinery::I18n.default_frontend_locale
|
60
|
+
else
|
61
|
+
Globalize.locale = ::I18n.locale
|
60
62
|
end
|
61
63
|
end
|
62
|
-
|
63
|
-
Globalize.locale = ::I18n.locale if Globalize.locale.nil?
|
64
64
|
end
|
65
65
|
# globalize! should be prepended first so that it runs after find_or_set_locale
|
66
66
|
prepend_before_filter :globalize!, :find_or_set_locale
|
data/refinerycms-i18n.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-i18n}
|
5
|
-
s.version = %q{3.0.
|
5
|
+
s.version = %q{3.0.2}
|
6
6
|
s.description = %q{i18n logic extracted from Refinery CMS, for Refinery CMS.}
|
7
7
|
s.summary = %q{i18n logic for Refinery CMS.}
|
8
8
|
s.email = %q{info@refinerycms.com}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Admin
|
5
|
+
describe ResourcesController, type: :controller do
|
6
|
+
before do
|
7
|
+
Globalize.locale = :en
|
8
|
+
@resource = FactoryGirl.create(:resource, :resource_title => "My resource in English")
|
9
|
+
|
10
|
+
# Add a translation
|
11
|
+
Globalize.locale = :es
|
12
|
+
@resource.resource_title = 'Mi recurso en español'
|
13
|
+
@resource.save
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'reset Globalize as expected' do
|
17
|
+
get :index
|
18
|
+
expect(Globalize.locale).to eql(:en)
|
19
|
+
expect(::I18n.locale).to eql(:en)
|
20
|
+
expect(assigns(:resources).first.resource_title).to eql('My resource in English')
|
21
|
+
|
22
|
+
# Switch globalized content to ES
|
23
|
+
get :index, switch_locale: :es
|
24
|
+
expect(Globalize.locale).to eql(:es)
|
25
|
+
expect(::I18n.locale).to eql(:en)
|
26
|
+
expect(assigns(:resources).first.resource_title).to eql('Mi recurso en español')
|
27
|
+
|
28
|
+
# Should return to default locale for globalized content on next request
|
29
|
+
get :index
|
30
|
+
expect(Globalize.locale).to eql(:en)
|
31
|
+
expect(::I18n.locale).to eql(:en)
|
32
|
+
expect(assigns(:resources).first.resource_title).to eql('My resource in English')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Arndt
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: routing-filter
|
@@ -313,6 +313,7 @@ files:
|
|
313
313
|
- lib/translate/storage.rb
|
314
314
|
- refinerycms-i18n.gemspec
|
315
315
|
- script/rails
|
316
|
+
- spec/controllers/refinery/admin/resources_controller_spec.rb
|
316
317
|
- spec/features/set_locale_spec.rb
|
317
318
|
- spec/spec_helper.rb
|
318
319
|
- spec/support/refinery/i18n/set_defaults.rb
|
@@ -338,11 +339,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
339
|
version: '0'
|
339
340
|
requirements: []
|
340
341
|
rubyforge_project:
|
341
|
-
rubygems_version: 2.
|
342
|
+
rubygems_version: 2.6.13
|
342
343
|
signing_key:
|
343
344
|
specification_version: 4
|
344
345
|
summary: i18n logic for Refinery CMS.
|
345
346
|
test_files:
|
347
|
+
- spec/controllers/refinery/admin/resources_controller_spec.rb
|
346
348
|
- spec/features/set_locale_spec.rb
|
347
349
|
- spec/spec_helper.rb
|
348
350
|
- spec/support/refinery/i18n/set_defaults.rb
|