Bugzilla – Attachment 26478 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]
[SIGNED-OFF] Bug 11631 - Make translation toolchain ignore useless "translatable" strings that contain nothing but spaces and/or placeholders.
SIGNED-OFF-Bug-11631---Make-translation-toolchain-.patch (text/plain), 1.52 KB, created by
Bernardo Gonzalez Kriegel
on 2014-03-20 11:28:52 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11631 - Make translation toolchain ignore useless "translatable" strings that contain nothing but spaces and/or placeholders.
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-03-20 11:28:52 UTC
Size:
1.52 KB
patch
obsolete
>From 23bb7901c861fa3c6c53529154cf9c8b6ee1027d Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@pttk.fi> >Date: Wed, 29 Jan 2014 13:16:48 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 11631 - Make translation toolchain ignore > useless "translatable" strings that contain nothing but > spaces and/or placeholders. > >Test: >1) Update PO files of some lang, xx-YY-*po >cd misc/translator >perl translate update xx-YY >2) Do it again, just in case >3) rm po/xx-YY*po~ >4) Extract all msgid's, sorted >cat po/xx-YY*po | egrep "^msgid" | sort | uniq > xx-YY-pre >5) Apply the patch >6) Repeat 1-3 >7) Repeat 4 again, other file >cat po/xx-YY*po | egrep "^msgid" | sort | uniq > xx-YY-post >8) Do a diff, inspect results, only strings with %s and \s >diff xx-YY-pre xx-YY-post | less > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > 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 !~ /<!/){ > remember( $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