From 3e0674b9cbf1c7fac851a4510e1d1638195da46c Mon Sep 17 00:00:00 2001 From: Hleb Valoshka <375gnu@gmail.com> Date: Thu, 14 Feb 2019 21:27:51 +0300 Subject: [PATCH] Don't add empty strings to translations --- po/extract_resource_strings.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/extract_resource_strings.pl b/po/extract_resource_strings.pl index 507aa5b07..04da6877a 100755 --- a/po/extract_resource_strings.pl +++ b/po/extract_resource_strings.pl @@ -23,10 +23,10 @@ my %keywords = ( while (<>) { # Matches lines: # KEYWORD "String" ... - if ( $_ =~ /^\s*(\w+)\s+"(.+?)"/ ) { + if ( $_ =~ /^\s*(\w+)\s+"(.+?)"/ && $_ !~ /^\s*(\w+)\s+""/) { # Excludes blank strings and strings of the form word followed by digit # which are control names (e.g. DateTimePicker3) - if (exists($keywords{$1}) && $2 !~ /^ *$/ && $2 !~ /^\w+\d$/ ) { + if (exists($keywords{$1}) && $2 !~ /^ *$/ && $2 !~ /^\w+\d$/ && $2 !~ /^""/) { print qq{_("$2");\n}; } }