From 70e9a7ecd17cb4eae93b3572dd82e076a5ecdf5b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 18 Jun 2015 13:45:12 -0400 Subject: [PATCH] Fix po2localization so it ignores fuzzy translations (thanks, Francois!). 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. --- misc/po2localization.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/misc/po2localization.pl b/misc/po2localization.pl index 7a0bbf4..816b7f4 100755 --- a/misc/po2localization.pl +++ b/misc/po2localization.pl @@ -37,6 +37,7 @@ my $comment = ''; my $currentlang = ''; + my $fuzzy; while () { chomp; @@ -52,6 +53,10 @@ } next; } + if (/\A\#,.*\bfuzzy\b/) { + $fuzzy = 1; + next; + } next if /\A\#/; @@ -108,6 +113,7 @@ die("unexpected line: $_\n"); } } + $msgstr = '' if ($fuzzy); if ($template) { push @strings, $msgid; # This is a list, to keep original order. @@ -117,6 +123,7 @@ $msgstrs{$currentlang}{$msgid} = $msgstr; } } + $fuzzy = undef; } }