Class: JekyllI18nMultiPage::TranslateTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll_i18n_multi_page/translate_tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, translate_path, tokens) ⇒ TranslateTag

Returns a new instance of TranslateTag.



5
6
7
8
# File 'lib/jekyll_i18n_multi_page/translate_tag.rb', line 5

def initialize(tag_name, translate_path, tokens)
  super
  @translate_path = translate_path.strip
end

Instance Attribute Details

#markupObject

Returns the value of attribute markup.



3
4
5
# File 'lib/jekyll_i18n_multi_page/translate_tag.rb', line 3

def markup
  @markup
end

Instance Method Details

#render(context) ⇒ Object



10
11
12
# File 'lib/jekyll_i18n_multi_page/translate_tag.rb', line 10

def render(context)
  I18n.t(@translate_path, locale: context['page']['i18n_locale'])
end