[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. fd6eec4cc0dc07e1c8b2a21e954a466e64b9e79d

Evergreen Git git at git.evergreen-ils.org
Wed Aug 15 12:43:07 EDT 2018


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, rel_3_0 has been updated
       via  fd6eec4cc0dc07e1c8b2a21e954a466e64b9e79d (commit)
      from  8becd8f7bd3fb56565743949c6e8e7fa1293f924 (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 fd6eec4cc0dc07e1c8b2a21e954a466e64b9e79d
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Aug 14 15:22:49 2018 -0400

    LP#1770981 Apply OpenSRF locale on webstaff page load
    
    Translate the locale from the locale cookie into the global
    OpenSRF.locale variable so network calls are stamped with the correct
    locale.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <ben at evergreener.net>

diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js
index f463030..388ed22 100644
--- a/Open-ILS/web/js/ui/default/staff/services/startup.js
+++ b/Open-ILS/web/js/ui/default/staff/services/startup.js
@@ -21,7 +21,9 @@ angular.module('egCoreMod')
 
 .factory('egStartup', 
        ['$q','$rootScope','$location','$window','egIDL','egAuth','egEnv','egOrg',
-function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg ) {
+        '$cookies',
+function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg ,
+         $cookies) {
 
     var service = { promise : null }
 
@@ -89,6 +91,16 @@ function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg
             return service.promise;
         } 
 
+        // Apply the locale from the cookie before any network 
+        // calls are made.
+        var locale = $cookies.get('eg_locale');
+        if (locale) {
+            // Cookie is stored aa_bb.  OpenSRF wants aa-BB
+            var parts = locale.split(/_/);
+            OpenSRF.locale = parts[0] + '-' + parts[1].toUpperCase();
+            console.debug('Applying locale ' + OpenSRF.locale);
+        }
+
         // create a new promise and fire off startup
         var deferred = $q.defer();
         service.promise = deferred.promise;

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

Summary of changes:
 .../web/js/ui/default/staff/services/startup.js    |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list