Bugzilla – Attachment 26512 Details for
Bug 11631
Make translation toolchain ignore useless translatable strings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11631 - Followup to extend and compile pattern
Bug-11631---Followup-to-extend-and-compile-pattern.patch (text/plain), 1.30 KB, created by
Bernardo Gonzalez Kriegel
on 2014-03-21 13:32:33 UTC
(
hide
)
Description:
Bug 11631 - Followup to extend and compile pattern
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-03-21 13:32:33 UTC
Size:
1.30 KB
patch
obsolete
>From d8b22f654ecd34018f921fd0b81e9606f1f3ef78 Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >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 >--- > misc/translator/xgettext.pl | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > >diff --git a/misc/translator/xgettext.pl b/misc/translator/xgettext.pl >index bd1706d..5f0e9c7 100755 >--- a/misc/translator/xgettext.pl >+++ b/misc/translator/xgettext.pl >@@ -87,14 +87,13 @@ sub string_list () { > > sub text_extract (*) { > my($h) = @_; >+ # Compiled pattern to ignore useless strings >+ my $useless = qr/^(›|%%|%s|\s|\d|\.|,|;|:|\?|\!|\*|#|-|\+|x|=|~|<|>|\||\/|\\|\(|\)|\[|\]|\{|\}|"|')*$/; > for (;;) { > 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 ""); >+ next if ( $t =~ $useless ); > > if ($kind eq C4::TmplTokenType::TEXT) { > if ($t =~ /\S/s && $t !~ /<!/){ >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11631
:
24859
|
26478
|
26492
|
26512
|
26522
|
26834
|
27522
|
27527
|
27659
|
27660