Module: ActionView::Helpers::TranslationHelper
- Included in:
- ActionView::Helpers
- Defined in:
- lib/action_view/helpers/translation_helper.rb
Instance Method Summary collapse
- #localize(*args) ⇒ Object (also: #l)
- #translate(key, options = {}) ⇒ Object (also: #t)
Instance Method Details
#localize(*args) ⇒ Object Also known as: l
15 16 17 |
# File 'lib/action_view/helpers/translation_helper.rb', line 15 def localize(*args) I18n.localize *args end |
#translate(key, options = {}) ⇒ Object Also known as: t
6 7 8 9 10 11 12 |
# File 'lib/action_view/helpers/translation_helper.rb', line 6 def translate(key, = {}) [:raise] = true I18n.translate(key, ) rescue I18n::MissingTranslationData => e keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.[:scope]) content_tag('span', keys.join(', '), :class => 'translation_missing') end |