@matheusbsbs / matheus-bagliano / commits / f94872dfc1
Fork 0

po2msg: ignore entries marked with "fuzzy"

As Christian Stimming pointed out, entries which are "fuzzy" need to be checked by human translators, and cannot be used. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Johannes Schindelin committed Oct 30, 2007 at 11:24 UTC f94872dfc18c2670c9eb4ed8528ba45943213f39
1 file changed +11 -2
po/po2msg.sh
+11 -2
@@ -48,12 +48,16 @@ for {set i 1} {$i < $argc} {incr i} {
48 }
49
50 proc flush_msg {} {
51 - global msgid msgstr mode lang out
51 + global msgid msgstr mode lang out fuzzy
52
53 if {![info exists msgid] || $mode == ""} {
54 return
55 }
56 set mode ""
57 + if {$fuzzy == 1} {
58 + set fuzzy 0
59 + return
60 + }
61
62 if {$msgid == ""} {
63 set prefix "set ::msgcat::header"
@@ -64,6 +68,7 @@ proc flush_msg {} {
68 puts $out "$prefix \"[u2a $msgstr]\""
69 }
70
71 +set fuzzy 0
72 foreach file $files {
73 regsub "^.*/\(\[^/\]*\)\.po$" $file "$output_directory\\1.msg" outfile
74 set in [open $file "r"]
@@ -73,7 +78,11 @@ foreach file $files {
78 set mode ""
79 while {[gets $in line] >= 0} {
80 if {[regexp "^#" $line]} {
76 - flush_msg
81 + if {[regexp ", fuzzy" $line]} {
82 + set fuzzy 1
83 + } else {
84 + flush_msg
85 + }
86 continue
87 } elseif {[regexp "^msgid \"(.*)\"$" $line dummy match]} {
88 flush_msg