Bugzilla – Attachment 71094 Details for
Bug 20115
Languages appear in a different order in the footer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20115: Set the languages order with the pref values
Bug-20115-Set-the-languages-order-with-the-pref-va.patch (text/plain), 1.62 KB, created by
Jonathan Druart
on 2018-01-31 18:17:09 UTC
(
hide
)
Description:
Bug 20115: Set the languages order with the pref values
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-01-31 18:17:09 UTC
Size:
1.62 KB
patch
obsolete
>From 4a2a094e3418bc9da864eeaefad562c11e4dd00e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 31 Jan 2018 13:47:37 -0300 >Subject: [PATCH] Bug 20115: Set the languages order with the pref values > >To avoid the languages to be ordered randomly, it is better to stick on >a default order. >Let's suppose that the order in the pref is correct. >--- > C4/Languages.pm | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/C4/Languages.pm b/C4/Languages.pm >index 5e4dabd14d..1958c91628 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -342,8 +342,18 @@ sub _build_languages_arrayref { > push ( @{ $language_groups->{$language_subtags_hashref->{language}} }, $language_subtags_hashref ); > } > # $key is a language subtag like 'en' >- while( my ($key, $value) = each %$language_groups) { > >+ my %idx = map { $enabled_languages->[$_] => $_ } reverse 0 .. @$enabled_languages-1; >+ my @ordered_keys = sort { >+ my $aa = $language_groups->{$a}->[0]->{rfc4646_subtag}; >+ my $bb = $language_groups->{$b}->[0]->{rfc4646_subtag}; >+ ( exists $idx{$aa} and exists $idx{$bb} and ( $idx{$aa} cmp $idx{$bb} ) ) >+ || ( exists $idx{$aa} and exists $idx{$bb} ) >+ || exists $idx{$bb} >+ } keys %$language_groups; >+ >+ for my $key ( @ordered_keys ) { >+ my $value = $language_groups->{$key}; > # is this language group enabled? are any of the languages within it enabled? > my $enabled; > for my $enabled_language (@enabled_languages) { >-- >2.11.0
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 20115
:
71094
|
71095
|
71096
|
71661
|
73027
|
73028
|
73029
|
73030
|
73433
|
73610
|
73611
|
73612
|
73613
|
73614