class Card::Set::I18nScanner

Public Instance Methods

scan_file(path) click to toggle source

@return [Array<[absolute key, Results::Occurrence]>]

# File lib/card/set/i18n_scanner.rb, line 10
def scan_file path
  text = read_file(path)

  text.scan(/[^\w._-]tr[( ]\s*["':](\w+)/).map do |_match|
    occurrence = occurrence_from_position(
      path, text, Regexp.last_match.offset(0).first
    )
    [absolute_key(".#{_match[0]}", path), occurrence]
  end
end