Bugzilla – Attachment 5707 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]
Bug 6958 : Fix for leading spaces being stripped on translation
Bug-6958--Fix-for-leading-spaces-being-stripped-on.patch (text/plain), 1.57 KB, created by
Chris Cormack
on 2011-10-04 20:37:49 UTC
(
hide
)
Description:
Bug 6958 : Fix for leading spaces being stripped on translation
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2011-10-04 20:37:49 UTC
Size:
1.57 KB
patch
obsolete
>From c5823023653b09b3a2312335a538f9b6afec27d3 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] Bug 6958 : Fix for leading spaces being stripped on translation > >This will re-add any leading spaces, so formatting is not messed >--- > 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