lib/i18n/tasks/scanners/pattern_scanner.rb in i18n-tasks-0.7.4 vs lib/i18n/tasks/scanners/pattern_scanner.rb in i18n-tasks-0.7.5
- old
+ new
@@ -13,10 +13,11 @@
text = opts[:text] || read_file(path)
text.scan(pattern) do |match|
src_pos = Regexp.last_match.offset(0).first
key = match_to_key(match, path)
next unless valid_key?(key, strict)
+ key = key + ':' if key.end_with?('.')
location = src_location(path, text, src_pos)
unless exclude_line?(location[:line])
keys << [key, data: location]
end
end
@@ -37,10 +38,9 @@
# @param [MatchData] match
# @param [String] path
# @return [String] full absolute key name
def match_to_key(match, path)
key = strip_literal(match[0])
- key = key + '*' if key.end_with?('.')
key = absolutize_key(key, path) if path && key.start_with?('.')
key
end
def pattern