[open-ils-commits] [GIT] Evergreen ILS branch master updated. 25f8ba16c8825e42c3a154b61b3ee0b0b4a6ab10

Evergreen Git git at git.evergreen-ils.org
Tue Feb 5 23:06:29 EST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  25f8ba16c8825e42c3a154b61b3ee0b0b4a6ab10 (commit)
      from  828b202a99b5cc97fcea53a0409f298acc3bd546 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 25f8ba16c8825e42c3a154b61b3ee0b0b4a6ab10
Author: Dan Scott <dscott at laurentian.ca>
Date:   Mon Jan 21 17:02:42 2013 -0500

    TPAC: Make locale picker match default locale
    
    As noted by Pasi Kallinen, the language picker would not reflect the
    chosen locale unless your cookie had been set or there was an explicit
    CGI parameter with the locale name.
    
    Accordingly, get the default locale from the context vars and use that
    to set the selected value for the language picker in the absence of
    anything else, to prevent the picker from possibly confusingly showing
    the first language alphabetically rather than the currently displayed
    language in the rest of the UI.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Pasi Kallinen <pasi.kallinen at pttk.fi>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/opac/parts/locale_picker.tt2 b/Open-ILS/src/templates/opac/parts/locale_picker.tt2
index c81f1f1..12019cd 100644
--- a/Open-ILS/src/templates/opac/parts/locale_picker.tt2
+++ b/Open-ILS/src/templates/opac/parts/locale_picker.tt2
@@ -1,5 +1,10 @@
 [%- IF ctx.locales.keys.size > 1;
-    set_locale = CGI.param('set_eg_locale') || CGI.cookie('eg_locale');
+
+    # Ensure the context locale is in xx_yy format
+    base_locale = ctx.locale FILTER lower;
+    base_locale = base_locale.replace('-','_');
+
+    set_locale = CGI.param('set_eg_locale') || CGI.cookie('eg_locale') || base_locale;
 %]
 <form id="locale_picker_form" action="[% mkurl() %]" method="post">
     <label for="locale_picker">[% l("Language:") %]</label>

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/opac/parts/locale_picker.tt2     |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list