mirror of https://github.com/rails/rails
update I18n fallbacks configuration to be compatible with i18n 1.1.0
This commit is contained in:
parent
17978719e4
commit
66614f6b67
1
Gemfile
1
Gemfile
|
@ -45,7 +45,6 @@ gem "dalli"
|
|||
gem "listen", ">= 3.0.5", "< 3.2", require: false
|
||||
gem "libxml-ruby", platforms: :ruby
|
||||
gem "connection_pool", require: false
|
||||
gem "i18n", "~> 1.0.1"
|
||||
|
||||
# for railties app_generator_test
|
||||
gem "bootsnap", ">= 1.1.0", require: false
|
||||
|
|
|
@ -274,7 +274,7 @@ GEM
|
|||
hiredis (0.6.1-java)
|
||||
http_parser.rb (0.6.0)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.0.1)
|
||||
i18n (1.1.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
image_processing (1.6.0)
|
||||
mini_magick (~> 4.0)
|
||||
|
@ -531,7 +531,6 @@ DEPENDENCIES
|
|||
ffi (<= 1.9.21)
|
||||
google-cloud-storage (~> 1.11)
|
||||
hiredis
|
||||
i18n (~> 1.0.1)
|
||||
image_processing (~> 1.2)
|
||||
json (>= 2.0.0)
|
||||
kindlerb (~> 1.2.0)
|
||||
|
|
|
@ -87,9 +87,21 @@ module I18n
|
|||
when Hash, Array
|
||||
Array.wrap(fallbacks)
|
||||
else # TrueClass
|
||||
[]
|
||||
[I18n.default_locale]
|
||||
end
|
||||
|
||||
if args.empty? || args.first.is_a?(Hash)
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
Using I18n fallbacks with an empty `defaults` sets the defaults to
|
||||
include the `default_locale`. This behavior will change in Rails 6.1.
|
||||
If you desire the default local to be included in the defaults, please
|
||||
explicitly configure it with `config.i18n.fallbacks.defaults =
|
||||
[I18n.default_locale]` or `config.i18n.fallbacks = [I18n.default_locale,
|
||||
{...}]`
|
||||
MSG
|
||||
args.unshift I18n.default_locale
|
||||
end
|
||||
|
||||
I18n.fallbacks = I18n::Locale::Fallbacks.new(*args)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue