Last Updated: February 25, 2016
·
1.612K
· yaotti

Raise error on "translation missing"

module I18n
  def self.just_raise_that_exception(*args)
    Rails.logger.error args.first
    raise "i18n: #{args.first}" unless Rails.env.production?
  end
end
I18n.exception_handler = :just_raise_that_exception

Modify the code here Ruby on Rails Guides: Rails Internationalization (I18n) API not to raise error on production and log errors.