[open-ils-commits] [GIT] Evergreen ILS branch master updated. 03cb2f98abc0f1c3efa2b6062239d4a296f2d967

Evergreen Git git at git.evergreen-ils.org
Sat Sep 1 22:35:27 EDT 2012


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  03cb2f98abc0f1c3efa2b6062239d4a296f2d967 (commit)
      from  4fb4e3df754cc0e7437276a9db72c9b0be5ddba2 (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 03cb2f98abc0f1c3efa2b6062239d4a296f2d967
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sat Aug 4 10:10:48 2012 -0400

    TPAC: Add the ability to set a different default locale
    
    Installations with multiple sites might desire different default locales
    for their skins. This adds the Apache config directive
    "OILSWebDefaultLocale", which enables you to set the default locale on a
    global and a per-skin basis.
    
    Note that this prevents the browser Accept-language header from having
    any effect; sadly that header is not often used in real life.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Art Rhyno <art632000 at yahoo.ca>
    
    Conflicts:
    	Open-ILS/examples/apache/eg_vhost.conf
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/examples/apache/eg_vhost.conf b/Open-ILS/examples/apache/eg_vhost.conf
index c2b4cd2..81903c9 100644
--- a/Open-ILS/examples/apache/eg_vhost.conf
+++ b/Open-ILS/examples/apache/eg_vhost.conf
@@ -591,6 +591,9 @@ RewriteRule ^/openurl$ ${openurl:%1} [NE,PT]
     #PerlAddVar OILSWebLocale "fr_ca"
     #PerlAddVar OILSWebLocale "/openils/var/data/locale/fr-CA.po"
 
+    # Set the default locale: defaults to en-US
+    #PerlAddVar OILSWebDefaultLocale "fr_ca"
+    
     # Templates will be loaded from the following paths in reverse order.
     PerlAddVar OILSWebTemplatePath "/openils/var/templates"
     #PerlAddVar OILSWebTemplatePath "/openils/var/templates_localskin"
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
index 44c6018..cb65581 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
@@ -144,6 +144,7 @@ sub load_context {
     $ctx->{skin} = $cgi->cookie(OILS_HTTP_COOKIE_SKIN) || 'default';
     $ctx->{theme} = $cgi->cookie(OILS_HTTP_COOKIE_THEME) || 'default';
     $ctx->{proto} = $cgi->https ? 'https' : 'http';
+    my $default_locale = $r->dir_config('OILSWebDefaultLocale') || 'en_us';
 
     my @template_paths = uniq $r->dir_config->get('OILSWebTemplatePath');
     $ctx->{template_paths} = [ reverse @template_paths ];
@@ -167,8 +168,8 @@ sub load_context {
     }
 
     $ctx->{locale} = $set_locale ||
-        $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || 
-        parse_accept_lang($r->headers_in->get('Accept-Language')) || 'en_us';
+        $cgi->cookie(OILS_HTTP_COOKIE_LOCALE) || $default_locale ||
+        parse_accept_lang($r->headers_in->get('Accept-Language'));
 
     # set the editor default locale for each page load
     $OpenILS::Utils::CStoreEditor::default_locale = parse_eg_locale($ctx->{locale});

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

Summary of changes:
 Open-ILS/examples/apache/eg_vhost.conf         |    3 +++
 Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm |    5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list