Bugzilla – Attachment 23128 Details for
Bug 11263
New 'locale' setting in subscriptions is not user friendly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11263: locale setting is not user friendly
Bug-11263-locale-setting-is-not-user-friendly.patch (text/plain), 5.52 KB, created by
Jonathan Druart
on 2013-11-25 08:26:43 UTC
(
hide
)
Description:
Bug 11263: locale setting is not user friendly
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-25 08:26:43 UTC
Size:
5.52 KB
patch
obsolete
>From 544d48b07f340b97e59d5a9dd8ee2f9258b5033e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 19 Nov 2013 14:21:38 +0100 >Subject: [PATCH] Bug 11263: locale setting is not user friendly > >The locales list for subscriptions should not be retrieve from the >locales of the system. >This patch retrieves the locales list from the Koha DB (in the same way as >pref language and opaclanguages). > >Test plan: >Edit a subscription (or a numbering pattern) and verify the list of >languages is the same as languages available in Koha. >Note: with this patch we loose the saeson translation, it is >normal. See report linked. >--- > .../prog/en/modules/serials/subscription-add.tt | 8 ++++---- > .../en/modules/serials/subscription-numberpatterns.tt | 2 +- > serials/subscription-add.pl | 17 ++++++++--------- > serials/subscription-numberpatterns.pl | 13 +++++++------ > 4 files changed, 20 insertions(+), 20 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 713b3b1..57c0b59 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -707,14 +707,14 @@ $(document).ready(function() { > <select id="locale" name="locale"> > <option value=""></option> > [% FOREACH l IN locales %] >- [% IF l == locale %] >- <option value="[% l %]" selected="selected">[% l %]</option> >+ [% IF l.language == locale %] >+ <option value="[% l.language %]" selected="selected">[% l.description %]</option> > [% ELSE %] >- <option value="[% l %]">[% l %]</option> >+ <option value="[% l.language %]">[% l.description %]</option> > [% END %] > [% END %] > </select> >- <span class="hint">If empty, system locale is used</span> >+ <span class="hint">If empty, English is used</span> > </li> > <li id="more_options"> > <table id="moreoptionst"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >index 686cdc8..932b54f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt >@@ -231,7 +231,7 @@ function show_blocking_subs() { > <option value="[% locale %]">[% locale %]</option> > [% END %] > </select> >- <span class="hint">If empty, system locale is used</span> >+ <span class="hint">If empty, English is used</span> > </li> > </ol> > <table> >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 552b65b..2761dfc 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -215,15 +215,14 @@ if ($op eq 'addsubscription') { > } > $template->param(numberpatterns => \@numberpatternloop); > >- # Get installed locales >- # FIXME this will not work with all environments. >- # If call to locale fails, @locales will be an empty array, which is fine. >- my @locales = map { >- chomp; >- # we don't want POSIX and C locales >- /^C|^POSIX$/ ? () : $_ >- } `locale -a`; >- $template->param(locales => \@locales); >+ my $languages = [ map { >+ { >+ language => $_->{language}, >+ description => $_->{native_description} || $_->{language} >+ } >+ } @{ C4::Languages::getTranslatedLanguages() } ]; >+ >+ $template->param( locales => $languages ); > > output_html_with_http_headers $query, $cookie, $template->output; > } >diff --git a/serials/subscription-numberpatterns.pl b/serials/subscription-numberpatterns.pl >index c2a9800..065ab01 100755 >--- a/serials/subscription-numberpatterns.pl >+++ b/serials/subscription-numberpatterns.pl >@@ -105,17 +105,18 @@ if($op && ($op eq 'new' || $op eq 'modify')) { > my @frequencies = GetSubscriptionFrequencies(); > my @subtypes; > push @subtypes, { value => $_ } for (qw/ issues weeks months /); >- my @locales = map { >- chomp; >- /^C|^POSIX$/ ? () : $_ >- } `locale -a`; >+ my $languages = [ map { >+ { >+ language => $_->{language}, >+ description => $_->{native_description} || $_->{language} >+ } >+ } @{ C4::Languages::getTranslatedLanguages() } ]; > > $template->param( > $op => 1, > frequencies_loop => \@frequencies, > subtypes_loop => \@subtypes, >- locales => \@locales, >- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), >+ locales => $languages, > ); > output_html_with_http_headers $input, $cookie, $template->output; > exit; >-- >1.7.10.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 11263
:
22990
|
23032
|
23128
|
23131
|
23472
|
23478