10

You placed something like this in config/application.rb

I18n.enforce_available_locales = true                                        
config.i18n.load_path += Dir[Rails.root.join('config/locales/', '*.{rb,yml}').to_s]
config.i18n.available_locales = ['es-LA', :en]                               
config.i18n.default_locale = 'es-LA'

And the warning still appears:

[deprecated] I18n.enforce_available_locales will default to true in the future.
givanse
  • 14,503
  • 8
  • 51
  • 75
  • 1
    For others stumbling upon this with search, check the ruby on rails guides, configuring rails, i18n. This edge docs link has the latest: http://edgeguides.rubyonrails.org/configuring.html#configuring-i18n My app is still Rails 3.1 (yes, I know, get busy…) This new i18n deprecation slipped in with a minor update. – Douglas Lovell Mar 05 '14 at 17:45

1 Answers1

12

The reason is due to a bug with locales that have the language-country format. The good news is that it has been fixed already. This was reported in Github with Issue 13164 and fixed with pull request 229.

If you want to grab the latest code with the fix, update the gem like this:

Update your Gemfile with:

gem 'i18n', github: 'svenfuchs/i18n'

And then: bundle install

givanse
  • 14,503
  • 8
  • 51
  • 75
  • Will this somehow break the normal bundle mechanism? Do I have to do this, or will the error go away automatically after some time when I do `bundle update`? – Joshua Muheim Dec 15 '13 at 11:14
  • 1
    Your gem will be updated to whatever is the latest commit in the master repository, you'll keep on getting the latest code always. If you feel like a future update might break things, you can do it just once to get the relevant bug fix, and then delete the github part in the Gemfile. – givanse Dec 15 '13 at 12:19
  • 1
    Probably the error will go away after a `bundle update`, provided you don't have a version lock or the likes. I don't know when this could be, most likely until a new version of the gem comes out. – givanse Dec 15 '13 at 12:36