Module: Releaf::HumanizeMissingTranslations

Defined in:
lib/releaf/humanize_missing_translations.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.initialize_component ⇒ Object



10
11
12
# File 'lib/releaf/humanize_missing_translations.rb', line 10

def self.initialize_component
  I18n.exception_handler.extend(self)
end

Instance Method Details

#call(exception, locale, key, options) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/releaf/humanize_missing_translations.rb', line 2

def call(exception, locale, key, options)
  if key.present? && exception.is_a?(I18n::MissingTranslation)
    key.to_s.split('.').last.humanize
  else
    super
  end
end