cubesystems/releaf

View on GitHub
releaf-i18n_database/lib/releaf/i18n_database/humanize_missing_translations.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Releaf::I18nDatabase
  module HumanizeMissingTranslations
    def call(exception, locale, key, options)
      if key.present? && exception.is_a?(I18n::MissingTranslation)
        key.to_s.split('.').last.humanize
      else
        super
      end
    end

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