Include default locale in fallbacks explicitly

We were getting a warning because it won't be included by default in
Rails 6.1:

DEPRECATION WARNING: 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,
{...}] `.
This commit is contained in:
Javi Martín
2021-09-18 14:10:42 +02:00
parent 7c8e3788ec
commit 19da667478

View File

@@ -97,7 +97,7 @@ module Consul
"zh-CN", "zh-CN",
"zh-TW"] "zh-TW"]
config.i18n.available_locales = available_locales config.i18n.available_locales = available_locales
config.i18n.fallbacks = { config.i18n.fallbacks = [I18n.default_locale, {
"ca" => "es", "ca" => "es",
"es-PE" => "es", "es-PE" => "es",
"eu" => "es", "eu" => "es",
@@ -107,7 +107,7 @@ module Consul
"oc" => "fr", "oc" => "fr",
"pt-BR" => "es", "pt-BR" => "es",
"val" => "es" "val" => "es"
} }]
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**[^custom]*", "*.{rb,yml}")] config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**[^custom]*", "*.{rb,yml}")]
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "custom", "**", "*.{rb,yml}")] config.i18n.load_path += Dir[Rails.root.join("config", "locales", "custom", "**", "*.{rb,yml}")]