Module: ActionView::Helpers::TranslationHelper

Included in:
ActionView::Helpers
Defined in:
lib/action_view/helpers/translation_helper.rb

Instance Method Summary collapse

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, 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])
  ('span', keys.join(', '), :class => 'translation_missing')
end