Module: Bridgetown::Filters::TranslationFilters

Included in:
Bridgetown::Filters, Tags::TranslationTag
Defined in:
lib/bridgetown-core/filters/translation_filters.rb

Instance Method Summary collapse

Instance Method Details

#t(input, options = "") ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/bridgetown-core/filters/translation_filters.rb', line 6

def t(input, options = "")
  options = string_to_hash(options)
  locale = options.delete(:locale)
  count = options.delete(:count)
  options[:count] = count.to_i unless count.nil?

  I18n.t(input.to_s, locale: locale, **options)
rescue ArgumentError
  input
end