From 19da667478f22f794f0c71aef7f462abbbae7506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 18 Sep 2021 14:10:42 +0200 Subject: [PATCH] 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, {...}] `. --- config/application.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 4702a0715..d18d64a15 100644 --- a/config/application.rb +++ b/config/application.rb @@ -97,7 +97,7 @@ module Consul "zh-CN", "zh-TW"] config.i18n.available_locales = available_locales - config.i18n.fallbacks = { + config.i18n.fallbacks = [I18n.default_locale, { "ca" => "es", "es-PE" => "es", "eu" => "es", @@ -107,7 +107,7 @@ module Consul "oc" => "fr", "pt-BR" => "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}")]