Sha256: a15e7463ac0f96feb0e759b808a78bb01f35af7c29122b97abee5ea66047de53

Contents?: true

Size: 358 Bytes

Versions: 43

Compression:

Stored size: 358 Bytes

Contents

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

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
releaf-i18n_database-3.1.0 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-3.0.3 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-3.0.2 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-3.0.1 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-3.0.0 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.2.1 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.2.0 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.1.2 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.1.1 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.1.0 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.0.1 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-2.0.0 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.22 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.21 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.20 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.19 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.18 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.17 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.16 lib/releaf/i18n_database/humanize_missing_translations.rb
releaf-i18n_database-1.1.15 lib/releaf/i18n_database/humanize_missing_translations.rb