diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-10-28 08:43:51 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-10-28 08:43:51 +0000 |
commit | f22131bce2513e7cd58bdf6f7fecc60eebcfd89d (patch) | |
tree | ae66bcc72ea261331bee042f0a0aa62e5a054bac /lib | |
parent | 0c3bee857b1b6a0a114d319f8722d25ae59166bd (diff) | |
parent | 5bb459de4ba327e54c97c75bf4ea660cc909efd4 (diff) |
Merge branch 'fix_transient_locale_integration_errors' into rails-3-develop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/alaveteli_localization.rb | 1 | ||||
-rw-r--r-- | lib/routing_filters.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/alaveteli_localization.rb b/lib/alaveteli_localization.rb index 6daab124a..2b6978c92 100644 --- a/lib/alaveteli_localization.rb +++ b/lib/alaveteli_localization.rb @@ -7,6 +7,7 @@ class AlaveteliLocalization I18n.locale = default_locale I18n.available_locales = available_locales.map { |locale_name| locale_name.to_sym } I18n.default_locale = default_locale + RoutingFilter::Conditionallyprependlocale.locales = available_locales end def set_default_text_domain(name, path) diff --git a/lib/routing_filters.rb b/lib/routing_filters.rb index a9a62b8db..5b5da6870 100644 --- a/lib/routing_filters.rb +++ b/lib/routing_filters.rb @@ -22,5 +22,13 @@ module RoutingFilter prepend_segment!(result, locale) if prepend_locale?(locale) end end + + # Reset the locale pattern when the locales are set. + class << self + def locales=(locales) + @@locales_pattern = nil + @@locales = locales.map(&:to_sym) + end + end end end |