mirror of
https://github.com/github/rails.git
synced 2026-01-09 14:48:08 -05:00
Extract hardcoded lists to Redo::RestaurantsList
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
## unreleased ##
|
||||
|
||||
* Include I18n locale fallbacks in view lookup.
|
||||
Fixes GH#3512.
|
||||
|
||||
*Juan Barreneche*
|
||||
|
||||
* Fix incorrectly appended square brackets to a multiple select box
|
||||
if an explicit name has been given and it already ends with "[]".
|
||||
|
||||
|
||||
@@ -44,7 +44,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) { Mime::SET.symbols }
|
||||
register_detail(:handlers){ Template::Handlers.extensions }
|
||||
|
||||
|
||||
@@ -19,4 +19,13 @@ class LocalizedTemplatesTest < ActionController::TestCase
|
||||
get :hello_world
|
||||
assert_equal "Hello World", @response.body
|
||||
end
|
||||
|
||||
def test_use_fallback_locales
|
||||
I18n.locale = :"de-AT"
|
||||
I18n.backend.class.send(:include, I18n::Backend::Fallbacks)
|
||||
I18n.fallbacks[:"de-AT"] = [:de]
|
||||
|
||||
get :hello_world
|
||||
assert_equal "Gutten Tag", @response.body
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user