From cf0b4aa1d50a2b7328ba4c03ad77d6400eb7e190 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 29 Jan 2014 13:16:48 +0200 Subject: [PATCH 2/2] Make translation toolchain ignore useless "translatable" strings that contain nothing but spaces and/or placeholders. --- misc/translator/xgettext.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index 032117d..bd1706d 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -91,6 +91,11 @@ sub text_extract (*) { my $s = TmplTokenizer::next_token $h; last unless defined $s; my($kind, $t, $attr) = ($s->type, $s->string, $s->attributes); + my $tmpt = $t; + # If msgid contains only placeholders and/or spaces, ignore it + $tmpt =~ s/(%s|\s)//g; + next if ($tmpt eq ""); + if ($kind eq C4::TmplTokenType::TEXT) { if ($t =~ /\S/s && $t !~ /