grosser/get_pomo — pull request #3 by fotanus (2013-02-18 17:11:03+00:00)
Title: Improving PO handling according to PO definition

Hi,

This request takes in consideration the PO file definition from here:
http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

It have three commits, which I'll detail bellow

1) Keep the # on comments line start
Per definition, the comments might have different meanings according to the character after the "#", like translator-comments, reference or flag.

Since we are using only one field for comments, I suggest keep the hash in comments because it will make more sense for the user grep for "^#:" than for "^:".

A possible way to extend this in the future is split the comments in categories, in different attributes, and add a method "comments" that just concatenate all comment types.

2) Fixed fuzzy regexp to behavior as definition
Because of the standard above, "# fuzzy" is only a translator comment (quite funny, actually), but "#, fuzzy" is the tag fuzzy. So this fixes the regexp used by fuzzy? method

3) fuzzy? method now returns a boolean
Fuzzy returned a number or nil. It makes more sense return a boolean. One way to achieve this is by double negating the expression.