[Ruby on Rails 5] config.i18n.fallbacks の BREAKING CHANGE について

`bundle install` 後に表示された i18n に関する警告について調査。

– Rails 5.2.4.1

“`prettyprinted
HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

If you are upgrading your Rails application from an older version of Rails:

Please check your Rails app for ‘config.i18n.fallbacks = true’.
If you’re using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 'config.i18n.fallbacks = [I18n.default_locale]'. If not, fallbacks will be broken in your app by I18n 1.1.x. If you are starting a NEW Rails application, you can ignore this notice. For more info see: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 ``` 指示された情報を確認すると BREAKING CHANGE: Fallbacks とのこと。 > [Release v1.1.0 · ruby-i18n/i18n](https://github.com/ruby-i18n/i18n/releases/tag/v1.1.0)

`rails new` したファイルを確認すると config/environments/production.rb は下記のようになっています。

“`ruby:config/environments/production.rb
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
“`

これを `config.i18n.fallbacks = [I18n.default_locale]` に変更しないと Fallback に失敗する組合せがあるという事ですかね。

config/application.rb に設定しているこんな値を見てくれるようです。

“`ruby:config/application.rb
config.i18n.default_locale = :ja
“`

## 補遺

> – [Rails 国際化 (i18n) API – Railsガイド](https://railsguides.jp/i18n.html)
> – [ruby – gemのインストール中の警告文について – スタック・オーバーフロー](https://ja.stackoverflow.com/questions/56915/gem%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E4%B8%AD%E3%81%AE%E8%AD%A6%E5%91%8A%E6%96%87%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6)