aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/lookup_context.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-18 09:14:15 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-03-18 09:14:15 -0700
commiteb32b3659d3ead36e66efe8ef2ced126110311a4 (patch)
tree9a094954b449f9ce4f8960eb601d544a1f9314f6 /actionpack/lib/action_view/lookup_context.rb
parent4e7292c0262ae70d968e0732bb6fea627646feef (diff)
parentcecbf5dd4d814f0bbd6a7c77a7c550c90a75cf47 (diff)
downloadrails-eb32b3659d3ead36e66efe8ef2ced126110311a4.tar.gz
rails-eb32b3659d3ead36e66efe8ef2ced126110311a4.tar.bz2
rails-eb32b3659d3ead36e66efe8ef2ced126110311a4.zip
Merge pull request #9753 from jbarreneche/bug/render-locale-fallbacks
i18n locale fallback for localized views
Diffstat (limited to 'actionpack/lib/action_view/lookup_context.rb')
-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 }