Skip to content

Commit

Permalink
Fix po2localization so it ignores fuzzy translations (thanks, Francoi…
Browse files Browse the repository at this point in the history
…s!).

In the best case they could totally break the installation (e.g. if they
contain a '%s'), and in the worst case they could make dialogs or
buttons incomprehensible or misleading.
  • Loading branch information
icculus committed Jun 18, 2015
1 parent 094b56d commit 70e9a7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions misc/po2localization.pl
Expand Up @@ -37,6 +37,7 @@

my $comment = '';
my $currentlang = '';
my $fuzzy;

while (<POIO>) {
chomp;
Expand All @@ -52,6 +53,10 @@
}
next;
}
if (/\A\#,.*\bfuzzy\b/) {
$fuzzy = 1;
next;
}

next if /\A\#/;

Expand Down Expand Up @@ -108,6 +113,7 @@
die("unexpected line: $_\n");
}
}
$msgstr = '' if ($fuzzy);

if ($template) {
push @strings, $msgid; # This is a list, to keep original order.
Expand All @@ -117,6 +123,7 @@
$msgstrs{$currentlang}{$msgid} = $msgstr;
}
}
$fuzzy = undef;
}
}

Expand Down

0 comments on commit 70e9a7e

Please sign in to comment.