Sha256: 1c305e1e7aa72b99e00c62e0e6dfab5e6d6b0200356fccb08baa755cd2eac390

Contents?: true

Size: 490 Bytes

Versions: 21

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module I18n::Tasks
  module HtmlKeys
    HTML_KEY_PATTERN = /[.\-_]html\z/
    MAYBE_PLURAL_HTML_KEY_PATTERN = /[.\-_]html\.[^.]+\z/

    def html_key?(full_key, locale)
      # rubocop:disable Style/DoubleNegation
      !!(full_key =~ HTML_KEY_PATTERN ||
          full_key =~ MAYBE_PLURAL_HTML_KEY_PATTERN &&
              depluralize_key(split_key(full_key, 2)[1], locale) =~ HTML_KEY_PATTERN)
      # rubocop:enable Style/DoubleNegation
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
i18n-tasks-0.9.13 lib/i18n/tasks/html_keys.rb