Pass EG-compliant locale string to TT context user/berick/staff-web-ui-idl-locale
authorBill Erickson <berick@esilibrary.com>
Tue, 10 Sep 2013 19:08:46 +0000 (15:08 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 10 Sep 2013 19:08:46 +0000 (15:08 -0400)
And set the IDL2js locale value to the eg_locale for staff web UIs.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
Open-ILS/src/templates/base.tt2

index e5d5bb2..1bf19c1 100644 (file)
@@ -173,7 +173,9 @@ sub load_context {
         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});
+    $ctx->{eg_locale} = parse_eg_locale($ctx->{locale});
+    $OpenILS::Utils::CStoreEditor::default_locale = $ctx->{eg_locale};
+
 
     my $mprefix = $ctx->{media_prefix};
     if($mprefix and $mprefix !~ /^http/ and $mprefix !~ /^\//) {
index efdee63..0ed51d9 100644 (file)
@@ -5,7 +5,7 @@
         <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
         <link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/skin/[% ctx.skin %].css' />
         <link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/theme/[% ctx.skin %].css' />
-           <script language='javascript' src='/IDL2js' type='text/javascript'></script>
+           <script language='javascript' src='/IDL2js?locale=[% ctx.eg_locale %]' type='text/javascript'></script>
         <script type="text/javascript">var djConfig = {parseOnLoad:true,isDebug:false};</script>
         <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src="[% ctx.media_prefix %]/js/dojo/dojo/openils_dojo.js"></script>