Sha256: 89daed52a426d4edfc7d2a88c93f4a1260cc6bf05b56b36d7c3ceb72981a2aa4
Contents?: true
Size: 728 Bytes
Versions: 7
Compression:
Stored size: 728 Bytes
Contents
module Localeapp class ExceptionHandler def self.call(exception, locale, key_or_keys, options) keys = Array(key_or_keys).map { |key| ERB::Util.html_escape(key.to_s) } Localeapp.log(exception.message) # Which exact exception is set up by our i18n shims if exception.is_a? Localeapp::I18nMissingTranslationException Localeapp.log("Detected missing translation for key(s) #{keys.inspect}") keys.each do |key| Localeapp.missing_translations.add(locale, key, nil, options || {}) end [locale, keys].join(', ') else Localeapp.log('Raising exception') raise end end end end I18n.exception_handler = Localeapp::ExceptionHandler
Version data entries
7 entries across 7 versions & 1 rubygems