Sha256: fdfed85e14ece41ec4cc481f495461a628b4a230958ca91e4c155fef22ca3832
Contents?: true
Size: 753 Bytes
Versions: 11
Compression:
Stored size: 753 Bytes
Contents
# A simple exception handler that behaves like the default exception handler # but also raises on missing translations. # # Useful for identifying missing translations during testing. # # E.g. # # require 'globalize/i18n/missing_translations_raise_handler # I18n.exception_handler = :missing_translations_raise_handler module I18n class << self def missing_translations_raise_handler(exception, locale, key, options) raise exception end end # self.exception_handler = :missing_translations_raise_handler end I18n.exception_handler = :missing_translations_raise_handler ActionView::Helpers::TranslationHelper.module_eval do def translate(key, options = {}) I18n.translate(key, options) end alias :t :translate end
Version data entries
11 entries across 11 versions & 4 rubygems