Class: Jekyll::LocalizeTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::LocalizeTag
- Includes:
- FastGettext::Translation
- Defined in:
- lib/jekyll/gettext/plugin.rb
Instance Method Summary collapse
-
#initialize(tag_name, key, tokens) ⇒ LocalizeTag
constructor
A new instance of LocalizeTag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, key, tokens) ⇒ LocalizeTag
Returns a new instance of LocalizeTag.
108 109 110 111 |
# File 'lib/jekyll/gettext/plugin.rb', line 108 def initialize(tag_name, key, tokens) super @key = key.strip end |
Instance Method Details
#render(context) ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/jekyll/gettext/plugin.rb', line 113 def render(context) candidate = _(@key) if candidate == "" candidate = @key end candidate end |