Rails I18n validation deprecation warning

后端 未结 5 1292
时光取名叫无心
时光取名叫无心 2020-11-30 16:02

I just updated to rails 4.0.2 and I\'m getting this warning:

[deprecated] I18n.enforce_available_locales will default to true in the future. If you re

5条回答
  •  [愿得一人]
    2020-11-30 17:03

    Just for completeness, note that you can also get rid of the warning by setting I18n.enforce_available_locales to true (or false) in config/application.rb:

    require File.expand_path('../boot', __FILE__)
    .
    .
    .
    module SampleApp
      class Application < Rails::Application
        .
        .
        .
        I18n.enforce_available_locales = true
        .
        .
        .
      end
    end
    

提交回复
热议问题