Sha256: b881c049cd9152553a82fa57dd491a4485372e6886345a338f00e90768e4ca29
Contents?: true
Size: 822 Bytes
Versions: 9
Compression:
Stored size: 822 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) } scoped_keys = keys.map { |key| [options[:scope], key].compact.join(".") } 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) #{scoped_keys.inspect}") keys.each do |key| Localeapp.missing_translations.add(locale, key, nil, options || {}) end [locale, scoped_keys].join(', ') else Localeapp.log('Raising exception') raise end end end end I18n.exception_handler = Localeapp::ExceptionHandler
Version data entries
9 entries across 9 versions & 1 rubygems