Class: JekyllI18nMultiPage::TranslateTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- JekyllI18nMultiPage::TranslateTag
- Defined in:
- lib/jekyll_i18n_multi_page/translate_tag.rb
Instance Attribute Summary collapse
-
#markup ⇒ Object
Returns the value of attribute markup.
Instance Method Summary collapse
-
#initialize(tag_name, translate_path, tokens) ⇒ TranslateTag
constructor
A new instance of TranslateTag.
- #render(context) ⇒ Object
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
#markup ⇒ Object
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 |