# File lib/validates_timeliness.rb, line 37 def load_error_messages defaults = YAML::load(IO.read(LOCALE_PATH))['en'] ValidatesTimeliness::Validator.error_value_formats = defaults['validates_timeliness']['error_value_formats'].symbolize_keys if defined?(I18n) I18n.load_path.unshift(LOCALE_PATH) I18n.reload! else errors = defaults['activerecord']['errors']['messages'].inject({}) {|h,(k,v)| h[k.to_sym] = v.gsub(/\{\{\w*\}\}/, '%s');h } ::ActiveRecord::Errors.default_error_messages.update(errors) end end