Skip to content

Commit

Permalink
po2msg: ignore entries marked with "fuzzy"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Shawn O. Pearce committed Nov 1, 2007
1 parent ab0d33c commit f94872d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions po/po2msg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ for {set i 1} {$i < $argc} {incr i} {
}

proc flush_msg {} {
global msgid msgstr mode lang out
global msgid msgstr mode lang out fuzzy

if {![info exists msgid] || $mode == ""} {
return
}
set mode ""
if {$fuzzy == 1} {
set fuzzy 0
return
}

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

set fuzzy 0
foreach file $files {
regsub "^.*/\(\[^/\]*\)\.po$" $file "$output_directory\\1.msg" outfile
set in [open $file "r"]
Expand All @@ -73,7 +78,11 @@ foreach file $files {
set mode ""
while {[gets $in line] >= 0} {
if {[regexp "^#" $line]} {
flush_msg
if {[regexp ", fuzzy" $line]} {
set fuzzy 1
} else {
flush_msg
}
continue
} elseif {[regexp "^msgid \"(.*)\"$" $line dummy match]} {
flush_msg
Expand Down

0 comments on commit f94872d

Please sign in to comment.