Sha256: 2e02e079121ef9e67854f0615fb938bb92f54b35ddf6a4c6f70574a865b6387e

Contents?: true

Size: 389 Bytes

Versions: 7

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module Bridgetown
  module Tags
    class TranslationTag < Liquid::Tag
      include Bridgetown::Filters::TranslationFilters

      def render(_context)
        input, options = @markup.split.map(&:strip)
        options ||= ""

        t(input, options).to_s
      end
    end
  end
end

Liquid::Template.register_tag("t", Bridgetown::Tags::TranslationTag)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bridgetown-core-2.0.0.beta3 lib/bridgetown-core/tags/t.rb
bridgetown-core-2.0.0.beta2 lib/bridgetown-core/tags/t.rb
bridgetown-core-2.0.0.beta1 lib/bridgetown-core/tags/t.rb
bridgetown-core-1.3.4 lib/bridgetown-core/tags/t.rb
bridgetown-core-1.3.3 lib/bridgetown-core/tags/t.rb
bridgetown-core-1.3.2 lib/bridgetown-core/tags/t.rb
bridgetown-core-1.3.1 lib/bridgetown-core/tags/t.rb