diff options
author | Juan Barreneche <snipperme@gmail.com> | 2013-03-14 18:02:20 -0300 |
---|---|---|
committer | Juan Manuel Barreneche <snipperme@gmail.com> | 2013-03-16 21:27:13 -0300 |
commit | cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47 (patch) | |
tree | e0ee7bb041b2728ca27ca83a85d8c51c4d11278e /actionpack/lib/action_view | |
parent | feaa6e2048fe86bcf07e967d6e47b865e42e055b (diff) | |
download | rails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.tar.gz rails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.tar.bz2 rails-cecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47.zip |
Include I18n fallbacks in :locale lookup context
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/lookup_context.rb | 8 |
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 } |