Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.2 KB

i18n_lookup.md

File metadata and controls

38 lines (28 loc) · 1.2 KB

lookup for l10n / i18n

Debug i18n lookup for l10n / i18n strings

Installation

  • copy i18n_lookup.rb to app/config/initializers/i18n_lookup.rb

Usage

currently the variable ENV['I18N_DEBUG'] is disabled. Modify if needed. There is also a gem rails-i18n-debug use them if you don't want to patch manually.

Docs & Credits

Rspec - I18n Exception Handler

# add in spec/spec_helper.rb
# Raise an error if a tranlation key can not be found
class TestExceptionTranslationHandler
  def call(exception, locale, key, options)
    raise exception.message
  end
end
I18n.exception_handler = TestExceptionTranslationHandler.new