Bug 1362112 - Add missing string in aboutUrlClassifier.properties. r?francois
MozReview-Commit-ID: HXptt8ElxSX
--- a/toolkit/components/url-classifier/content/listmanager.js
+++ b/toolkit/components/url-classifier/content/listmanager.js
@@ -575,17 +575,17 @@ PROT_ListManager.prototype.updateError_
log("update error for " + table + " from " + updateUrl + ": " + result + "\n");
// There was some trouble applying the updates. Don't try again for at least
// updateInterval milliseconds.
this.updateCheckers_[updateUrl] =
new G_Alarm(BindToObject(this.checkForUpdates, this, updateUrl),
this.updateInterval, false);
Services.obs.notifyObservers(null, "safebrowsing-update-finished",
- "update error(" + result + ")");
+ "update error: " + result);
}
/**
* Callback function when the download failed
* @param status String http status or an empty string if connection refused.
*/
PROT_ListManager.prototype.downloadError_ = function(table, updateUrl, status) {
log("download error for " + table + ": " + status + "\n");
@@ -603,17 +603,17 @@ PROT_ListManager.prototype.downloadError
} else {
log("Got non error status for error callback?!");
}
this.updateCheckers_[updateUrl] =
new G_Alarm(BindToObject(this.checkForUpdates, this, updateUrl),
delay, false);
Services.obs.notifyObservers(null, "safebrowsing-update-finished",
- "download error(" + status + ")");
+ "download error: " + status);
}
PROT_ListManager.prototype.QueryInterface = function(iid) {
if (iid.equals(Ci.nsISupports) ||
iid.equals(Ci.nsIUrlListManager) ||
iid.equals(Ci.nsITimerCallback))
return this;
--- a/toolkit/content/aboutUrlClassifier.js
+++ b/toolkit/content/aboutUrlClassifier.js
@@ -80,17 +80,27 @@ var Provider = {
return;
}
this.refresh([p]);
document.getElementById("update-" + p).disabled = false;
let elem = document.getElementById(p + "-col-lastupdateresult");
- elem.childNodes[0].nodeValue = aData;
+ if (aData.startsWith("success")) {
+ elem.childNodes[0].nodeValue = bundle.GetStringFromName("success");
+ } else if (aData.startsWith("update error")) {
+ elem.childNodes[0].nodeValue =
+ bundle.formatStringFromName("updateError", [aData.split(": ")[1]], 1);
+ } else if (aData.startsWith("download error")) {
+ elem.childNodes[0].nodeValue =
+ bundle.formatStringFromName("downloadError", [aData.split(": ")[1]], 1);
+ } else {
+ elem.childNodes[0].nodeValue = aData;
+ }
},
register() {
// Handle begin update
this.onBeginUpdate = this.onBeginUpdate.bind(this);
Services.obs.addObserver(this.onBeginUpdate, UPDATE_BEGIN);
// Handle finish update
--- a/toolkit/locales/en-US/chrome/global/aboutUrlClassifier.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutUrlClassifier.properties
@@ -12,8 +12,14 @@ EnableSBJSLog = Enable Safe Browsing JS
Enabled = Enabled
Disabled = Disabled
Updating = updating
CannotUpdate = cannot update
+
+success = success
+
+updateError = update error (%S)
+
+downloadError = download error (%S)
\ No newline at end of file