Module: I18nHoverKeys::Overrides

Defined in:
lib/i18n_hover_keys/overrides.rb

Instance Method Summary collapse

Instance Method Details

#translate(key, **options) ⇒ Object Also known as: t



3
4
5
6
7
8
# File 'lib/i18n_hover_keys/overrides.rb', line 3

def translate(key, **options)
  translation = super(key, **options)
  return translation unless translation.is_a?(String)

  "<span data-i18n-key='#{key}'>#{translation}</span>".html_safe
end