Bugzilla – Attachment 64283 Details for
Bug 18634
Missing empty line at end of opac.pref / colliding translated preference sections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18634: Handle colliding translation for preference sections
Bug-18634-Handle-colliding-translation-for-prefere.patch (text/plain), 1.79 KB, created by
Marcel de Rooy
on 2017-06-14 13:41:57 UTC
(
hide
)
Description:
Bug 18634: Handle colliding translation for preference sections
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-06-14 13:41:57 UTC
Size:
1.79 KB
patch
obsolete
>From 02ccd498ea3b043eebf5cb1f29814b45db0a9c89 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 14 Jun 2017 15:37:55 +0200 >Subject: [PATCH] Bug 18634: Handle colliding translation for preference > sections >Content-Type: text/plain; charset=utf-8 > >Problem on this report was caused by translating the tabs Privacy >and Payments by the same string. This caused overwriting a hash entry. > >This patch tests if the key already exists and if so, it merges the >entries instead of overwriting the old contents. > >Test plan: >[1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee. >[2] Run translate install fr-CA (or the language you altered) >[3] Without this patch you should loose preferences from either Privacy or > Payments. With this patch, they should be merged. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested with fr-CA. >--- > misc/translator/LangInstaller.pm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm >index 683897d..460a448 100644 >--- a/misc/translator/LangInstaller.pm >+++ b/misc/translator/LangInstaller.pm >@@ -336,7 +336,12 @@ sub install_prefs { > my $id = $self->{file} . " $section"; > my $text = $self->get_trans_text($id); > my $nsection = $text ? $text : $section; >- $ntab->{$nsection} = $tab_content->{$section}; >+ if( exists $ntab->{$nsection} ) { >+ # When translations collide (see BZ 18634) >+ push @{$ntab->{$nsection}}, @{$tab_content->{$section}}; >+ } else { >+ $ntab->{$nsection} = $tab_content->{$section}; >+ } > } > $pref->{$tab} = $ntab; > } >-- >2.1.4
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 18634
:
63550
|
63655
|
63656
|
63660
|
63690
|
64267
|
64268
|
64283
|
64414
|
64843
|
64844