Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails I18n validation deprecation warning, after setting enforce_available_locales = true

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.
like image 430
givanse Avatar asked Dec 10 '13 05:12

givanse


1 Answers

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

like image 177
givanse Avatar answered Jan 03 '23 23:01

givanse