Is i18n globalize fallbacks in Rails 5 a noop?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Is i18n globalize fallbacks in Rails 5 a noop?

Maciej Kalisz
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](http://guides.rubyonrails.org/v2.3.8/configuring.html) 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](https://github.com/globalize/globalize#i18n-fallbacks-for-empty-translations) 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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c221a2b5-ba3d-4c5c-ac65-f82e3e28c2b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.