Bugzilla – Attachment 5712 Details for
Bug 6958
Missing spaces in translated templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 6958 : Fix for leading spaces being stripped on translation
0001-SIGNED-OFF-Bug-6958-Fix-for-leading-spaces-being-str.patch (text/plain), 1.87 KB, created by
Katrin Fischer
on 2011-10-05 05:59:14 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 6958 : Fix for leading spaces being stripped on translation
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-10-05 05:59:14 UTC
Size:
1.87 KB
patch
obsolete
>From dd67085d6e0063f3d871df94714d001973831c58 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chrisc@catalyst.net.nz> >Date: Tue, 4 Oct 2011 10:43:45 +1300 >Subject: [PATCH] [SIGNED-OFF] Bug 6958 : Fix for leading spaces being stripped on translation > >This will re-add any leading spaces, so formatting is not messed > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >- all examples from the bug report are fixed now >- verified system preferences are still translated >- verified xslt displays are still translated >- verified javascript alerts are still translated >- verified switching languages works >--- > misc/translator/tmpl_process3.pl | 21 ++++++++++++++------- > 1 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/misc/translator/tmpl_process3.pl b/misc/translator/tmpl_process3.pl >index 988e18b..cb69117 100755 >--- a/misc/translator/tmpl_process3.pl >+++ b/misc/translator/tmpl_process3.pl >@@ -35,14 +35,21 @@ sub find_translation ($) { > my($s) = @_; > my $key = $s; > if ($s =~ /\S/s) { >- $key = TmplTokenizer::string_canon($key); >- $key = TmplTokenizer::charset_convert($key, $charset_in, $charset_out); >- $key = TmplTokenizer::quote_po($key); >+ $key = TmplTokenizer::string_canon($key); >+ $key = TmplTokenizer::charset_convert($key, $charset_in, $charset_out); >+ $key = TmplTokenizer::quote_po($key); >+ } >+ if (defined $href->{$key} && !$href->{$key}->fuzzy && length Locale::PO->dequote($href->{$key}->msgstr)){ >+ if ($s =~ /^(\s+)/){ >+ return $1 . Locale::PO->dequote($href->{$key}->msgstr); >+ } >+ else { >+ return Locale::PO->dequote($href->{$key}->msgstr); >+ } >+ } >+ else { >+ return $s; > } >- return defined $href->{$key} >- && !$href->{$key}->fuzzy >- && length Locale::PO->dequote($href->{$key}->msgstr)? >- Locale::PO->dequote($href->{$key}->msgstr): $s; > } > > sub text_replace_tag ($$) { >-- >1.7.4.1 >
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 6958
:
5707
| 5712