src/po_parser.ry in gettext-3.4.7 vs src/po_parser.ry in gettext-3.4.8
- old
+ new
@@ -262,11 +262,15 @@
comment << "\n" if comments.last.empty?
comment
end
def on_comment(comment)
- @fuzzy = true if (/fuzzy/ =~ comment)
+ if comment.start_with?(POFormat::FLAG_MARK)
+ content = comment[POFormat::FLAG_MARK.size..-1]
+ flags = parse_flags_line(content)
+ @fuzzy = flags.include?("fuzzy")
+ end
if @data.instance_of?(PO)
if comment == "#"
@translator_comments << ""
elsif /\A(#.)\s*(.*)\z/ =~ comment
mark = $1
@@ -277,11 +281,11 @@
when POFormat::EXTRACTED_COMMENT_MARK
@extracted_comments << content
when POFormat::REFERENCE_COMMENT_MARK
@references.concat(parse_references_line(content))
when POFormat::FLAG_MARK
- @flags.concat(parse_flags_line(content))
+ @flags.concat(flags)
when POFormat::PREVIOUS_COMMENT_MARK
@previous << content
else
@comments << comment
end
@@ -346,10 +350,10 @@
def parse_references_line(line)
line.split(/\s+/)
end
def parse_flags_line(line)
- line.split(/\s+/)
+ line.split(",").collect(&:strip)
end
def clear
@translator_comments = []
@extracted_comments = []