Bug 1557829 - Port bug 1557793: Adapt to array changes in nsIStringBundle.formatStringFromName (JS changes). r=jorgk
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 12 Jun 2019 16:12:00 +1200
changeset 35837 f7a7d54671d68475cc8541e909b9143a5cc7c1e7
parent 35836 285cab894a6e7dfee527416a7f98307564f67af9
child 35838 d350f0aa49d51d0b606a7325f69a46ca54f9dac6
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersjorgk
bugs1557829, 1557793
Bug 1557829 - Port bug 1557793: Adapt to array changes in nsIStringBundle.formatStringFromName (JS changes). r=jorgk
calendar/base/content/dialogs/calendar-invitations-dialog.js
calendar/base/content/dialogs/calendar-migration-dialog.js
calendar/base/modules/utils/calL10NUtils.jsm
calendar/base/src/calCalendarManager.js
calendar/base/src/calTimezoneService.js
calendar/providers/caldav/calDavCalendar.js
chat/components/src/imConversations.js
chat/content/chat-account-richlistitem.js
chat/modules/imThemes.jsm
chat/modules/imXPCOMUtils.jsm
editor/ui/composer/content/editorUtilities.js
mail/base/content/aboutAddonsExtra.js
mail/base/content/aboutDialog-appUpdater.js
mail/base/content/specialTabs.js
mail/components/activity/modules/autosync.jsm
mail/components/activity/modules/pop3Download.jsm
mail/components/activity/modules/sendLater.jsm
mail/components/nsMailDefaultHandler.js
mail/components/preferences/applications.js
mailnews/base/prefs/content/converterDialog.js
mailnews/base/src/msgOAuth2Module.js
mailnews/base/util/StringBundle.js
mailnews/extensions/newsblog/content/FeedUtils.jsm
mailnews/extensions/newsblog/content/feed-subscriptions.js
--- a/calendar/base/content/dialogs/calendar-invitations-dialog.js
+++ b/calendar/base/content/dialogs/calendar-invitations-dialog.js
@@ -115,48 +115,48 @@ class MozCalendarInvitationsRichlistitem
             recurrenceLabel.setAttribute("hidden", "true");
             let spacer = this.querySelector(".calendar-invitations-richlistitem-spacer");
             spacer.removeAttribute("hidden");
         }
 
         let locationLabel = this.querySelector(".calendar-invitations-richlistitem-location");
         let locationProperty = item.getProperty("LOCATION") || this.getString("none");
         let locationString = this.calInvitationsProps.formatStringFromName(
-            "location", [locationProperty], 1
+            "location", [locationProperty]
         );
 
         locationLabel.setAttribute("value", locationString);
 
         let organizerLabel = this.querySelector(".calendar-invitations-richlistitem-organizer");
         let org = item.organizer;
         let organizerProperty = "";
         if (org) {
             if (org.commonName && org.commonName.length > 0) {
                 organizerProperty = org.commonName;
             } else if (org.id) {
                 organizerProperty = org.id.replace(/^mailto:/i, "");
             }
         }
         let organizerString = this.calInvitationsProps.formatStringFromName(
-            "organizer", [organizerProperty], 1
+            "organizer", [organizerProperty]
         );
         organizerLabel.setAttribute("value", organizerString);
 
         let attendeeLabel = this.querySelector(".calendar-invitations-richlistitem-attendee");
         let att = cal.itip.getInvitedAttendee(item);
         let attendeeProperty = "";
         if (att) {
             if (att.commonName && att.commonName.length > 0) {
                 attendeeProperty = att.commonName;
             } else if (att.id) {
                 attendeeProperty = att.id.replace(/^mailto:/i, "");
             }
         }
         let attendeeString = this.calInvitationsProps.formatStringFromName(
-            "attendee", [attendeeProperty], 1
+            "attendee", [attendeeProperty]
         );
         attendeeLabel.setAttribute("value", attendeeString);
         Array.from(this.querySelectorAll("button")).map(
             button => button.setAttribute("group", item.hashId)
         );
     }
 
     getCalendarItemParticipationStatus(item) {
--- a/calendar/base/content/dialogs/calendar-migration-dialog.js
+++ b/calendar/base/content/dialogs/calendar-migration-dialog.js
@@ -26,22 +26,18 @@ var gMigrateWizard = {
         let listbox = document.getElementById("datasource-list");
 
         // XXX Once we have branding for lightning, this hack can go away
         let props = Services.strings.createBundle("chrome://calendar/locale/migration.properties");
 
         let wizard = document.getElementById("migration-wizard");
         let desc = document.getElementById("wizard-desc");
         // Since we don't translate "Lightning"...
-        wizard.title = props.formatStringFromName("migrationTitle",
-                                                  ["Lightning"],
-                                                  1);
-        desc.textContent = props.formatStringFromName("migrationDescription",
-                                                      ["Lightning"],
-                                                      1);
+        wizard.title = props.formatStringFromName("migrationTitle", ["Lightning"]);
+        desc.textContent = props.formatStringFromName("migrationDescription", ["Lightning"]);
 
         migLOG("migrators: " + window.arguments.length);
         for (let migrator of window.arguments[0]) {
             let checkbox = document.createXULElement("checkbox");
             checkbox.setAttribute("checked", true);
             checkbox.setAttribute("label", migrator.title);
             checkbox.migrator = migrator;
             listbox.appendChild(checkbox);
@@ -86,18 +82,17 @@ var gMigrateWizard = {
         // call-back function so we know when to start the next migrator.
         function getNextMigrator() {
             if (migrators[i]) {
                 let mig = migrators[i];
 
                 // Increment i to point to the next migrator
                 i++;
                 migLOG("starting migrator: " + mig.title);
-                label.value = props.formatStringFromName("migratingApp",
-                                                         [mig.title], 1);
+                label.value = props.formatStringFromName("migratingApp", [mig.title]);
                 meter.value = (i-1)/migrators.length*100;
                 mig.args.push(getNextMigrator);
 
                 try {
                     mig.migrate(...mig.args);
                 } catch (e) {
                     migLOG("Failed to migrate: " + mig.title);
                     migLOG(e);
--- a/calendar/base/modules/utils/calL10NUtils.jsm
+++ b/calendar/base/modules/utils/calL10NUtils.jsm
@@ -27,17 +27,17 @@ function _getString(aComponent, aBundleN
 
     try {
         if (!(propName in _getString._bundleCache)) {
             _getString._bundleCache[propName] = Services.strings.createBundle(propName);
         }
         let props = _getString._bundleCache[propName];
 
         if (aParams && aParams.length) {
-            return props.formatStringFromName(aStringName, aParams, aParams.length);
+            return props.formatStringFromName(aStringName, aParams);
         } else {
             return props.GetStringFromName(aStringName);
         }
     } catch (ex) {
         let msg = `Failed to read '${aStringName}' from ${propName}.`;
         Cu.reportError(`${msg} Error: ${ex}`);
         return aStringName;
     }
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -901,23 +901,23 @@ calMgrCalendarObserver.prototype = {
     announceError: function(aCalendar, aErrNo, aMessage) {
         let paramBlock = Cc["@mozilla.org/embedcomp/dialogparam;1"]
                            .createInstance(Ci.nsIDialogParamBlock);
         let props = Services.strings.createBundle("chrome://calendar/locale/calendar.properties");
         let errMsg;
         paramBlock.SetNumberStrings(3);
         if (!this.storedReadOnly && this.calendar.readOnly) {
             // Major errors change the calendar to readOnly
-            errMsg = props.formatStringFromName("readOnlyMode", [this.calendar.name], 1);
+            errMsg = props.formatStringFromName("readOnlyMode", [this.calendar.name]);
         } else if (!this.storedReadOnly && !this.calendar.readOnly) {
             // Minor errors don't, but still tell the user something went wrong
-            errMsg = props.formatStringFromName("minorError", [this.calendar.name], 1);
+            errMsg = props.formatStringFromName("minorError", [this.calendar.name]);
         } else {
             // The calendar was already in readOnly mode, but still tell the user
-            errMsg = props.formatStringFromName("stillReadOnlyError", [this.calendar.name], 1);
+            errMsg = props.formatStringFromName("stillReadOnlyError", [this.calendar.name]);
         }
 
         // When possible, change the error number into its name, to
         // make it slightly more readable.
         let errCode = "0x" + aErrNo.toString(16);
         const calIErrors = Ci.calIErrors;
         // Check if it is worth enumerating all the error codes.
         if (aErrNo & calIErrors.ERROR_BASE) {
--- a/calendar/base/src/calTimezoneService.js
+++ b/calendar/base/src/calTimezoneService.js
@@ -673,38 +673,38 @@ function guessSystemTimezone() {
             switch (score) {
                 case 0:
                     // Did not match.
                     // Maybe OS or Application is old, and the timezone changed.
                     // Or maybe user turned off DST in Date/Time control panel.
                     // Will look for a better matching tz, or fallback to floating.
                     // (Match OS so alarms go off at time indicated by OS clock.)
                     cal.WARN(calProperties.formatStringFromName(
-                             "WarningOSTZNoMatch", [osUserTimeZone, zoneInfoIdFromOSUserTimeZone], 2));
+                             "WarningOSTZNoMatch", [osUserTimeZone, zoneInfoIdFromOSUserTimeZone]));
                     break;
                 case 1: case 2:
                     // inexact match: OS TZ and our ZoneInfo TZ matched imperfectly.
                     // Will keep looking, will use tzId unless another is better.
                     // (maybe OS TZ has changed to match a nearby TZ, so maybe
                     // another ZoneInfo TZ matches it better).
                     probableTZId = tzId;
                     probableTZScore = score;
                     probableTZSource = calProperties.formatStringFromName(
-                        "TZFromOS", [osUserTimeZone], 1);
+                        "TZFromOS", [osUserTimeZone]);
 
                     break;
                 case 3:
                     // exact match
                     return tzId;
             }
         }
     } catch (ex) {
         // zoneInfo id given was not recognized by our ZoneInfo database
         let errParams = [zoneInfoIdFromOSUserTimeZone || osUserTimeZone];
-        let errMsg = calProperties.formatStringFromName("SkippingOSTimezone", errParams, 1);
+        let errMsg = calProperties.formatStringFromName("SkippingOSTimezone", errParams);
         Cu.reportError(errMsg + " " + ex);
     }
 
     // Second, give priority to "likelyTimezone"s if provided by locale.
     try {
         // The likelyTimezone property is a comma-separated list of
         // ZoneInfo timezone ids.
         const bundleTZString =
@@ -725,17 +725,17 @@ function guessSystemTimezone() {
                             probableTZSource = calProperties.GetStringFromName("TZFromLocale");
                         }
                         break;
                     case 3:
                         return tzId;
                 }
             } catch (ex) {
                 let errMsg = calProperties.formatStringFromName(
-                    "SkippingLocaleTimezone", [bareTZId], 1);
+                    "SkippingLocaleTimezone", [bareTZId]);
                 Cu.reportError(errMsg + " " + ex);
             }
         }
     } catch (ex) { // Oh well, this didn't work, next option...
         Cu.reportError(ex);
     }
 
     // Third, try all known timezones.
@@ -800,17 +800,17 @@ function guessSystemTimezone() {
                           : daylightText + standardText) +
                          calProperties.GetStringFromName("TZAlmostMatchesOSDifferAtMostAWeek");
                 } else {
                     warningDetail = calProperties.GetStringFromName("TZSeemsToMatchOS");
                 }
                 let offsetString = standardTZOffset +
                                      (daylightTZOffset ? "/" + daylightTZOffset : "");
                 let warningMsg = calProperties.formatStringFromName("WarningUsingGuessedTZ",
-                                  [tzId, offsetString, warningDetail, probableTZSource], 4);
+                                  [tzId, offsetString, warningDetail, probableTZSource]);
                 cal.WARN(warningMsg);
                 break;
             }
         }
     } catch (ex) { // don't abort if error occurs warning user
         Cu.reportError(ex);
     }
 
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -2348,17 +2348,17 @@ calDavCalendar.prototype = {
         let props = Services.strings.createBundle("chrome://calendar/locale/calendar.properties");
         let statusString;
         try {
             statusString = props.GetStringFromName("caldavRequestStatusCodeString" + status);
         } catch (e) {
             // Fallback on generic string if no string is defined for the status code
             statusString = props.GetStringFromName("caldavRequestStatusCodeStringGeneric");
         }
-        return props.formatStringFromName("caldavRequestStatusCode", [status], 1) + ", " +
+        return props.formatStringFromName("caldavRequestStatusCode", [status]) + ", " +
                statusString + "\n\n" +
                (extraInfo ? extraInfo : "");
     },
 
     //
     // calIFreeBusyProvider interface
     //
 
--- a/chat/components/src/imConversations.js
+++ b/chat/components/src/imConversations.js
@@ -156,18 +156,17 @@ UIConversation.prototype = {
       let buddy = this.buddy;
       if (buddy)
         ({statusType: this.statusType, statusText: this.statusText} = buddy);
     }
     if (shouldNotify) {
       this.notifyObservers(this, "target-prpl-conversation-changed");
       let target = this.target;
       let params = [target.title, target.account.protocol.name];
-      this.systemMessage(bundle.formatStringFromName("targetChanged",
-                                                     params, params.length));
+      this.systemMessage(bundle.formatStringFromName("targetChanged", params));
     }
   },
   // Returns a boolean indicating if the ui-conversation was closed.
   // If the conversation was closed, aContactId.value is set to the contact id
   // or 0 if no contact was associated with the conversation.
   removeTarget(aPrplConversation, aContactId) {
     let id = aPrplConversation.id;
     if (!(id in this._prplConv))
@@ -285,31 +284,30 @@ UIConversation.prototype = {
     let wasUnknown = this.statusType == Ci.imIStatusInfo.STATUS_UNKNOWN;
     this.statusType = statusType;
     this.statusText = statusText;
 
     this.notifyObservers(this, "update-buddy-status");
 
     let msg;
     if (statusType == Ci.imIStatusInfo.STATUS_UNKNOWN)
-      msg = bundle.formatStringFromName("statusUnknown", [this.title], 1);
+      msg = bundle.formatStringFromName("statusUnknown", [this.title]);
     else {
       let status = Status.toLabel(statusType);
       let stringId = wasUnknown ? "statusChangedFromUnknown" : "statusChanged";
       if (this._justReconnected) {
         stringId = "statusKnown";
         delete this._justReconnected;
       }
       if (statusText) {
         msg = bundle.formatStringFromName(stringId + "WithStatusText",
-                                          [this.title, status, statusText],
-                                          3);
+                                          [this.title, status, statusText]);
       }
       else
-        msg = bundle.formatStringFromName(stringId, [this.title, status], 2);
+        msg = bundle.formatStringFromName(stringId, [this.title, status]);
     }
     this.systemMessage(msg);
   },
 
   _disconnected: false,
   disconnecting() {
     if (this._disconnected)
       return;
--- a/chat/content/chat-account-richlistitem.js
+++ b/chat/content/chat-account-richlistitem.js
@@ -150,17 +150,17 @@
       this.setAttribute("state", state);
       this.autoLogin = aAccount.autoLogin;
     }
 
     updateConnectionState() {
       let bundle = Services.strings.createBundle("chrome://messenger/locale/imAccounts.properties");
       const key = "account.connection.progress";
       let text = this._account.connectionStateMsg;
-      text = text ? bundle.formatStringFromName(key, [text], 1) :
+      text = text ? bundle.formatStringFromName(key, [text]) :
         bundle.GetStringFromName("account.connecting");
 
       let progress = this.querySelector(".connecting");
       progress.setAttribute("value", text);
       if (this.reconnectUpdateInterval) {
         this._cancelReconnectTimer();
       }
 
@@ -169,27 +169,27 @@
 
     updateConnectionError() {
       let bundle = Services.strings.createBundle("chrome://messenger/locale/imAccounts.properties");
       const key = "account.connection.error";
       let account = this._account;
       let text;
       let errorReason = account.connectionErrorReason;
       if (errorReason == Ci.imIAccount.ERROR_UNKNOWN_PRPL) {
-        text = bundle.formatStringFromName(key + "UnknownPrpl", [account.protocol.id], 1);
+        text = bundle.formatStringFromName(key + "UnknownPrpl", [account.protocol.id]);
       } else if (errorReason == Ci.imIAccount.ERROR_MISSING_PASSWORD) {
         text = bundle.GetStringFromName(key + "EnteringPasswordRequired");
       } else if (errorReason == Ci.imIAccount.ERROR_CRASHED) {
         text = bundle.GetStringFromName(key + "CrashedAccount");
       } else {
         text = account.connectionErrorMessage;
       }
 
       if (errorReason != Ci.imIAccount.ERROR_MISSING_PASSWORD) {
-        text = bundle.formatStringFromName(key, [text], 1);
+        text = bundle.formatStringFromName(key, [text]);
       }
 
       this.setAttribute("error", "true");
       if ((Ci.imIAccount.ERROR_CERT_NOT_PROVIDED <= errorReason &&
         errorReason <= Ci.imIAccount.ERROR_CERT_OTHER_ERROR) &&
         account.prplAccount.connectionTarget) {
         this.setAttribute("certError", "true");
       }
@@ -198,20 +198,20 @@
 
       let updateReconnect = () => {
         let date = Math.round((account.timeOfNextReconnect - Date.now()) / 1000);
         let reconnect = "";
         if (date > 0) {
           let [val1, unit1, val2, unit2] = DownloadUtils.convertTimeUnits(date);
           if (!val2)
             reconnect = bundle.formatStringFromName("account.reconnectInSingle",
-              [val1, unit1], 2);
+              [val1, unit1]);
           else
             reconnect = bundle.formatStringFromName("account.reconnectInDouble",
-              [val1, unit1, val2, unit2], 4);
+              [val1, unit1, val2, unit2]);
         }
         this.querySelector(".error-reconnect").textContent = reconnect;
         return reconnect;
       };
       if (updateReconnect() && !this.reconnectUpdateInterval) {
         this.setAttribute("reconnectPending", "true");
         this.reconnectUpdateInterval = setInterval(updateReconnect, 1000);
         gAccountManager.disableCommandItems();
@@ -221,20 +221,20 @@
     refreshConnectedLabel() {
       let bundle = Services.strings.createBundle("chrome://messenger/locale/imAccounts.properties");
       let date = 60 * Math.floor((Date.now() - this._account.timeOfLastConnect) / 60000);
       let value;
       if (date > 0) {
         let [val1, unit1, val2, unit2] = DownloadUtils.convertTimeUnits(date);
         if (!val2) {
           value = bundle.formatStringFromName("account.connectedForSingle",
-            [val1, unit1], 2);
+            [val1, unit1]);
         } else {
           value = bundle.formatStringFromName("account.connectedForDouble",
-            [val1, unit1, val2, unit2], 4);
+            [val1, unit1, val2, unit2]);
         }
       } else {
         value = bundle.GetStringFromName("account.connectedForSeconds");
       }
       this.connectedLabel.value = value;
     }
 
     _cancelReconnectTimer() {
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -348,17 +348,17 @@ var headerFooterReplacements = {
       return ToLocaleFormat(aFormat, date);
     return gTimeFormatter.format(date);
   },
 };
 
 function formatAutoResponce(aTxt) {
   return Services.strings
                  .createBundle("chrome://chat/locale/conversations.properties")
-                 .formatStringFromName("autoReply", [aTxt], 1);
+                 .formatStringFromName("autoReply", [aTxt]);
 }
 
 var statusMessageReplacements = {
   message: aMsg => "<span class=\"ib-msg-txt\">" +
                    (aMsg.autoResponse ? formatAutoResponce(aMsg.message) : aMsg.message) +
                    "</span>",
   time(aMsg, aFormat) {
     let date = new Date(aMsg.time * 1000);
--- a/chat/modules/imXPCOMUtils.jsm
+++ b/chat/modules/imXPCOMUtils.jsm
@@ -199,18 +199,17 @@ ClassInfo.prototype = {
 function l10nHelper(aChromeURL)
 {
   let bundle = Services.strings.createBundle(aChromeURL);
   return function(aStringId) {
     try {
       if (arguments.length == 1)
         return bundle.GetStringFromName(aStringId);
       return bundle.formatStringFromName(aStringId,
-                                         Array.prototype.slice.call(arguments, 1),
-                                         arguments.length - 1);
+                                         Array.prototype.slice.call(arguments, 1));
     } catch (e) {
       Cu.reportError(e);
       dump("Failed to get " + aStringId + "\n");
       return aStringId;
     }
   };
 }
 
--- a/editor/ui/composer/content/editorUtilities.js
+++ b/editor/ui/composer/content/editorUtilities.js
@@ -57,17 +57,17 @@ function GetString(name) {
 function GetFormattedString(aName, aVal) {
   if (!gStringBundle) {
     try {
       gStringBundle = Services.strings.createBundle("chrome://editor/locale/editor.properties");
     } catch (ex) {}
   }
   if (gStringBundle) {
     try {
-      return gStringBundle.formatStringFromName(aName, [aVal], 1);
+      return gStringBundle.formatStringFromName(aName, [aVal]);
     } catch (e) {}
   }
   return null;
 }
 
 function TrimStringLeft(string) {
   if (!string)
     return "";
--- a/mail/base/content/aboutAddonsExtra.js
+++ b/mail/base/content/aboutAddonsExtra.js
@@ -140,17 +140,17 @@ gDetailView.updateState = function() {
     if (stringName) {
       this.node.setAttribute("notification", "warning");
       this.node.removeAttribute("pending");
 
       let warningContainer = document.getElementById("warning-container");
       let warning = document.getElementById("detail-warning");
       document.getElementById("detail-warning-link").hidden = true;
       warning.textContent = gStrings.mailExt.formatStringFromName(
-        stringName, [this._addon.name, gStrings.brandShortName], 2
+        stringName, [this._addon.name, gStrings.brandShortName]
       );
 
       if (version) {
         document.getElementById("detail-version").value = version;
       }
 
       if (!restartButton) {
         restartButton = document.createXULElement("button");
--- a/mail/base/content/aboutDialog-appUpdater.js
+++ b/mail/base/content/aboutDialog-appUpdater.js
@@ -184,17 +184,17 @@ appUpdater.prototype = {
         // Include the build ID if this is an "a#" (nightly or aurora) build
         if (/a\d+$/.test(updateVersion)) {
           let buildID = gAppUpdater.update.buildID;
           let year = buildID.slice(0, 4);
           let month = buildID.slice(4, 6);
           let day = buildID.slice(6, 8);
           updateVersion += ` (${year}-${month}-${day})`;
         }
-        button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion], 1);
+        button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion]);
         button.accessKey = this.bundle.GetStringFromName("update.downloadAndInstallButton.accesskey");
       }
       this.updateDeck.selectedPanel = panel;
       if (this.options.buttonAutoFocus &&
           (!document.commandDispatcher.focusedElement || // don't steal the focus
            document.commandDispatcher.focusedElement.localName == "button")) { // except from the other buttons
         button.focus();
       }
--- a/mail/base/content/specialTabs.js
+++ b/mail/base/content/specialTabs.js
@@ -1013,18 +1013,17 @@ var specialTabs = {
 
   showAboutRightsNotification() {
     var brandBundle =
       Services.strings.createBundle("chrome://branding/locale/brand.properties");
     var rightsBundle =
       Services.strings.createBundle("chrome://messenger/locale/aboutRights.properties");
 
     var productName = brandBundle.GetStringFromName("brandFullName");
-    var notifyRightsText = rightsBundle.formatStringFromName("notifyRightsText",
-                                                             [productName], 1);
+    var notifyRightsText = rightsBundle.formatStringFromName("notifyRightsText", [productName]);
 
     var buttons = [
       {
         label: rightsBundle.GetStringFromName("buttonLabel"),
         accessKey: rightsBundle.GetStringFromName("buttonAccessKey"),
         popup: null,
         callback(aNotificationBar, aButton) {
           // Show the about:rights tab
--- a/mail/components/activity/modules/autosync.jsm
+++ b/mail/components/activity/modules/autosync.jsm
@@ -62,25 +62,25 @@ var autosyncModule = {
       throw e;
     }
   },
 
   createSyncMailProcess(folder) {
     try {
       // create an activity process for this folder
       let msg = this.bundle.formatStringFromName("autosyncProcessDisplayText",
-                                                 [folder.prettyName], 1);
+                                                 [folder.prettyName]);
       let process = new nsActProcess(msg, this.autoSyncManager);
       // we want to use default auto-sync icon
       process.iconClass = "syncMail";
       process.addSubject(folder);
       // group processes under folder's imap account
       process.contextType = "account";
       process.contextDisplayText = this.bundle.formatStringFromName("autosyncContextDisplayText",
-                                        [folder.server.prettyName], 1);
+                                        [folder.server.prettyName]);
 
 
       process.contextObj = folder.server;
 
       return process;
     } catch (e) {
       this.log.error("createSyncMailProcess: " + e);
       throw e;
@@ -91,35 +91,35 @@ var autosyncModule = {
     try {
       // extract the relevant parts
       let process = syncItem.activity;
       let folder = syncItem.syncFolder;
 
       // create an activity event
 
       let msg = this.bundle.formatStringFromName("autosyncEventDisplayText",
-                                                 [folder.server.prettyName], 1);
+                                                 [folder.server.prettyName]);
 
       let statusMsg;
       let numOfMessages = this._syncInfoPerServer.get(folder.server).totalDownloads;
       if (numOfMessages)
         statusMsg = this.bundle.formatStringFromName("autosyncEventStatusText",
-                                                     [numOfMessages], 1);
+                                                     [numOfMessages]);
       else
         statusMsg = this.getString("autosyncEventStatusTextNoMsgs");
 
       let event = new nsActEvent(msg, this.autoSyncManager, statusMsg,
                                  this._syncInfoPerServer.get(folder.server).startTime,
                                  Date.now());               // completion time
 
       // since auto-sync events do not have undo option by nature,
       // setting these values are informational only.
       event.contextType = process.contextType;
       event.contextDisplayText = this.bundle.formatStringFromName("autosyncContextDisplayText",
-                                        [folder.server.prettyName], 1);
+                                        [folder.server.prettyName]);
       event.contextObj = process.contextObj;
       event.iconClass = "syncMail";
 
       // transfer all subjects.
       // same as above, not mandatory
       let subjects = process.getSubjects({});
       for (let subject of subjects)
         event.addSubject(subject);
@@ -267,17 +267,17 @@ var autosyncModule = {
           let percent = (syncItem.totalDownloaded / syncItem.pendingMsgCount) * 100;
           if (percent > syncItem.percentComplete)
             syncItem.percentComplete = percent;
 
           let msg = this.bundle.formatStringFromName("autosyncProcessProgress2",
                                                  [syncItem.totalDownloaded,
                                                   syncItem.pendingMsgCount,
                                                   folder.prettyName,
-                                                  folder.server.prettyName], 4);
+                                                  folder.server.prettyName]);
 
           process.setProgress(msg, numOfMessages, totalPending);
 
           let serverInfo = this._syncInfoPerServer.get(syncItem.syncFolder.server);
           serverInfo.totalDownloads += numOfMessages;
           this._syncInfoPerServer.set(syncItem.syncFolder.server, serverInfo);
         }
       }
--- a/mail/components/activity/modules/pop3Download.jsm
+++ b/mail/components/activity/modules/pop3Download.jsm
@@ -49,17 +49,17 @@ var pop3DownloadModule = {
   },
 
   onDownloadStarted(aFolder) {
     this.log.info("in onDownloadStarted");
 
     let displayText =
       this.bundle.formatStringFromName("pop3EventStartDisplayText2",
                                        [aFolder.server.prettyName, // account name
-                                        aFolder.prettyName], 2);   // folder name
+                                        aFolder.prettyName]);   // folder name
     // remember the prev activity for this folder, if any.
     this._prevActivityForFolder.set(aFolder.URI,
       this._mostRecentActivityForFolder.get(aFolder.URI));
     let statusText = aFolder.server.prettyName;
 
     // create an activity event
     let event = new nsActEvent(displayText,
                                aFolder,
--- a/mail/components/activity/modules/sendLater.jsm
+++ b/mail/components/activity/modules/sendLater.jsm
@@ -65,18 +65,17 @@ var sendLaterModule = {
     return this.bundle = Services.strings
       .createBundle("chrome://messenger/locale/activity.properties");
   },
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIMsgSendLaterListener]),
 
   _displayTextForHeader(aLocaleStringBase, aSubject) {
     return aSubject ?
-           this.bundle.formatStringFromName(aLocaleStringBase + "WithSubject",
-                                            [aSubject], 1) :
+           this.bundle.formatStringFromName(aLocaleStringBase + "WithSubject", [aSubject]) :
            this.bundle.GetStringFromName(aLocaleStringBase);
   },
 
   _newProcess(aLocaleStringBase, aAddSubject) {
     let process =
       new nsActProcess(this._displayTextForHeader(aLocaleStringBase,
                                                   aAddSubject ?
                                                   this._subject :
--- a/mail/components/nsMailDefaultHandler.js
+++ b/mail/components/nsMailDefaultHandler.js
@@ -318,21 +318,21 @@ var nsMailDefaultHandler = {
                                  "_blank", "all,chrome,dialog=no,status,toolbar",
                                  fileURL);
           cmdLine.preventDefault = true;
         } else {
           let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
           let title, message;
           if (!file.exists()) {
             title = bundle.GetStringFromName("fileNotFoundTitle");
-            message = bundle.formatStringFromName("fileNotFoundMsg", [file.path], 1);
+            message = bundle.formatStringFromName("fileNotFoundMsg", [file.path]);
           } else {
             // The file is empty
             title = bundle.GetStringFromName("fileEmptyTitle");
-            message = bundle.formatStringFromName("fileEmptyMsg", [file.path], 1);
+            message = bundle.formatStringFromName("fileEmptyMsg", [file.path]);
           }
 
           Services.prompt.alert(null, title, message);
         }
       } else if (uri.toLowerCase().endsWith(".vcf")) {
         // A VCard! Be smart and open the "add contact" dialog.
         let file = cmdLine.resolveFile(uri);
         if (file.exists() && file.fileSize > 0) {
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -665,17 +665,17 @@ var gCloudFileTab = {
 
     return rli;
   },
 
   makeButtonForProvider(provider) {
     let button = document.createXULElement("button");
     button.setAttribute("value", provider.type);
     button.setAttribute(
-      "label", this._strings.formatStringFromName("addProvider", [provider.displayName], 1)
+      "label", this._strings.formatStringFromName("addProvider", [provider.displayName])
     );
     button.setAttribute("oncommand", `gCloudFileTab.addCloudFileAccount("${provider.type}")`);
     button.style.listStyleImage = `url("${provider.iconURL}")`;
     return button;
   },
 
   makeListItemForProvider(provider) {
     let menuitem = document.createXULElement("menuitem");
@@ -789,17 +789,17 @@ var gCloudFileTab = {
     if (!selection)
       return;
 
     let accountKey = selection.value;
     let accountName = cloudFileAccounts.getDisplayName(accountKey);
     // Does the user really want to remove this account?
     let confirmMessage = this._strings
                              .formatStringFromName("dialog_removeAccount",
-                                                   [accountName], 1);
+                                                   [accountName]);
 
     if (Services.prompt.confirm(null, "", confirmMessage)) {
       this._list.clearSelection();
       cloudFileAccounts.removeAccount(accountKey);
       let rli = this._list.querySelector("richlistitem[value='" + accountKey + "']");
       rli.remove();
       this._settingsDeck.selectedPanel = this._defaultPanel;
       if (this._settings) {
--- a/mailnews/base/prefs/content/converterDialog.js
+++ b/mailnews/base/prefs/content/converterDialog.js
@@ -106,29 +106,29 @@ function placeAccountName(aServer) {
     }
 
     if (aServer.rootFolder.filePath.path != deferredToRootFolder) {
       document.getElementById("warningSpan").textContent =
         bundle.formatStringFromName(
           "converterDialog.warningForDeferredAccount",
           [aServer.username, deferredToAccountName, deferredToAccountName,
           deferredAccountsString,
-          accountsToConvert, storeContractId, brandShortName], 7);
+          accountsToConvert, storeContractId, brandShortName]);
     } else {
       document.getElementById("warningSpan").textContent =
         bundle.formatStringFromName(
           "converterDialog.warningForDeferredToAccount",
           [deferredToAccountName,
           deferredAccountsString,
-          accountsToConvert, storeContractId, brandShortName], 5);
+          accountsToConvert, storeContractId, brandShortName]);
     }
 
     document.getElementById("messageSpan").textContent =
       bundle.formatStringFromName("converterDialog.messageForDeferredAccount",
-                                  [accountsToConvert, storeContractId], 2);
+                                  [accountsToConvert, storeContractId]);
     gServer = deferredToAccount.incomingServer;
   } else {
     // No account is deferred.
     let storeContractId = Services.prefs.getCharPref(
       "mail.server." + aServer.key + ".storeContractID");
     if (storeContractId == "@mozilla.org/msgstore/berkeleystore;1") {
       storeContractId = "maildir";
     } else {
@@ -139,21 +139,20 @@ function placeAccountName(aServer) {
     if (tempName == "nobody") {
       tempName = "Local Folders";
     } else if (!tempName) {
       tempName = aServer.hostName;
     }
 
     document.getElementById("warningSpan").textContent =
       bundle.formatStringFromName("converterDialog.warning",
-                                  [tempName, storeContractId, brandShortName],
-                                  3);
+                                  [tempName, storeContractId, brandShortName]);
     document.getElementById("messageSpan").textContent =
       bundle.formatStringFromName("converterDialog.message",
-                                  [tempName, storeContractId], 2);
+                                  [tempName, storeContractId]);
     gServer = aServer;
   }
 
   // Forces the resize of the dialog to the actual content
   window.sizeToContent();
 }
 
 /**
@@ -166,17 +165,17 @@ function startContinue(aSelectedStoreTyp
   gFolder = gServer.rootFolder.filePath;
 
   let bundle = Services.strings
     .createBundle("chrome://messenger/locale/converterDialog.properties");
 
   document.getElementById("progress").addEventListener("progress", function(e) {
    document.getElementById("progress").value = e.detail;
    document.getElementById("progressPrcnt").textContent =
-     bundle.formatStringFromName("converterDialog.percentDone", [e.detail], 1);
+     bundle.formatStringFromName("converterDialog.percentDone", [e.detail]);
   });
 
   document.getElementById("warning").setAttribute("hidden", "hidden");
   document.getElementById("progressDiv").removeAttribute("hidden");
 
   // Storing original prefs and root folder path
   // to revert changes in case of error.
   let p1 = "mail.server." + gServer.key + ".directory";
--- a/mailnews/base/src/msgOAuth2Module.js
+++ b/mailnews/base/src/msgOAuth2Module.js
@@ -72,18 +72,17 @@ OAuth2Module.prototype = {
     // Try hinting the username...
     this._oauth.extraAuthParams = [
       ["login_hint", aUsername],
     ];
 
     // Set the window title to something more useful than "Unnamed"
     this._oauth.requestWindowTitle =
       Services.strings.createBundle("chrome://messenger/locale/messenger.properties")
-                      .formatStringFromName("oauth2WindowTitle",
-                                            [aUsername, aHostname], 2);
+                      .formatStringFromName("oauth2WindowTitle", [aUsername, aHostname]);
 
     // This stores the refresh token in the login manager.
     Object.defineProperty(this._oauth, "refreshToken", {
       get: () => this.refreshToken,
       set: (token) => this.refreshToken = token,
     });
 
     return true;
--- a/mailnews/base/util/StringBundle.js
+++ b/mailnews/base/util/StringBundle.js
@@ -69,17 +69,17 @@ StringBundle.prototype = {
    *        the identifier of the string to get
    * @param args {array} [optional]
    *        an array of arguments that replace occurrences of %S in the string
    *
    * @returns {String} the value of the string
    */
   get(key, args) {
     if (args)
-      return this.stringBundle.formatStringFromName(key, args, args.length);
+      return this.stringBundle.formatStringFromName(key, args);
     return this.stringBundle.GetStringFromName(key);
   },
 
   /**
    * Get all the strings in the bundle.
    *
    * @returns {Array}
    *          an array of objects with key and value properties
--- a/mailnews/extensions/newsblog/content/FeedUtils.jsm
+++ b/mailnews/extensions/newsblog/content/FeedUtils.jsm
@@ -1928,34 +1928,34 @@ var FeedUtils = {
           break;
         case FeedUtils.kNewsBlogNoNewItems:
           message = feed.url + ". " +
                     FeedUtils.strings.GetStringFromName(
                       "newsblog-noNewArticlesForFeed");
           break;
         case FeedUtils.kNewsBlogInvalidFeed:
           message = FeedUtils.strings.formatStringFromName(
-                      "newsblog-feedNotValid", [feed.url], 1);
+                      "newsblog-feedNotValid", [feed.url]);
           break;
         case FeedUtils.kNewsBlogRequestFailure:
           message = FeedUtils.strings.formatStringFromName(
-                      "newsblog-networkError", [feed.url], 1);
+                      "newsblog-networkError", [feed.url]);
           break;
         case FeedUtils.kNewsBlogFileError:
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-errorOpeningFile");
           break;
         case FeedUtils.kNewsBlogBadCertError:
           let host = Services.io.newURI(feed.url).host;
           message = FeedUtils.strings.formatStringFromName(
-                      "newsblog-badCertError", [host], 1);
+                      "newsblog-badCertError", [host]);
           break;
         case FeedUtils.kNewsBlogNoAuthError:
           message = FeedUtils.strings.formatStringFromName(
-                      "newsblog-noAuthError", [feed.url], 1);
+                      "newsblog-noAuthError", [feed.url]);
           break;
       }
 
       if (message) {
         let location = FeedUtils.getFolderPrettyPath(feed.folder ||
                                                      feed.server.rootFolder) + " -> ";
         FeedUtils.log.info("downloaded: " +
                            (this.mSubscribeMode ? "Subscribe: " : "Update: ") +
@@ -2005,17 +2005,17 @@ var FeedUtils = {
     onFeedItemStored(feed, aCurrentFeedItems, aMaxFeedItems) {
       // We currently don't do anything here.  Eventually we may add status
       // text about the number of new feed articles received.
 
       if (this.mSubscribeMode && this.mStatusFeedback) {
         // If we are subscribing to a feed, show feed download progress.
         this.mStatusFeedback.showStatusString(
           FeedUtils.strings.formatStringFromName("subscribe-gettingFeedItems",
-                                                 [aCurrentFeedItems, aMaxFeedItems], 2));
+                                                 [aCurrentFeedItems, aMaxFeedItems]));
         this.onProgress(feed, aCurrentFeedItems, aMaxFeedItems);
       }
     },
 
     onProgress(feed, aProgress, aProgressMax, aLengthComputable) {
       if (feed.url in this.mFeeds) {
         // Have we already seen this feed?
         this.mFeeds[feed.url].currentProgress = aProgress;
--- a/mailnews/extensions/newsblog/content/feed-subscriptions.js
+++ b/mailnews/extensions/newsblog/content/feed-subscriptions.js
@@ -1382,17 +1382,17 @@ var FeedSubscriptions = {
       return;
     }
 
     if (aPrompt) {
       // Confirm unsubscribe prompt.
       let pTitle = FeedUtils.strings.GetStringFromName(
                      "subscribe-confirmFeedDeletionTitle");
       let pMessage = FeedUtils.strings.formatStringFromName(
-                       "subscribe-confirmFeedDeletion", [itemToRemove.name], 1);
+                       "subscribe-confirmFeedDeletion", [itemToRemove.name]);
       if (Services.prompt.confirmEx(window, pTitle, pMessage,
                                     Ci.nsIPromptService.STD_YES_NO_BUTTONS,
                                     null, null, null, null, { })) {
         return;
       }
     }
 
     let feed = new Feed(itemToRemove.url, itemToRemove.parentFolder);
@@ -1847,17 +1847,17 @@ var FeedSubscriptions = {
         }
         if (aErrorCode == FeedUtils.kNewsBlogFileError) {
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-errorOpeningFile");
         }
         if (aErrorCode == FeedUtils.kNewsBlogBadCertError) {
           let host = Services.io.newURI(feed.url).host;
           message = FeedUtils.strings.formatStringFromName(
-                      "newsblog-badCertError", [host], 1);
+                      "newsblog-badCertError", [host]);
         }
         if (aErrorCode == FeedUtils.kNewsBlogNoAuthError) {
           message = FeedUtils.strings.GetStringFromName(
                       "subscribe-noAuthError");
         }
 
         // Focus the url if verify/update failed.
         if (win.mActionMode == win.kUpdateMode ||
@@ -1875,17 +1875,17 @@ var FeedSubscriptions = {
     // This gets called after the RSS parser finishes storing a feed item to
     // disk.  aCurrentFeedItems is an integer corresponding to how many feed
     // items have been downloaded so far.  aMaxFeedItems is an integer
     // corresponding to the total number of feed items to download.
     onFeedItemStored(feed, aCurrentFeedItems, aMaxFeedItems) {
       window.focus();
       let message = FeedUtils.strings.formatStringFromName(
                       "subscribe-gettingFeedItems",
-                      [aCurrentFeedItems, aMaxFeedItems], 2);
+                      [aCurrentFeedItems, aMaxFeedItems]);
       FeedSubscriptions.updateStatusItem("statusText", message);
       this.onProgress(feed, aCurrentFeedItems, aMaxFeedItems);
     },
 
     onProgress(feed, aProgress, aProgressMax, aLengthComputable) {
       FeedSubscriptions.updateStatusItem("progressMeter",
                                          (aProgress * 100) / (aProgressMax || 100));
     },
@@ -2215,21 +2215,21 @@ var FeedSubscriptions = {
  * @param {Boolean} aList - If true, exporting as list; if false (default)
  *                          exporting feeds in folder structure - used for title.
  * @returns {Promise} nsIFile or null.
  */
   opmlPickSaveAsFile(aList) {
     let accountName = this.mRSSServer.rootFolder.prettyName;
     let fileName = FeedUtils.strings.formatStringFromName(
                      "subscribe-OPMLExportDefaultFileName",
-                     [this.brandShortName, accountName], 2);
+                     [this.brandShortName, accountName]);
     let title = aList ? FeedUtils.strings.formatStringFromName(
-                          "subscribe-OPMLExportTitleList", [accountName], 1) :
+                          "subscribe-OPMLExportTitleList", [accountName]) :
                         FeedUtils.strings.formatStringFromName(
-                          "subscribe-OPMLExportTitleStruct", [accountName], 1);
+                          "subscribe-OPMLExportTitleStruct", [accountName]);
     let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
 
     fp.defaultString = fileName;
     fp.defaultExtension = "opml";
     if (this.opmlLastSaveAsDir && (this.opmlLastSaveAsDir instanceof Ci.nsIFile)) {
       fp.displayDirectory = this.opmlLastSaveAsDir;
     }
 
@@ -2310,17 +2310,17 @@ var FeedSubscriptions = {
 
       this.generatePPSpace(opmlRoot, SPACES2);
 
       // Make the <head> element.
       let head = opmlDoc.createElement("head");
       this.generatePPSpace(head, SPACES4);
       let titleText = FeedUtils.strings.formatStringFromName(
                         "subscribe-OPMLExportFileDialogTitle",
-                        [this.brandShortName, rootFolder.prettyName], 2);
+                        [this.brandShortName, rootFolder.prettyName]);
       let title = opmlDoc.createElement("title");
       title.appendChild(opmlDoc.createTextNode(titleText));
       head.appendChild(title);
       this.generatePPSpace(head, SPACES4);
       let dt = opmlDoc.createElement("dateCreated");
       dt.appendChild(opmlDoc.createTextNode((new Date()).toUTCString()));
       head.appendChild(dt);
       this.generatePPSpace(head, SPACES2);
@@ -2353,17 +2353,17 @@ var FeedSubscriptions = {
       }
 
       let fos = FileUtils.openSafeFileOutputStream(saveAsFile);
       let serializer = new XMLSerializer();
       serializer.serializeToStream(opmlDoc, fos, "utf-8");
       FileUtils.closeSafeFileOutputStream(fos);
 
       let statusReport = FeedUtils.strings.formatStringFromName(
-                           "subscribe-OPMLExportDone", [saveAsFile.path], 1);
+                           "subscribe-OPMLExportDone", [saveAsFile.path]);
       this.updateStatusItem("statusText", statusReport);
       FeedUtils.log.info("exportOPML: " + statusReport);
     }
   },
 
   generatePPSpace(aNode, indentString) {
     aNode.appendChild(aNode.ownerDocument.createTextNode("\n"));
     aNode.appendChild(aNode.ownerDocument.createTextNode(indentString));
@@ -2532,17 +2532,17 @@ var FeedSubscriptions = {
           opmlDom = (new DOMParser()).parseFromString(responseText, "application/xml");
           if (!(opmlDom instanceof XMLDocument) ||
               opmlDom.documentElement.namespaceURI == FeedUtils.MOZ_PARSERERROR_NS ||
               opmlDom.documentElement.tagName != "opml" ||
               !(opmlDom.querySelector("body") &&
                 opmlDom.querySelector("body").childElementCount)) {
             // If the OPML file is invalid or empty.
             statusReport = FeedUtils.strings.formatStringFromName(
-                             "subscribe-OPMLImportInvalidFile", [aFile.leafName], 1);
+                             "subscribe-OPMLImportInvalidFile", [aFile.leafName]);
           }
         }
       })
       .catch(function(error) {
         statusReport = FeedUtils.strings.GetStringFromName(
                          "subscribe-errorOpeningFile");
         FeedUtils.log.error("importOPMLFile: error - " + error.message);
       });