Bug 1493313 - Follow-up: For gData, cater for both old an new locale API. r=MakeMyDay
authorJorg K <jorgk@jorgk.com>
Sat, 22 Sep 2018 13:35:52 +0200
changeset 33207 5bb80260d09b0b3a0ace92e27444f5f9ec7eef11
parent 33206 ed984c4258e99aacdeaae73ba7a63f2719178516
child 33208 eb028fd3dc3e4a84f705d73422842fbe80c11389
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersMakeMyDay
bugs1493313
Bug 1493313 - Follow-up: For gData, cater for both old an new locale API. r=MakeMyDay
calendar/providers/gdata/modules/gdataSession.jsm
--- a/calendar/providers/gdata/modules/gdataSession.jsm
+++ b/calendar/providers/gdata/modules/gdataSession.jsm
@@ -127,23 +127,26 @@ calGoogleSession.prototype = {
             cal.LOG("[calGoogleCalendar] Throttling outdated notification, last was " + (now - this.mLastNotified) + " ms ago");
         }
     },
 
     setupOAuth: function() {
         let sessionId = this.mId;
         let authDescr = getProviderString("requestWindowDescription", sessionId);
         let authTitle = getProviderString("requestWindowTitle", sessionId);
+        let locale = typeof Services.locale.requestedLocale === "undefined"
+                         ? Services.locale.getRequestedLocale()
+                         : Services.locale.requestedLocale;
 
         // Set up a new OAuth2 instance for logging in.
         this.oauth = new OAuth2(OAUTH_BASE_URI, OAUTH_SCOPE, OAUTH_CLIENT_ID, OAUTH_CLIENT_SECRET);
         this.oauth.extraAuthParams = [
           ["login_hint", sessionId],
           // Use application locale for login dialog
-          ["hl", Services.locale.requestedLocale]
+          ["hl", locale]
         ];
         this.oauth.requestWindowURI = "chrome://gdata-provider/content/browserRequest.xul";
         this.oauth.requestWindowFeatures = "chrome,private,centerscreen,width=430,height=750";
         this.oauth.requestWindowTitle = authTitle;
         this.oauth.requestWindowDescription = authDescr;
 
         // Overwrite the refreshToken attribute, since we want to save it in
         // the password manager