From d579a7ce703773f236a1b7d7f0828a45427b5787 Mon Sep 17 00:00:00 2001 From: hukl Date: Fri, 20 Feb 2009 09:10:57 +0100 Subject: fix for routing filter and helpers, need to talk to svenfuchs about that ;) hardcoded default_locale within the plugin and not considering globbed routes as it seems --- vendor/plugins/routing-filter/lib/routing_filter/locale.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vendor/plugins') 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' module RoutingFilter class Locale < Base - @@default_locale = :en + @@default_locale = :he cattr_reader :default_locale class << self @@ -26,7 +26,9 @@ module RoutingFilter locale = args.extract_options!.delete(:locale) || I18n.locale returning yield do |result| if locale.to_sym != @@default_locale - result.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } + if result.respond_to?(:sub) + result.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } + end end end end -- cgit v1.3