Part 1:
Bug 1354530 - Update the strings about Storage Manager according to the latest v1 specs, r=jaws
MozReview-Commit-ID: H9gCEZS7U3N
--- a/browser/components/preferences/siteDataRemoveSelected.js
+++ b/browser/components/preferences/siteDataRemoveSelected.js
@@ -9,16 +9,21 @@ Cu.import("resource://gre/modules/Servic
"use strict";
let gSiteDataRemoveSelected = {
_tree: null,
init() {
+ let bundlePreferences = document.getElementById("bundlePreferences");
+ let acceptBtn = document.getElementById("SiteDataRemoveSelectedDialog")
+ .getButton("accept");
+ acceptBtn.label = bundlePreferences.getString("acceptRemove");
+
// Organize items for the tree from the argument
let hostsTable = window.arguments[0].hostsTable;
let visibleItems = [];
let itemsTable = new Map();
for (let [ baseDomain, hosts ] of hostsTable) {
// In the beginning, only display base domains in the topmost level.
visibleItems.push({
level: 0,
--- a/browser/components/preferences/siteDataRemoveSelected.xul
+++ b/browser/components/preferences/siteDataRemoveSelected.xul
@@ -32,17 +32,17 @@
<vbox flex="1">
<!-- Only show this label on OS X because of no dialog title -->
<label id="removing-label"
#ifndef XP_MACOSX
hidden="true"
#endif
>&removingDialog.title;</label>
<separator class="thin"/>
- <description id="removing-description">&removingDialog.description;</description>
+ <description id="removing-description">&removingSelected.description;</description>
</vbox>
</hbox>
<separator />
<vbox flex="1">
<label>&siteTree.label;</label>
<separator class="thin"/>
--- a/browser/components/preferences/siteDataSettings.js
+++ b/browser/components/preferences/siteDataSettings.js
@@ -31,25 +31,29 @@ let gSiteDataSettings = {
init() {
function setEventListener(id, eventType, callback) {
document.getElementById(id)
.addEventListener(eventType, callback.bind(gSiteDataSettings));
}
this._list = document.getElementById("sitesList");
this._searchBox = document.getElementById("searchBox");
- this._prefStrBundle = document.getElementById("bundlePreferences")
+ this._prefStrBundle = document.getElementById("bundlePreferences");
SiteDataManager.getSites().then(sites => {
this._sites = sites;
let sortCol = document.getElementById("hostCol");
this._sortSites(this._sites, sortCol);
this._buildSitesList(this._sites);
Services.obs.notifyObservers(null, "sitedata-settings-init", null);
});
+ let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
+ let settingsDescription = document.getElementById("settingsDescription");
+ settingsDescription.textContent = this._prefStrBundle.getFormattedString("siteDataSettings.description", [brandShortName]);
+
setEventListener("hostCol", "click", this.onClickTreeCol);
setEventListener("usageCol", "click", this.onClickTreeCol);
setEventListener("statusCol", "click", this.onClickTreeCol);
setEventListener("cancel", "command", this.close);
setEventListener("save", "command", this.saveChanges);
setEventListener("searchBox", "command", this.onCommandSearch);
setEventListener("removeAll", "command", this.onClickRemoveAll);
setEventListener("removeSelected", "command", this.onClickRemoveSelected);
@@ -134,23 +138,24 @@ let gSiteDataSettings = {
if (keyword && !host.includes(keyword)) {
continue;
}
if (data.userAction === "remove") {
continue;
}
- let statusStrId = data.status === Ci.nsIPermissionManager.ALLOW_ACTION ? "important" : "default";
let size = DownloadUtils.convertByteUnits(data.usage);
let item = document.createElement("richlistitem");
item.setAttribute("data-origin", data.uri.spec);
item.setAttribute("host", host);
- item.setAttribute("status", this._prefStrBundle.getString(statusStrId));
item.setAttribute("usage", this._prefStrBundle.getFormattedString("siteUsage", size));
+ if (data.status === Ci.nsIPermissionManager.ALLOW_ACTION ) {
+ item.setAttribute("status", this._prefStrBundle.getString("persistent"));
+ }
this._list.appendChild(item);
}
this._updateButtonsState();
},
_removeSiteItems(items) {
for (let i = items.length - 1; i >= 0; --i) {
let item = items[i];
--- a/browser/components/preferences/siteDataSettings.xul
+++ b/browser/components/preferences/siteDataSettings.xul
@@ -17,24 +17,25 @@
style="width: 45em;"
onload="gSiteDataSettings.init();"
persist="screenX screenY width height">
<script src="chrome://browser/content/preferences/siteDataSettings.js"/>
<stringbundle id="bundlePreferences"
src="chrome://browser/locale/preferences/preferences.properties"/>
+ <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
<vbox flex="1">
- <description>&settings.description;</description>
+ <description id="settingsDescription"></description>
<separator class="thin"/>
<hbox id="searchBoxContainer">
<textbox id="searchBox" type="search" flex="1"
- placeholder="&searchPlaceHolder;" accesskey="&searchPlaceHolder.accesskey;"/>
+ placeholder="&searchTextboxPlaceHolder;" accesskey="&searchTextboxPlaceHolder.accesskey;"/>
</hbox>
<separator class="thin"/>
<richlistbox id="sitesList" orient="vertical" flex="1">
<listheader>
<treecol flex="4" width="50" label="&hostCol.label;" id="hostCol"/>
<treecol flex="2" width="50" label="&statusCol.label;" id="statusCol"/>
<treecol flex="1" width="50" label="&usageCol.label;" id="usageCol"/>
--- a/browser/locales/en-US/chrome/browser/preferences-old/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences-old/preferences.properties
@@ -183,19 +183,21 @@ actualAppCacheSize=Your application cach
# e.g., "The total usage is currently using 200 MB"
# %1$S = size
# %2$S = unit (MB, KB, etc.)
totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
loadingSiteDataSize=Calculating site data size…
clearSiteDataPromptTitle=Clear all cookies and site data
clearSiteDataPromptText=Selecting ‘Clear Now’ will clear all cookies and site data stored by Firefox. This may sign you out of websites and remove offline web content.
clearSiteDataNow=Clear Now
-important=Important
-default=Default
+persistent=Persistent
siteUsage=%1$S %2$S
+acceptRemove=Remove
+# LOCALIZATION NOTE (siteDataSettings.description): %S = brandShortName
+siteDataSettings.description=The following websites store site data on your computer. %S keeps data from sites with persistent storage until you delete it, and deletes data from sites with non-persistent storage as space is needed.
# LOCALIZATION NOTE (removeAllSiteData, removeAllSiteDataShown):
# removeAllSiteData and removeAllSiteDataShown are both used on the same one button,
# never displayed together and can share the same accesskey.
# When only partial sites are shown as a result of keyword search,
# removeAllShown is displayed as button label.
# removeAll is displayed when no keyword search and all sites are shown.
removeAllSiteData.label=Remove All
removeAllSiteData.accesskey=e
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -183,19 +183,21 @@ actualAppCacheSize=Your application cach
# e.g., "The total usage is currently using 200 MB"
# %1$S = size
# %2$S = unit (MB, KB, etc.)
totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
loadingSiteDataSize=Calculating site data size…
clearSiteDataPromptTitle=Clear all cookies and site data
clearSiteDataPromptText=Selecting ‘Clear Now’ will clear all cookies and site data stored by Firefox. This may sign you out of websites and remove offline web content.
clearSiteDataNow=Clear Now
-important=Important
-default=Default
+persistent=Persistent
siteUsage=%1$S %2$S
+acceptRemove=Remove
+# LOCALIZATION NOTE (siteDataSettings.description): %S = brandShortName
+siteDataSettings.description=The following websites store site data on your computer. %S keeps data from sites with persistent storage until you delete it, and deletes data from sites with non-persistent storage as space is needed.
# LOCALIZATION NOTE (removeAllSiteData, removeAllSiteDataShown):
# removeAllSiteData and removeAllSiteDataShown are both used on the same one button,
# never displayed together and can share the same accesskey.
# When only partial sites are shown as a result of keyword search,
# removeAllShown is displayed as button label.
# removeAll is displayed when no keyword search and all sites are shown.
removeAllSiteData.label=Remove All
removeAllSiteData.accesskey=e
--- a/browser/locales/en-US/chrome/browser/preferences/siteDataSettings.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/siteDataSettings.dtd
@@ -1,20 +1,19 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY window.title "Settings - Site Data">
-<!ENTITY settings.description "The following websites asked to store site data in your disk. You can specify which websites are allowed to store site data. Default site data is temporary and could be deleted automatically.">
<!ENTITY hostCol.label "Site">
<!ENTITY statusCol.label "Status">
<!ENTITY usageCol.label "Storage">
-<!ENTITY searchPlaceHolder "Search">
-<!ENTITY searchPlaceHolder.accesskey "S">
+<!ENTITY searchTextboxPlaceHolder "Search websites">
+<!ENTITY searchTextboxPlaceHolder.accesskey "S">
<!ENTITY removeSelected.label "Remove Selected">
<!ENTITY removeSelected.accesskey "r">
<!ENTITY save.label "Save Changes">
<!ENTITY save.accesskey "a">
<!ENTITY cancel.label "Cancel">
<!ENTITY cancel.accesskey "C">
<!ENTITY removingDialog.title "Removing Site Data">
-<!ENTITY removingDialog.description "Removing site data will also remove cookies. This may log you out of websites and remove offline web content. Are you sure you want to make the changes?">
+<!ENTITY removingSelected.description "Removing site data will also remove related cookies and offline web content. This may log you out of websites. Are you sure you want to make the changes?">
<!ENTITY siteTree.label "The following website cookies will be removed:">