Bug 1440490 - Move l10n related functions into calL10NUtils.jsm - part 7 - migrate gdata provider. r=MakeMyday
authorPhilipp Kewisch <mozilla@kewis.ch>
Thu, 22 Feb 2018 09:58:05 +0100
changeset 31385 b2648949aedf65d20f4ef5b641dd25ccbc004b62
parent 31384 2d043b6dc896494dbef7661f36497151cecb6f51
child 31386 7bc3d4ebc70acc329b8cd98cbf2c0f137433eec5
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersMakeMyday
bugs1440490
Bug 1440490 - Move l10n related functions into calL10NUtils.jsm - part 7 - migrate gdata provider. r=MakeMyday MozReview-Commit-ID: 7KF1fUMRRi0
calendar/providers/gdata/modules/calUtilsShim.jsm
calendar/providers/gdata/modules/gdataUtils.jsm
--- a/calendar/providers/gdata/modules/calUtilsShim.jsm
+++ b/calendar/providers/gdata/modules/calUtilsShim.jsm
@@ -82,8 +82,16 @@ if (typeof cal.category == "undefined") 
 
 if (typeof cal.itip == "undefined") {
     ChromeUtils.import("resource://calendar/modules/calItipUtils.jsm");
 }
 
 if (typeof cal.itip.isInvitation == "undefined") {
     cal.itip.isInvitation = function(aItem) { return cal.isInvitation(aItem); };
 }
+
+if (typeof cal.l10n == "undefined") {
+    cal.l10n = {
+        getAnyString: function(aComponent, aBundle, aString, aParams) {
+            return cal.calGetString(aBundle, aString, aParams, aComponent);
+        }
+    };
+}
--- a/calendar/providers/gdata/modules/gdataUtils.jsm
+++ b/calendar/providers/gdata/modules/gdataUtils.jsm
@@ -1320,17 +1320,17 @@ async function checkResolveConflict(aOpe
 /**
  * Get a string from the gdata properties file
  *
  * @param aStringName  The name of the string within the properties file
  * @param ...aParams   Optional parameters to format the string
  * @return             The localized string value.
  */
 function getProviderString(aStringName, ...aParams) {
-    return cal.calGetString("gdata", aStringName, aParams, "gdata-provider");
+    return cal.l10n.getAnyString("gdata-provider", "gdata", aStringName, aParams);
 }
 
 /**
  * Monkey patch the function with the name x on obj and overwrite it with func.
  * The first parameter of this function is the original function that can be
  * called at any time.
  *
  * @param obj           The object the function is on.