diff options
author | Lachlan Sylvester <lachlan.sylvester@publicisfrontfoot.com.au> | 2018-08-10 14:28:40 +1000 |
---|---|---|
committer | Lachlan Sylvester <lachlan.sylvester@hypothetical.com.au> | 2018-08-23 06:56:42 +1000 |
commit | 66614f6b67402ec526a699760d1c21c586834da8 (patch) | |
tree | 97192d381239939dcf35b83ce9610e43a1e63834 /activesupport/lib | |
parent | 17978719e4f1d3de6e3d1a00e4cd7a2116802f53 (diff) | |
download | rails-66614f6b67402ec526a699760d1c21c586834da8.tar.gz rails-66614f6b67402ec526a699760d1c21c586834da8.tar.bz2 rails-66614f6b67402ec526a699760d1c21c586834da8.zip |
update I18n fallbacks configuration to be compatible with i18n 1.1.0
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/i18n_railtie.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb index 93bde57f6a..c07eb5b569 100644 --- a/activesupport/lib/active_support/i18n_railtie.rb +++ b/activesupport/lib/active_support/i18n_railtie.rb @@ -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 |