Ignore untranslated texts in check_po.pl

check_po.pl lists lots of false positives saying that
    msgstr ""
does not have the (h)otkey translated.

This patch whitelists those untranslated strings.

I also tested (by manually "breaking" a translation) that missing
hotkeys still get noticed.

This bug probably exists since forever, therefore I propose this patch
for 2.9..trunk. (OTOH, nobody noticed it, so maybe trunk is enough ;-)

Note: I still get a few false positives for ru.po (no idea why, similar
texts in the other languages don't cause this) - ideas and fixes welcome.
This commit is contained in:
Christian Boltz 2017-11-27 23:47:52 +01:00
parent 42bd81df01
commit 455489c9fe
Failed to generate hash of commit

View file

@ -38,7 +38,7 @@ sub check_po_for_shortcuts {
$msgid = $_;
}
if ( /^.*msgstr*/ && $looking_for_msgstr ) {
unless (/^.*msgstr.*\(\w{1}?\)*/) {
unless (/^.*msgstr.*\(\w{1}?\)*/ or /^msgstr ""$/) {
$errors->{$filename}{$line} = {
"msgid" => $msgid,
"msgstr" => $_,