View | Details | Raw Unified | Return to bug 11631
Collapse All | Expand All

(-)a/misc/translator/xgettext.pl (-5 / +3 lines)
Lines 87-100 sub string_list () { Link Here
87
87
88
sub text_extract (*) {
88
sub text_extract (*) {
89
    my($h) = @_;
89
    my($h) = @_;
90
    # Compiled pattern to ignore useless strings
91
    my $useless = qr/^(&rsaquo;|%%|%s|\s|\d|\.|,|;|:|\?|\!|\*|#|-|\+|x|=|~|<|>|\||\/|\\|\(|\)|\[|\]|\{|\}|"|')*$/;
90
    for (;;) {
92
    for (;;) {
91
        my $s = TmplTokenizer::next_token $h;
93
        my $s = TmplTokenizer::next_token $h;
92
        last unless defined $s;
94
        last unless defined $s;
93
        my($kind, $t, $attr) = ($s->type, $s->string, $s->attributes);
95
        my($kind, $t, $attr) = ($s->type, $s->string, $s->attributes);
94
        my $tmpt = $t;
96
        next if ( $t =~ $useless );
95
        # If msgid contains only placeholders and/or spaces, ignore it
96
        $tmpt =~ s/(%s|\s)//g;
97
        next if ($tmpt eq "");
98
97
99
        if ($kind eq C4::TmplTokenType::TEXT) {
98
        if ($kind eq C4::TmplTokenType::TEXT) {
100
	    if ($t =~ /\S/s && $t !~ /<!/){
99
	    if ($t =~ /\S/s && $t !~ /<!/){
101
- 

Return to bug 11631