Sha256: fe0d009e44a1ec6c37b1e52e9d50ea26a1c3b9d2d6e4e150e96c7c0037b79e1a

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

module Archangel
  module Liquid
    module Tags
      ##
      # Locale custom tag for Liquid
      #
      # Example
      #   {% locale %} #=> "en"
      #
      class LocaleTag < ApplicationTag
        ##
        # Render the locale for the theme
        #
        # @param context [Object] the Liquid context
        # @return [String] the locale
        #
        # :reek:UtilityFunction
        def render(context)
          context.registers[:view].locale
        end
      end
    end
  end
end

::Liquid::Template.register_tag("locale", Archangel::Liquid::Tags::LocaleTag)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
archangel-0.3.0 lib/archangel/liquid/tags/locale_tag.rb