Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty
This commit is contained in:
parent
64efe502f3
commit
4bd56f4428
|
@ -1,3 +1,7 @@
|
|||
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
* Remove entries from local cache on `RedisCacheStore#delete_matched`
|
||||
|
||||
Fixes #38627
|
||||
|
|
|
@ -102,19 +102,6 @@ module I18n
|
|||
[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 locale 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,
|
||||
{...}]`. If you want to opt-in to the new behavior, use
|
||||
`config.i18n.fallbacks.defaults = [nil, {...}]`.
|
||||
MSG
|
||||
args.unshift I18n.default_locale
|
||||
end
|
||||
|
||||
I18n.fallbacks = I18n::Locale::Fallbacks.new(*args)
|
||||
end
|
||||
|
||||
|
|
|
@ -284,6 +284,8 @@ Please refer to the [Changelog][active-support] for detailed changes.
|
|||
|
||||
### Removals
|
||||
|
||||
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
||||
|
||||
### Deprecations
|
||||
|
||||
### Notable changes
|
||||
|
|
|
@ -237,7 +237,7 @@ fr:
|
|||
test "config.i18n.fallbacks.map = { :ca => :'es-ES' } initializes fallbacks with a mapping ca => es-ES" do
|
||||
I18n::Railtie.config.i18n.fallbacks.map = { ca: :'es-ES' }
|
||||
load_app
|
||||
assert_fallbacks ca: [:ca, :"es-ES", :es, :en]
|
||||
assert_fallbacks ca: [:ca, :"es-ES", :es]
|
||||
end
|
||||
|
||||
test "[shortcut] config.i18n.fallbacks = [:'en-US'] initializes fallbacks with en-US as a fallback default" do
|
||||
|
@ -249,7 +249,7 @@ fr:
|
|||
test "[shortcut] config.i18n.fallbacks = [{ :ca => :'es-ES' }] initializes fallbacks with a mapping ca => es-ES" do
|
||||
I18n::Railtie.config.i18n.fallbacks = [{ ca: :'es-ES' }]
|
||||
load_app
|
||||
assert_fallbacks ca: [:ca, :"es-ES", :es, :en]
|
||||
assert_fallbacks ca: [:ca, :"es-ES", :es]
|
||||
end
|
||||
|
||||
test "[shortcut] config.i18n.fallbacks = [:'en-US', { :ca => :'es-ES' }] initializes fallbacks with the given arguments" do
|
||||
|
|
Loading…
Reference in New Issue