aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJuan Barreneche <snipperme@gmail.com>2013-03-14 18:02:20 -0300
committerJuan Manuel Barreneche <snipperme@gmail.com>2013-03-16 21:27:13 -0300
commitcecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47 (patch)
treee0ee7bb041b2728ca27ca83a85d8c51c4d11278e /actionpack/lib
parentfeaa6e2048fe86bcf07e967d6e47b865e42e055b (diff)
downloadrails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.tar.gz
rails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.tar.bz2
rails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.zip
Include I18n fallbacks in :locale lookup context
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/lookup_context.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/lookup_context.rb b/actionpack/lib/action_view/lookup_context.rb
index 4e4816d983..d61cc0f304 100644
--- a/actionpack/lib/action_view/lookup_context.rb
+++ b/actionpack/lib/action_view/lookup_context.rb
@@ -43,7 +43,13 @@ module ActionView
module Accessors #:nodoc:
end
- register_detail(:locale) { [I18n.locale, I18n.default_locale].uniq }
+ register_detail(:locale) do
+ locales = [I18n.locale]
+ locales.concat(I18n.fallbacks[I18n.locale]) if I18n.respond_to? :fallbacks
+ locales << I18n.default_locale
+ locales.uniq!
+ locales
+ end
register_detail(:formats) { ActionView::Base.default_formats || [:html, :text, :js, :css, :xml, :json] }
register_detail(:handlers){ Template::Handlers.extensions }