spree_change_locale 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock
CHANGED
@@ -1,50 +1,50 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spree_change_locale (0.5.
|
4
|
+
spree_change_locale (0.5.3)
|
5
5
|
http_accept_language (~> 1.0)
|
6
6
|
spree_core (>= 0.70.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (3.1.
|
12
|
-
actionpack (= 3.1.
|
11
|
+
actionmailer (3.1.3)
|
12
|
+
actionpack (= 3.1.3)
|
13
13
|
mail (~> 2.3.0)
|
14
|
-
actionpack (3.1.
|
15
|
-
activemodel (= 3.1.
|
16
|
-
activesupport (= 3.1.
|
14
|
+
actionpack (3.1.3)
|
15
|
+
activemodel (= 3.1.3)
|
16
|
+
activesupport (= 3.1.3)
|
17
17
|
builder (~> 3.0.0)
|
18
18
|
erubis (~> 2.7.0)
|
19
19
|
i18n (~> 0.6)
|
20
|
-
rack (~> 1.3.
|
20
|
+
rack (~> 1.3.5)
|
21
21
|
rack-cache (~> 1.1)
|
22
22
|
rack-mount (~> 0.8.2)
|
23
23
|
rack-test (~> 0.6.1)
|
24
|
-
sprockets (~> 2.0.
|
24
|
+
sprockets (~> 2.0.3)
|
25
25
|
activemerchant (1.17.0)
|
26
26
|
activesupport (>= 2.3.11)
|
27
27
|
braintree (>= 2.0.0)
|
28
28
|
builder (>= 2.0.0)
|
29
29
|
json (>= 1.5.1)
|
30
|
-
activemodel (3.1.
|
31
|
-
activesupport (= 3.1.
|
30
|
+
activemodel (3.1.3)
|
31
|
+
activesupport (= 3.1.3)
|
32
32
|
builder (~> 3.0.0)
|
33
33
|
i18n (~> 0.6)
|
34
|
-
activerecord (3.1.
|
35
|
-
activemodel (= 3.1.
|
36
|
-
activesupport (= 3.1.
|
34
|
+
activerecord (3.1.3)
|
35
|
+
activemodel (= 3.1.3)
|
36
|
+
activesupport (= 3.1.3)
|
37
37
|
arel (~> 2.2.1)
|
38
38
|
tzinfo (~> 0.3.29)
|
39
|
-
activeresource (3.1.
|
40
|
-
activemodel (= 3.1.
|
41
|
-
activesupport (= 3.1.
|
42
|
-
activesupport (3.1.
|
39
|
+
activeresource (3.1.3)
|
40
|
+
activemodel (= 3.1.3)
|
41
|
+
activesupport (= 3.1.3)
|
42
|
+
activesupport (3.1.3)
|
43
43
|
multi_json (~> 1.0)
|
44
44
|
acts_as_list (0.1.4)
|
45
45
|
archive-tar-minitar (0.5.2)
|
46
46
|
arel (2.2.1)
|
47
|
-
braintree (2.13.
|
47
|
+
braintree (2.13.1)
|
48
48
|
builder (>= 2.0.0)
|
49
49
|
builder (3.0.0)
|
50
50
|
capybara (1.0.1)
|
@@ -57,7 +57,7 @@ GEM
|
|
57
57
|
childprocess (0.2.2)
|
58
58
|
ffi (~> 1.0.6)
|
59
59
|
cocaine (0.2.0)
|
60
|
-
columnize (0.3.
|
60
|
+
columnize (0.3.5)
|
61
61
|
cucumber (1.0.6)
|
62
62
|
builder (>= 2.1.2)
|
63
63
|
diff-lcs (>= 1.1.2)
|
@@ -77,14 +77,14 @@ GEM
|
|
77
77
|
erubis (2.7.0)
|
78
78
|
faker (1.0.0)
|
79
79
|
i18n (~> 0.4)
|
80
|
-
ffi (1.0.
|
80
|
+
ffi (1.0.11)
|
81
81
|
gherkin (2.4.21)
|
82
82
|
json (>= 1.4.6)
|
83
|
-
highline (1.
|
83
|
+
highline (1.6.2)
|
84
84
|
hike (1.2.1)
|
85
85
|
http_accept_language (1.0.2)
|
86
86
|
i18n (0.6.0)
|
87
|
-
jquery-rails (1.0.
|
87
|
+
jquery-rails (1.0.19)
|
88
88
|
railties (~> 3.0)
|
89
89
|
thor (~> 0.14)
|
90
90
|
json (1.6.1)
|
@@ -125,17 +125,17 @@ GEM
|
|
125
125
|
rack
|
126
126
|
rack-test (0.6.1)
|
127
127
|
rack (>= 1.0)
|
128
|
-
rails (3.1.
|
129
|
-
actionmailer (= 3.1.
|
130
|
-
actionpack (= 3.1.
|
131
|
-
activerecord (= 3.1.
|
132
|
-
activeresource (= 3.1.
|
133
|
-
activesupport (= 3.1.
|
128
|
+
rails (3.1.3)
|
129
|
+
actionmailer (= 3.1.3)
|
130
|
+
actionpack (= 3.1.3)
|
131
|
+
activerecord (= 3.1.3)
|
132
|
+
activeresource (= 3.1.3)
|
133
|
+
activesupport (= 3.1.3)
|
134
134
|
bundler (~> 1.0)
|
135
|
-
railties (= 3.1.
|
136
|
-
railties (3.1.
|
137
|
-
actionpack (= 3.1.
|
138
|
-
activesupport (= 3.1.
|
135
|
+
railties (= 3.1.3)
|
136
|
+
railties (3.1.3)
|
137
|
+
actionpack (= 3.1.3)
|
138
|
+
activesupport (= 3.1.3)
|
139
139
|
rack-ssl (~> 1.3.2)
|
140
140
|
rake (>= 0.8.7)
|
141
141
|
rdoc (~> 3.4)
|
@@ -170,24 +170,24 @@ GEM
|
|
170
170
|
ruby-debug-base19 (>= 0.11.19)
|
171
171
|
ruby_core_source (0.1.5)
|
172
172
|
archive-tar-minitar (>= 0.5.2)
|
173
|
-
rubyzip (0.9.
|
174
|
-
selenium-webdriver (2.
|
173
|
+
rubyzip (0.9.5)
|
174
|
+
selenium-webdriver (2.13.0)
|
175
175
|
childprocess (>= 0.2.1)
|
176
|
-
ffi (
|
176
|
+
ffi (~> 1.0.9)
|
177
177
|
json_pure
|
178
178
|
rubyzip
|
179
|
-
spree_core (0.70.
|
179
|
+
spree_core (0.70.3)
|
180
180
|
activemerchant (= 1.17.0)
|
181
181
|
acts_as_list (= 0.1.4)
|
182
182
|
deface (>= 0.7.0)
|
183
183
|
faker (= 1.0.0)
|
184
|
-
highline (= 1.
|
184
|
+
highline (= 1.6.2)
|
185
185
|
jquery-rails (>= 1.0.14)
|
186
186
|
kaminari (>= 0.12.4)
|
187
187
|
meta_search (= 1.1.1)
|
188
188
|
nested_set (= 1.6.8)
|
189
189
|
paperclip (= 2.4.1)
|
190
|
-
rails (
|
190
|
+
rails (>= 3.1.1, <= 3.1.3)
|
191
191
|
rd_find_by_param (= 0.1.1)
|
192
192
|
rd_resource_controller
|
193
193
|
state_machine (= 1.0.1)
|
@@ -1,14 +1,6 @@
|
|
1
1
|
class LocaleController < Spree::BaseController
|
2
2
|
def set
|
3
|
-
|
4
|
-
session["user_return_to"] = request.referer
|
5
|
-
end
|
6
|
-
if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
|
7
|
-
session[:locale] = I18n.locale = params[:locale].to_sym
|
8
|
-
# flash.notice = t(:locale_changed)
|
9
|
-
# else
|
10
|
-
# flash[:error] = t(:locale_not_changed)
|
11
|
-
end
|
3
|
+
session[:locale] = I18n.locale = params[:locale].to_sym if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
|
12
4
|
redirect_back_or_default(params[:return_path] ? "/#{params[:return_path]}" : root_path)
|
13
5
|
end
|
14
6
|
end
|
@@ -1,10 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe LocaleController do
|
4
|
-
# it "should use Spree::BaseController" do
|
5
|
-
# controller.should be_an_instance_of(Spree::BaseController)
|
6
|
-
# end
|
7
|
-
|
8
4
|
it "should redirect to index with session[:locale] set to :es" do
|
9
5
|
session[:locale].should be_nil
|
10
6
|
get 'set', :locale => 'es'
|
@@ -19,8 +15,13 @@ describe LocaleController do
|
|
19
15
|
response.should redirect_to(root_path)
|
20
16
|
end
|
21
17
|
|
22
|
-
it "should give url for Spanish" do
|
18
|
+
it "should give root url for Spanish" do
|
23
19
|
{ :get => "/es" }.should route_to(:controller => "locale", :action => "set", :locale => "es")
|
20
|
+
end
|
21
|
+
it "should give cart url for Spanish" do
|
22
|
+
{ :get => "/es/cart" }.should route_to(:controller => "locale", :action => "set", :locale => "es", :return_path => "cart")
|
23
|
+
end
|
24
|
+
it "should not give root url for Russian" do
|
24
25
|
{ :get => "/ru" }.should_not route_to(:controller => "locale", :action => "set", :locale => "es")
|
25
26
|
end
|
26
27
|
end
|
data/spree_change_locale.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_change_locale'
|
5
|
-
s.version = '0.5.
|
5
|
+
s.version = '0.5.3'
|
6
6
|
s.summary = 'Easy locale change for Spree'
|
7
7
|
s.description = 'Easy locale change for Spree'
|
8
8
|
s.required_ruby_version = '>= 1.8.7'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: spree_change_locale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- humancopy
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-11-
|
13
|
+
date: 2011-11-27 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: spree_core
|