1 # frozen_string_literal: true
3 require "better_html/tree/tag"
4 require "active_support/core_ext/string/inflections"
8 # A customised version of the HardCodedString linter, adding `·` as not needing translation
9 # Checks for hardcoded strings. Useful if you want to ensure a string can be translated using i18n.
10 class CustomHardCodedString < HardCodedString
11 include LinterRegistry
13 NO_TRANSLATION_NEEDED = Set.new([
44 def check_string?(str)
45 string = str.gsub(/\s*/, "")
46 string.length > 1 && !NO_TRANSLATION_NEEDED.include?(string)