Module: ActionView::Helpers::TranslationHelper
- Defined in:
- lib/translate_monkey_patch.rb,
lib/translate_monkey_patch.rb
Instance Method Summary collapse
Instance Method Details
#include_i18n_tools ⇒ Object
30 31 |
# File 'lib/translate_monkey_patch.rb', line 30 def include_i18n_tools end |
#old_translate ⇒ Object
13 |
# File 'lib/translate_monkey_patch.rb', line 13 alias :old_translate :translate |
#translate(*args) ⇒ Object Also known as: t
15 16 17 18 19 20 21 |
# File 'lib/translate_monkey_patch.rb', line 15 def translate(*args) key = [*args].first key = I18n.locale.to_s + '.' + key.to_s translation = old_translate(*args) translation = " " if translation.blank? '<span id="'+key+'" class="i18n-translation">' + translation + '</span>' end |