3

In both apps there is config.i18n.fallbacks = true in application.rb:

Rails.version # "4.2.4"
Globalize.fallbacks # [:de]
I18n.fallbacks # { :de => [:de] }
Rails.application.config.i18n.fallbacks # nil

And:

Rails.version # "5.0.0.1"
Globalize # NameError: uninitialized constant Globalize
I18n.fallbacks # {}
Rails.application.config.i18n.fallbacks # nil

Unlike in v5.0.0.1, in v4.2.4 there is gem "globalize" in Gemfile. It's been added there with following commit message:

Upgrade to Rails 2.3.8.
    In the process, globalize2 is now updated and runs from a gem, not a plug in.

Unfortunately rails configuration doc for v2.3.8 doesn't say a word on it. In v5.0.0.1 this gem was never there (checked with git log -G'globalize' -- Gemfile).

In v4.2.4 the setting was added explicitely with the following context:

+    # https://github.com/svenfuchs/globalize3
+    config.i18n.fallbacks = true

Which makes sense as long as you have the globalize gem installed.

In v5.0.0.1 the setting was added by rails new on rails 3.1.0.rc1, so unless the gem has been re-implemented into rails, the setting has been a noop from the very beginning. Am I missing something?

In both cases, should I remove the setting from the application.rb, I18n throws this:

# I18n.fallbacks # NoMethodError: undefined method `fallbacks' for I18n:Module

I don't call the fallbacks anywhere in the apps other than setting it in the config files.

I'd like to find out:

  1. Is in v5.0.01 the fallbacks a dead setting, so I can safely remove it?
  2. Why Rails.application.config.i18n.fallbacks returns nil, despite being set in the configs?

I searched through docs (incl. changelogs) of Rails, I18n, and Globalize, but didn't find anything interesting.

medik
  • 910
  • 11
  • 15

0 Answers0