Bug 627911 - Fix string errors in extensions.js [r=wesj]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 21 Jan 2011 16:37:52 -0800
changeset 2677 840639ac20d8fdf06303d0957635add581588870
parent 2676 07b3e2443c35113aeab939412444a7676ee79143
child 2678 9d31f9f5a56b9d31872334c0fe4849aa7d08c079
push id2250
push usermbrubeck@mozilla.com
push dateSat, 22 Jan 2011 00:38:48 +0000
reviewerswesj
bugs627911
Bug 627911 - Fix string errors in extensions.js [r=wesj]
chrome/content/extensions.js
--- a/chrome/content/extensions.js
+++ b/chrome/content/extensions.js
@@ -283,17 +283,17 @@ var ExtensionsView = {
 
   hideOnSelect: function ev_handleEvent(aEvent) {
     // When list selection changes, be sure to close up any open options sections
     if (aEvent.target == this._list)
       this.hideOptions();
   },
 
   _createLocalAddon: function ev__createLocalAddon(aAddon) {
-    let strings = Elements.browserBundle;
+    let strings = Services.strings.createBundle("chrome://browser/locale/browser.properties");
 
     let appManaged = (aAddon.scope == AddonManager.SCOPE_APPLICATION);
     let opType = this._getOpTypeForOperations(aAddon.pendingOperations);
     let updateable = (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) > 0;
     let uninstallable = (aAddon.permissions & AddonManager.PERM_CAN_UNINSTALL) > 0;
 
     let blocked = "";
     switch(aAddon.blocklistState) {
@@ -931,50 +931,50 @@ AddonInstallListener.prototype = {
         ExtensionsView.addItem(element, "local");
       }
     }
 
     element.setAttribute("status", "success");
 
     // If we are updating an add-on, change the status
     if (element.hasAttribute("updating")) {
-      let strings = Elements.browserBundle;
+      let strings = Services.strings.createBundle("chrome://browser/locale/browser.properties");
       element.setAttribute("updateStatus", strings.getFormattedString("addonUpdate.updated", [aAddon.version]));
       element.removeAttribute("updating");
     }
   },
 
-  onInstallFailed: function(aInstall, aError) {
+  onInstallFailed: function(aInstall) {
     this._showInstallCompleteAlert(false);
 
     if (ExtensionsView.visible) {
       let element = ExtensionsView.getElementForAddon(aInstall.sourceURI.spec);
       if (!element)
         return;
 
       element.removeAttribute("opType");
       let strings = Services.strings.createBundle("chrome://global/locale/xpinstall/xpinstall.properties");
 
       let error = null;
-      switch (aError) {
+      switch (aInstall.error) {
       case AddonManager.ERROR_NETWORK_FAILURE:
         error = "error-228";
         break;
       case AddonManager.ERROR_INCORRECT_HASH:
         error = "error-261";
         break;
       case AddonManager.ERROR_CORRUPT_FILE:
         error = "error-207";
         break;
       }
 
       try {
         var msg = strings.GetStringFromName(error);
       } catch (ex) {
-        msg = strings.formatStringFromName("unknown.error", [aError]);
+        msg = strings.formatStringFromName("unknown.error", [aInstall.error], 1);
       }
       element.setAttribute("error", msg);
     }
   },
 
   onDownloadProgress: function xpidm_onDownloadProgress(aInstall) {
     let element = ExtensionsView.getElementForAddon(aInstall.sourceURI.spec);
 
@@ -989,18 +989,18 @@ AddonInstallListener.prototype = {
     let opType = element.getAttribute("opType");
     if (!opType)
       element.setAttribute("opType", "needs-install");
 
     let progress = Math.round((aInstall.progress / aInstall.maxProgress) * 100);
     element.setAttribute("progress", progress);
   },
 
-  onDownloadFailed: function(aInstall, aError) {
-    this.onInstallFailed(aInstall, aError);
+  onDownloadFailed: function(aInstall) {
+    this.onInstallFailed(aInstall);
   },
 
   onDownloadCancelled: function(aInstall) {
     let strings = Strings.browser;
     let brandBundle = Strings.brand;
     let brandShortName = brandBundle.GetStringFromName("brandShortName");
     let host = (aInstall.originatingURI instanceof Ci.nsIStandardURL) && aInstall.originatingURI.host;
     if (!host)