Bugzilla – Attachment 4378 Details for
Bug 6464
Add inconsistence check for '%s' count in tmpl_process3.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Signed-off patch
0001-Bug-6464-Check-inconsistent-placeholders-in-translat.patch (text/plain), 1.80 KB, created by
Sébastien Marie
on 2011-06-06 13:21:02 UTC
(
hide
)
Description:
Signed-off patch
Filename:
MIME Type:
Creator:
Sébastien Marie
Created:
2011-06-06 13:21:02 UTC
Size:
1.80 KB
patch
obsolete
>From d0d7df75527420e2b0b2f124fbef8d15f9ff08c1 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Mon, 6 Jun 2011 14:43:21 +0200 >Subject: [PATCH] [SIGNED-OFF] Bug 6464 Check inconsistent placeholders in translated strings >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Display a warning for strings that don't have the same count of %s placeholders >that the English original strings. Don't warn for not translated string and >'fuzzy' string because those strings are not installed, and this is the >translator responsability to examine them. > >Based on Frère Sébastien Marie work. > >Signed-off-by: Frère Sébastien Marie <semarie-koha@latrappe.fr> >--- > misc/translator/tmpl_process3.pl | 15 +++++++++++++++ > 1 files changed, 15 insertions(+), 0 deletions(-) > >diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl >index 46ceceb..d862a97 100755 >--- a/misc/translator/tmpl_process3.pl >+++ b/misc/translator/tmpl_process3.pl >@@ -274,6 +274,21 @@ if (defined $href) { > # $charset_in = $candidate; > # } > # } >+ >+ # BUG6464: check consistency of PO messages >+ # - count number of '%s' in msgid and msgstr >+ for my $msg ( values %$href ) { >+ my $id_count = split(/%s/, $msg->{msgid}) - 1; >+ my $str_count = split(/%s/, $msg->{msgstr}) - 1; >+ next if $id_count == $str_count || >+ $msg->{msgstr} eq '""' || >+ grep { /fuzzy/ } @{$msg->{_flags}}; >+ warn_normal >+ "unconsistent %s count: ($id_count/$str_count):\n" . >+ " line: " . $msg->{loaded_line_number} . "\n" . >+ " msgid: " . $msg->{msgid} . "\n" . >+ " msgstr: " . $msg->{msgstr} . "\n", undef; >+ } > } > > # set our charset in to UTF-8 >-- >1.7.2.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 6464
:
4366
|
4373
|
4376
| 4378