diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index ef3dba6075..e023a63c50 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -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 diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb index 5c5dabfbd0..094f65ad6c 100644 --- a/activesupport/lib/active_support/i18n_railtie.rb +++ b/activesupport/lib/active_support/i18n_railtie.rb @@ -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 diff --git a/guides/source/6_1_release_notes.md b/guides/source/6_1_release_notes.md index e3e1e09b39..5693f68251 100644 --- a/guides/source/6_1_release_notes.md +++ b/guides/source/6_1_release_notes.md @@ -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 diff --git a/railties/test/application/initializers/i18n_test.rb b/railties/test/application/initializers/i18n_test.rb index 8058052771..9936aadb46 100644 --- a/railties/test/application/initializers/i18n_test.rb +++ b/railties/test/application/initializers/i18n_test.rb @@ -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