Module: Liquid::Rails::TranslateFilter

Defined in:
lib/liquid4-rails/filters/translate_filter.rb

Instance Method Summary collapse

Instance Method Details

#translate(key, options = {}) ⇒ Object Also known as: t



4
5
6
7
8
# File 'lib/liquid4-rails/filters/translate_filter.rb', line 4

def translate(key, options={})
  options = { 'locale' => ::I18n.locale.to_s }.merge(options)

  @context.registers[:view].translate(key.to_s, options.with_indifferent_access)
end