method
missing_translation
v8.1.1 -
Show latest stable
- Class:
ActionView::Helpers::TranslationHelper
missing_translation(key, options)private
No documentation available.
# File actionview/lib/action_view/helpers/translation_helper.rb, line 142
def missing_translation(key, options)
locale = options[:locale] || I18n.locale
i18n_exception = I18n::MissingTranslation.new(locale, key, options)
I18n.exception_handler.call(i18n_exception, locale, key, options)
keys = I18n.normalize_keys(locale, key, options[:scope])
title = +"translation missing: #{keys.join(".")}"
options.each do |name, value|
unless name == :scope
title << ", " << name.to_s << ": " << ERB::Util.html_escape(value)
end
end
if ActionView::Base.debug_missing_translation
content_tag("span", keys.last.to_s.titleize, class: "translation_missing", title: title)
else
title
end
end