instance method
translate
Ruby on Rails 2.2.3
Since v2.2.3Signature
translate(key, options = {})
No documentation comment.
Parameters
-
keyreq -
optionsopt = {}
Source
# File actionpack/lib/action_view/helpers/translation_helper.rb, line 6
def translate(key, options = {})
options[:raise] = true
I18n.translate(key, options)
rescue I18n::MissingTranslationData => e
keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
content_tag('span', keys.join(', '), :class => 'translation_missing')
end
Defined in actionpack/lib/action_view/helpers/translation_helper.rb line 6
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::TranslationHelper