Skip to content

Commit f94872d

Browse files
dschospearce
authored andcommitted
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>
1 parent ab0d33c commit f94872d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

po/po2msg.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@ for {set i 1} {$i < $argc} {incr i} {
4848
}
4949

5050
proc flush_msg {} {
51-
global msgid msgstr mode lang out
51+
global msgid msgstr mode lang out fuzzy
5252

5353
if {![info exists msgid] || $mode == ""} {
5454
return
5555
}
5656
set mode ""
57+
if {$fuzzy == 1} {
58+
set fuzzy 0
59+
return
60+
}
5761

5862
if {$msgid == ""} {
5963
set prefix "set ::msgcat::header"
@@ -64,6 +68,7 @@ proc flush_msg {} {
6468
puts $out "$prefix \"[u2a $msgstr]\""
6569
}
6670

71+
set fuzzy 0
6772
foreach file $files {
6873
regsub "^.*/\(\[^/\]*\)\.po$" $file "$output_directory\\1.msg" outfile
6974
set in [open $file "r"]
@@ -73,7 +78,11 @@ foreach file $files {
7378
set mode ""
7479
while {[gets $in line] >= 0} {
7580
if {[regexp "^#" $line]} {
76-
flush_msg
81+
if {[regexp ", fuzzy" $line]} {
82+
set fuzzy 1
83+
} else {
84+
flush_msg
85+
}
7786
continue
7887
} elseif {[regexp "^msgid \"(.*)\"$" $line dummy match]} {
7988
flush_msg

0 commit comments

Comments
 (0)