lib/inflections/railtie.rb in inflections-3.2.9.20121206 vs lib/inflections/railtie.rb in inflections-3.2.11

- old
+ new

@@ -1,14 +1,16 @@ module Inflections class Railtie < Rails::Railtie - begin - config.to_prepare do + initializer 'inflections.require_inflections' do + begin require "inflections/#{Rails.configuration.i18n.default_locale}" - end - rescue LoadError => e - config.to_prepare do - warn "Inflections currently does not support #{Rails.configuration.i18n.default_locale}. Defaulting to English (en)." - require 'inflections/en' + rescue LoadError => e + if Rails.configuration.i18n.default_locale.nil? + warn "Inflections: no default locale set. Defaulting to English (en)." + else + warn "Inflections: no support for #{Rails.configuration.i18n.default_locale}. Defaulting to English (en)." + require 'inflections/en' + end end end end end