localyzed 0.0.1.6 → 0.0.1.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ class ActionController::Base
|
|
26
26
|
if ( !request.xhr? && ( ( !request.path.match(/\/(en|fr)(\/|$)/) && Rails.env != 'test' ) || params[:locale] != I18n.locale.to_s) && request.method == 'GET')
|
27
27
|
flash.keep
|
28
28
|
redirect_to(url_for(params.merge(:locale => I18n.locale.to_s, :from_l => (params[:locale] if params[:locale]))), :status => :moved_permanently)
|
29
|
-
|
29
|
+
end
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
@@ -1,10 +1,10 @@
|
|
1
|
-
require 'rack/rewrite'
|
2
|
-
class Localyzed::Railtie < Rails::Railtie
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
1
|
+
# require 'rack/rewrite'
|
2
|
+
# class Localyzed::Railtie < Rails::Railtie
|
3
|
+
# initializer "localized2.configure" do |app|
|
4
|
+
# app.class.configure do
|
5
|
+
# config.middleware.insert_before(Rack::Lock, Rack::Rewrite) do
|
6
|
+
# r301 %r{(.*|)\/(en|fr)($|\?[^\\]*)}, '$1/$2/$3' # redirect '/en' to '/en/'
|
7
|
+
# end
|
8
|
+
# end
|
9
|
+
# end
|
10
|
+
# end
|
data/lib/localyzed/version.rb
CHANGED