summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/admin_helper.rb4
-rw-r--r--vendor/plugins/routing-filter/lib/routing_filter/locale.rb6
2 files changed, 6 insertions, 4 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index 7122584f..c230797b 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -3,9 +3,9 @@ module AdminHelper
3 def language_selector 3 def language_selector
4 case I18n.locale 4 case I18n.locale
5 when :de 5 when :de
6 link_to 'Deutsch', edit_node_path(@node, :locale => :en) 6 link_to 'English', url_for(:locale => :en)
7 when :en 7 when :en
8 link_to 'Deutsch', :locale => :de, :controller => params[:controller], :action => params[:action] 8 link_to 'Deutsch', url_for(:locale => :de)
9 end 9 end
10 end 10 end
11end \ No newline at end of file 11end \ No newline at end of file
diff --git a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb
index b7fcc31f..0aa6adcc 100644
--- a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb
+++ b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb
@@ -3,7 +3,7 @@ require 'routing_filter/base'
3 3
4module RoutingFilter 4module RoutingFilter
5 class Locale < Base 5 class Locale < Base
6 @@default_locale = :en 6 @@default_locale = :he
7 cattr_reader :default_locale 7 cattr_reader :default_locale
8 8
9 class << self 9 class << self
@@ -26,7 +26,9 @@ module RoutingFilter
26 locale = args.extract_options!.delete(:locale) || I18n.locale 26 locale = args.extract_options!.delete(:locale) || I18n.locale
27 returning yield do |result| 27 returning yield do |result|
28 if locale.to_sym != @@default_locale 28 if locale.to_sym != @@default_locale
29 result.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } 29 if result.respond_to?(:sub)
30 result.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" }
31 end
30 end 32 end
31 end 33 end
32 end 34 end