From 0cdb52436b4ca3d3977a0d304f6077d58074256d Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Fri, 21 Mar 2014 10:22:23 -0300 Subject: [PATCH] Bug 11631 - Followup to extend and compile pattern This followup extendes and compile the pattern to test for useless strings To test: Same procedure as signed patch Ammended patch, there is already a place for this check --- misc/translator/xgettext.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl index bd1706d..c12be44 100755 --- a/misc/translator/xgettext.pl +++ b/misc/translator/xgettext.pl @@ -37,6 +37,7 @@ sub string_negligible_p ($) { || $t =~ /^\d+$/ # purely digits || $t =~ /^[-\+\.,:;!\?'"%\(\)\[\]\|]+$/ # punctuation w/o context || $t =~ /^[A-Za-z]$/ # single letters + || $t =~ /^(›|%%|%s|\s|\d|\.|,|;|:|\?|\!|\*|#|-|\+|x|=|~|<|>|\||\/|\\|\(|\)|\[|\]|\{|\}|"|')*$/ # placeholder & punct. ) } @@ -91,10 +92,6 @@ 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 !~ /