Backed out 4 changesets (bug 1491676) for browser-chrome permissions failures CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Wed, 07 Nov 2018 13:44:26 +0200
changeset 444847 b5e996a1d34b48ae37d30f51d2f19de8f9c7f517
parent 444846 891cd385f0ae6c38b8a218dde732ff467ea2af0f
child 444848 56ad43d18220e1ec276694c948406ae236f31941
push id72516
push useraciure@mozilla.com
push dateWed, 07 Nov 2018 11:44:56 +0000
treeherderautoland@b5e996a1d34b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1491676
milestone65.0a1
backs oute860d0d115d04d12cbc60723c40cd38671305946
04b83b7977c4875f8e7da73feb6c4306c1b4e056
eb19b384d908980abc0a36d3bda1158c95e97563
76ea995336dcf0fa0d71c15854455831b102c0d1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1491676) for browser-chrome permissions failures CLOSED TREE Backed out changeset e860d0d115d0 (bug 1491676) Backed out changeset 04b83b7977c4 (bug 1491676) Backed out changeset eb19b384d908 (bug 1491676) Backed out changeset 76ea995336dc (bug 1491676)
browser/base/content/browser-sets.inc
browser/base/content/browser.js
browser/components/preferences/in-content/main.js
browser/components/preferences/permissions.js
browser/locales/en-US/browser/preferences/permissions.ftl
browser/locales/en-US/browser/preferences/preferences.ftl
browser/locales/en-US/chrome/browser/preferences/preferences.properties
python/l10n/fluent_migrations/bug_1491676_preferences_properties.py
toolkit/content/widgets/notification.xml
toolkit/locales/en-US/chrome/mozapps/preferences/preferences.properties
toolkit/locales/en-US/toolkit/preferences/preferences.ftl
toolkit/locales/jar.mn
toolkit/mozapps/preferences/changemp.js
toolkit/mozapps/preferences/changemp.xul
toolkit/mozapps/preferences/removemp.js
toolkit/mozapps/preferences/removemp.xul
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -9,16 +9,17 @@
 #endif
 #endif
 
   <stringbundleset id="stringbundleset"
                    string-bookmarkthispage="&bookmarkThisPageCmd.label;"
                    string-editthisbookmark="&editThisBookmarkCmd.label;">
     <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundle_shell" src="chrome://browser/locale/shellservice.properties"/>
+    <stringbundle id="bundle_preferences" src="chrome://browser/locale/preferences/preferences.properties"/>
   </stringbundleset>
 
   <commandset id="mainCommandSet">
     <command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
     <command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
     <command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />
 
     <command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab(event);"/>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -516,17 +516,17 @@ const gSessionHistoryObserver = {
     // Clear undo history of the URL bar
     gURLBar.editor.transactionManager.clear();
   },
 };
 
 const gStoragePressureObserver = {
   _lastNotificationTime: -1,
 
-  async observe(subject, topic, data) {
+  observe(subject, topic, data) {
     if (topic != "QuotaManager::StoragePressure") {
       return;
     }
 
     const NOTIFICATION_VALUE = "storage-pressure-notification";
     let notificationBox = document.getElementById("high-priority-global-notificationbox");
     if (notificationBox.getNotificationWithValue(NOTIFICATION_VALUE)) {
       // Do not display the 2nd notification when there is already one
@@ -541,63 +541,69 @@ const gStoragePressureObserver = {
     const MIN_NOTIFICATION_INTERVAL_MS =
       Services.prefs.getIntPref("browser.storageManager.pressureNotification.minIntervalMS");
     let duration = Date.now() - this._lastNotificationTime;
     if (duration <= MIN_NOTIFICATION_INTERVAL_MS) {
       return;
     }
     this._lastNotificationTime = Date.now();
 
-    MozXULElement.insertFTLIfNeeded("branding/brand.ftl");
-    MozXULElement.insertFTLIfNeeded("browser/preferences/preferences.ftl");
-
     const BYTES_IN_GIGABYTE = 1073741824;
     const USAGE_THRESHOLD_BYTES = BYTES_IN_GIGABYTE *
       Services.prefs.getIntPref("browser.storageManager.pressureNotification.usageThresholdGB");
     let msg = "";
     let buttons = [];
     let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
+    let prefStrBundle = document.getElementById("bundle_preferences");
+    let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
     buttons.push({
-      "l10n-id": "space-alert-learn-more-button",
+      label: prefStrBundle.getString("spaceAlert.learnMoreButton.label"),
+      accessKey: prefStrBundle.getString("spaceAlert.learnMoreButton.accesskey"),
       callback(notificationBar, button) {
         let learnMoreURL = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
         // This is a content URL, loaded from trusted UX.
         openTrustedLinkIn(learnMoreURL, "tab");
       },
     });
     if (usage < USAGE_THRESHOLD_BYTES) {
       // The firefox-used space < 5GB, then warn user to free some disk space.
       // This is because this usage is small and not the main cause for space issue.
       // In order to avoid the bad and wrong impression among users that
       // firefox eats disk space a lot, indicate users to clean up other disk space.
-      [msg] = await document.l10n.formatValues([{id: "space-alert-under-5gb-message"}]);
+      msg = prefStrBundle.getFormattedString("spaceAlert.under5GB.message", [brandShortName]);
       buttons.push({
-        "l10n-id": "space-alert-under-5gb-ok-button",
+        label: prefStrBundle.getString("spaceAlert.under5GB.okButton.label"),
+        accessKey: prefStrBundle.getString("spaceAlert.under5GB.okButton.accesskey"),
         callback() {},
       });
     } else {
       // The firefox-used space >= 5GB, then guide users to about:preferences
       // to clear some data stored on firefox by websites.
-      [msg] = await document.l10n.formatValues([{id: "space-alert-over-5gb-message"}]);
+      let descriptionStringID = "spaceAlert.over5GB.message1";
+      let prefButtonLabelStringID = "spaceAlert.over5GB.prefButton.label";
+      let prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButton.accesskey";
+      if (AppConstants.platform == "win") {
+        descriptionStringID = "spaceAlert.over5GB.messageWin1";
+        prefButtonLabelStringID = "spaceAlert.over5GB.prefButtonWin.label";
+        prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButtonWin.accesskey";
+      }
+      msg = prefStrBundle.getFormattedString(descriptionStringID, [brandShortName]);
       buttons.push({
-        "l10n-id": "space-alert-over-5gb-pref-button",
+        label: prefStrBundle.getString(prefButtonLabelStringID),
+        accessKey: prefStrBundle.getString(prefButtonAccesskeyStringID),
         callback(notificationBar, button) {
           // The advanced subpanes are only supported in the old organization, which will
           // be removed by bug 1349689.
           openPreferences("privacy-sitedata", { origin: "storagePressure" });
         },
       });
     }
 
     notificationBox.appendNotification(
       msg, NOTIFICATION_VALUE, null, notificationBox.PRIORITY_WARNING_HIGH, buttons, null);
-
-    // This seems to be necessary to get the buttons to display correctly
-    // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1504216
-    document.l10n.translateFragment(notificationBox);
   },
 };
 
 var gPopupBlockerObserver = {
   handleEvent(aEvent) {
     if (aEvent.originalTarget != gBrowser.selectedBrowser)
       return;
 
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -2250,17 +2250,17 @@ var gMainPane = {
    * Displays a file picker in which the user can choose the location where
    * downloads are automatically saved, updating preferences and UI in
    * response to the choice, if one is made.
    */
   chooseFolder() {
     return this.chooseFolderTask().catch(Cu.reportError);
   },
   async chooseFolderTask() {
-    let [title] = await document.l10n.formatValues([{id: "choose-download-folder-title"}]);
+    let title = gMainPane._prefsBundle.getString("chooseDownloadFolderTitle");
     let folderListPref = Preferences.get("browser.download.folderList");
     let currentDirPref = await this._indexToFolder(folderListPref.value);
     let defDownloads = await this._indexToFolder(1);
     let fp = Cc["@mozilla.org/filepicker;1"].
       createInstance(Ci.nsIFilePicker);
 
     fp.init(window, title, Ci.nsIFilePicker.modeGetFolder);
     fp.appendFilters(Ci.nsIFilePicker.filterAll);
@@ -2315,29 +2315,28 @@ var gMainPane = {
       // When user has selected cloud storage, use value in currentDirPref to
       // compute index to display download folder label and icon to avoid
       // displaying blank downloadFolder label and icon on load of preferences UI
       // Set folderIndex to 1 if currentDirPref is unspecified
       folderIndex = currentDirPref.value ? await this._folderToIndex(currentDirPref.value) : 1;
     }
 
     // Display a 'pretty' label or the path in the UI.
-    // note: downloadFolder.value is not read elsewhere in the code, its only purpose is to display to the user
     if (folderIndex == 2) {
       // Force the left-to-right direction when displaying a custom path.
       downloadFolder.value = currentDirPref.value ?
         `\u2066${currentDirPref.value.path}\u2069` : "";
       iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
     } else if (folderIndex == 1) {
       // 'Downloads'
-      [downloadFolder.value] = await document.l10n.formatValues([{id: "downloads-folder-name"}]);
+      downloadFolder.value = gMainPane._prefsBundle.getString("downloadsFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
     } else {
       // 'Desktop'
-      [downloadFolder.value] = await document.l10n.formatValues([{id: "desktop-folder-name"}]);
+      downloadFolder.value = gMainPane._prefsBundle.getString("desktopFolderName");
       iconUrlSpec = fph.getURLSpecFromFile(await this._getDownloadsFolder("Desktop"));
     }
     downloadFolder.style.backgroundImage = "url(moz-icon://" + iconUrlSpec + "?size=16)";
   },
 
   /**
    * Returns the Downloads folder.  If aFolder is "Desktop", then the Downloads
    * folder returned is the desktop folder; otherwise, it is a folder whose name
--- a/browser/components/preferences/permissions.js
+++ b/browser/components/preferences/permissions.js
@@ -46,27 +46,29 @@ var gPermissionManager = {
   _permissionsToAdd: new Map(),
   _permissionsToDelete: new Map(),
   _bundle: null,
   _list: null,
   _removeButton: null,
   _removeAllButton: null,
 
   onLoad() {
+    this._bundle = document.getElementById("bundlePreferences");
     let params = window.arguments[0];
     document.mozSubdialogReady = this.init(params);
   },
 
   async init(params) {
     if (!this._isObserving) {
       Services.obs.addObserver(this, "perm-changed");
       this._isObserving = true;
     }
 
     this._type = params.permissionType;
+    this._manageCapability = params.manageCapability;
     this._list = document.getElementById("permissionsBox");
     this._removeButton = document.getElementById("removePermission");
     this._removeAllButton = document.getElementById("removeAllPermissions");
 
     let permissionsText = document.getElementById("permissionsText");
 
     let l10n = permissionExceptionsL10n[this._type];
     document.l10n.setAttributes(permissionsText, l10n.description);
@@ -127,51 +129,57 @@ var gPermissionManager = {
       return;
 
     if (data == "added") {
       this._addPermissionToList(permission);
       this.buildPermissionsList();
     } else if (data == "changed") {
       let p = this._permissions.get(permission.principal.origin);
       p.capability = permission.capability;
+      p.l10nId = this._getCapabilityString(permission.capability);
       this._handleCapabilityChange(p);
       this.buildPermissionsList();
     } else if (data == "deleted") {
       this._removePermissionFromList(permission.principal.origin);
     }
   },
 
   _handleCapabilityChange(perm) {
     let permissionlistitem = document.getElementsByAttribute("origin", perm.origin)[0];
-    document.l10n.setAttributes(permissionlistitem.querySelector(".website-capability-value"), this._getCapabilityL10nId(perm.capability));
+    permissionlistitem.querySelector(".website-capability-value").setAttribute("value", perm.capability);
   },
 
-  _getCapabilityL10nId(capability) {
+  _getCapabilityString(capability) {
     let stringKey = null;
     switch (capability) {
     case Ci.nsIPermissionManager.ALLOW_ACTION:
-      stringKey = "permissions-capabilities-listitem-allow";
+      stringKey = "can";
       break;
     case Ci.nsIPermissionManager.DENY_ACTION:
-      stringKey = "permissions-capabilities-listitem-block";
+      stringKey = "cannot";
       break;
     case Ci.nsICookiePermission.ACCESS_ALLOW_FIRST_PARTY_ONLY:
-      stringKey = "permissions-capabilities-listitem-allow-first-party";
+      stringKey = "canAccessFirstParty";
       break;
     case Ci.nsICookiePermission.ACCESS_SESSION:
-      stringKey = "permissions-capabilities-listitem-allow-session";
+      stringKey = "canSession";
       break;
     default:
       throw new Error(`Unknown capability: ${capability}`);
     }
-    return stringKey;
+    return this._bundle.getString(stringKey);
   },
 
   _addPermissionToList(perm) {
-    let p = new Permission(perm.principal, perm.type, perm.capability);
+    // Ignore unrelated permission types and excluded capabilities.
+    if (perm.type !== this._type ||
+        (this._manageCapability && perm.capability != this._manageCapability))
+      return;
+    let capabilityString = this._getCapabilityString(perm.capability);
+    let p = new Permission(perm.principal, perm.type, capabilityString);
     this._permissions.set(p.origin, p);
   },
 
   addPermission(capability) {
     let textbox = document.getElementById("url");
     let input_url = textbox.value.replace(/^\s*/, ""); // trim any leading space
     let principal;
     try {
@@ -200,25 +208,27 @@ var gPermissionManager = {
         {id: "permissions-invalid-uri-title"},
         {id: "permissions-invalid-uri-label"},
       ]).then(([title, message]) => {
         Services.prompt.alert(window, title, message);
       });
       return;
     }
 
+    let capabilityString = this._getCapabilityString(capability);
+
     // check whether the permission already exists, if not, add it
     let permissionParams = {principal, type: this._type, capability};
     let existingPermission = this._permissions.get(principal.origin);
     if (!existingPermission) {
       this._permissionsToAdd.set(principal.origin, permissionParams);
       this._addPermissionToList(permissionParams);
       this.buildPermissionsList();
-    } else if (existingPermission.capability != capability) {
-      existingPermission.capability = capability;
+    } else if (existingPermission.capability != capabilityString) {
+      existingPermission.capability = capabilityString;
       this._permissionsToAdd.set(principal.origin, permissionParams);
       this._handleCapabilityChange(existingPermission);
     }
 
     textbox.value = "";
     textbox.focus();
 
     // covers a case where the site exists already, so the buttons don't disable
@@ -269,17 +279,17 @@ var gPermissionManager = {
     hbox.setAttribute("flex", "3");
     hbox.appendChild(website);
     row.appendChild(hbox);
 
     if (!this._hideStatusColumn) {
       hbox = document.createXULElement("hbox");
       let capability = document.createXULElement("label");
       capability.setAttribute("class", "website-capability-value");
-      document.l10n.setAttributes(capability, this._getCapabilityL10nId(permission.capability));
+      capability.setAttribute("value", permission.capability);
       hbox.setAttribute("width", "0");
       hbox.setAttribute("class", "website-name");
       hbox.setAttribute("flex", "1");
       hbox.appendChild(capability);
       row.appendChild(hbox);
     }
 
     richlistitem.appendChild(row);
--- a/browser/locales/en-US/browser/preferences/permissions.ftl
+++ b/browser/locales/en-US/browser/preferences/permissions.ftl
@@ -51,21 +51,16 @@ permissions-searchbox =
 
 permissions-capabilities-allow =
     .label = Allow
 permissions-capabilities-block =
     .label = Block
 permissions-capabilities-prompt =
     .label = Always Ask
 
-permissions-capabilities-listitem-allow = Allow
-permissions-capabilities-listitem-block = Block
-permissions-capabilities-listitem-allow-first-party = Allow first party only
-permissions-capabilities-listitem-allow-session = Allow for Session
-
 ## Invalid Hostname Dialog
 
 permissions-invalid-uri-title = Invalid Hostname Entered
 permissions-invalid-uri-label = Please enter a valid hostname
 
 ## Exceptions - Tracking Protection
 
 permissions-exceptions-content-blocking-window =
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -1005,45 +1005,12 @@ certs-enable-ocsp =
 certs-view =
     .label = View Certificates…
     .accesskey = C
 
 certs-devices =
     .label = Security Devices…
     .accesskey = D
 
-space-alert-learn-more-button =
-    .label = Learn More
-    .accesskey = L
-
-space-alert-over-5gb-pref-button =
-    .label =
-        { PLATFORM() ->
-            [windows] Open Options
-           *[other] Open Preferences
-        }
-    .accesskey =
-        { PLATFORM() ->
-            [windows] O
-           *[other] O
-        }
-
-space-alert-over-5gb-message =
-    { PLATFORM() ->
-        [windows] { -brand-short-name } is running out of disk space. Website contents may not display properly. You can clear stored data in Options > Privacy & Security > Cookies and Site Data.
-       *[other] { -brand-short-name } is running out of disk space. Website contents may not display properly. You can clear stored data in Preferences > Privacy & Security > Cookies and Site Data.
-    }
-
-space-alert-under-5gb-ok-button =
-    .label = OK, Got it
-    .accesskey = K
-
-space-alert-under-5gb-message = { -brand-short-name } is running out of disk space. Website contents may not display properly. Visit “Learn More” to optimize your disk usage for better browsing experience.
-
-## The following strings are used in the Download section of settings
-desktop-folder-name = Desktop
-downloads-folder-name = Downloads
-choose-download-folder-title = Choose Download Folder:
-
 # Variables:
 #   $service-name (String) - Name of a cloud storage provider like Dropbox, Google Drive, etc...
 save-files-to-cloud-storage =
     .label = Save files to { $service-name }
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -2,16 +2,22 @@
 # 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/.
 
 #### Master Password
 
 pw_change2empty_in_fips_mode=You are currently in FIPS mode. FIPS requires a non-empty Master Password.
 pw_change_failed_title=Password Change Failed
 
+#### Downloads
+
+desktopFolderName=Desktop
+downloadsFolderName=Downloads
+chooseDownloadFolderTitle=Choose Download Folder:
+
 #### Applications
 
 fileEnding=%S file
 saveFile=Save File
 
 # LOCALIZATION NOTE (useApp, useDefault): %S = Application name
 useApp=Use %S
 useDefault=Use %S (default)
@@ -29,8 +35,34 @@ usePluginIn=Use %S (in %S)
 
 # LOCALIZATION NOTE (previewInApp): %S = brandShortName
 previewInApp=Preview in %S
 
 # LOCALIZATION NOTE (typeDescriptionWithType):
 # %1$S = type description (for example "Portable Document Format")
 # %2$S = type (for example "application/pdf")
 typeDescriptionWithType=%S (%S)
+
+#### Permission labels
+
+can=Allow
+canAccessFirstParty=Allow first party only
+canSession=Allow for Session
+cannot=Block
+prompt=Always Ask
+
+spaceAlert.learnMoreButton.label=Learn More
+spaceAlert.learnMoreButton.accesskey=L
+spaceAlert.over5GB.prefButton.label=Open Preferences
+spaceAlert.over5GB.prefButton.accesskey=O
+# LOCALIZATION NOTE (spaceAlert.over5GB.prefButtonWin.label): On Windows Preferences is called Options
+spaceAlert.over5GB.prefButtonWin.label=Open Options
+spaceAlert.over5GB.prefButtonWin.accesskey=O
+# LOCALIZATION NOTE (spaceAlert.over5GB.message1): %S = brandShortName
+spaceAlert.over5GB.message1=%S is running out of disk space. Website contents may not display properly. You can clear stored data in Preferences > Privacy & Security > Cookies and Site Data.
+# LOCALIZATION NOTE (spaceAlert.over5GB.messageWin1):
+# - On Windows Preferences is called Options
+# - %S = brandShortName
+spaceAlert.over5GB.messageWin1=%S is running out of disk space. Website contents may not display properly. You can clear stored data in Options > Privacy & Security > Cookies and Site Data.
+spaceAlert.under5GB.okButton.label=OK, Got it
+spaceAlert.under5GB.okButton.accesskey=K
+# LOCALIZATION NOTE (spaceAlert.under5GB.message): %S = brandShortName
+spaceAlert.under5GB.message=%S is running out of disk space. Website contents may not display properly. Visit “Learn More” to optimize your disk usage for better browsing experience.
deleted file mode 100644
--- a/python/l10n/fluent_migrations/bug_1491676_preferences_properties.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# coding=utf8
-
-# Any copyright is dedicated to the Public Domain.
-# http://creativecommons.org/publicdomain/zero/1.0/
-
-from __future__ import absolute_import
-import fluent.syntax.ast as FTL
-from fluent.migrate.helpers import transforms_from
-from fluent.migrate.helpers import VARIABLE_REFERENCE, TERM_REFERENCE
-from fluent.migrate import REPLACE, COPY
-
-
-def migrate(ctx):
-    """Bug 1486937 - Move strings from preferences.properties to Fluent"""
-
-    ctx.add_transforms(
-        "toolkit/toolkit/preferences/preferences.ftl",
-        "toolkit/toolkit/preferences/preferences.ftl",
-        transforms_from(
-            """
-password-not-set =
-        .value = { COPY(from_path, "password_not_set") }
-failed-pw-change = { COPY(from_path, "failed_pw_change") }
-incorrect-pw = { COPY(from_path, "incorrect_pw") }
-pw-empty-warning = { COPY(from_path, "pw_empty_warning") }
-pw-change-ok = { COPY(from_path, "pw_change_ok") } { -pw-empty-warning }
-pw-erased-ok = { COPY(from_path, "pw_erased_ok") } { -pw-empty-warning }
-pw-not-wanted = { COPY(from_path, "pw_not_wanted") }
-pw-change2empty-in-fips-mode = { COPY(from_path, "pw_change2empty_in_fips_mode") }
-pw-change-success-title = { COPY(from_path, "pw_change_success_title") }
-pw-change-failed-title = { COPY(from_path, "pw_change_failed_title") }
-pw-remove-button =
-    .label = { COPY(from_path, "pw_remove_button") }
-""", from_path="toolkit/chrome/mozapps/preferences/preferences.properties"))
-
-    ctx.add_transforms(
-        "browser/browser/preferences/preferences.ftl",
-        "browser/browser/preferences/preferences.ftl",
-        transforms_from(
-            """
-space-alert-learn-more-button =
-        .label = { COPY(from_path, "spaceAlert.learnMoreButton.label")}
-        .accesskey = { COPY(from_path, "spaceAlert.learnMoreButton.accesskey")}
-space-alert-under-5gb-ok-button =
-        .label = { COPY(from_path, "spaceAlert.under5GB.okButton.label")}
-        .accesskey = { COPY(from_path, "spaceAlert.under5GB.okButton.accesskey")}
-desktop-folder-name = { COPY(from_path, "desktopFolderName")}
-downloads-folder-name = { COPY(from_path, "downloadsFolderName")}
-choose-download-folder-title = { COPY(from_path, "chooseDownloadFolderTitle")}
-""", from_path="browser/chrome/browser/preferences/preferences.properties"))
-
-    ctx.add_transforms(
-        "browser/browser/preferences/preferences.ftl",
-        "browser/browser/preferences/preferences.ftl",
-        [
-            FTL.Message(
-                id=FTL.Identifier("space-alert-under-5gb-message"),
-                value=REPLACE(
-                    "browser/chrome/browser/preferences/preferences.properties",
-                    "spaceAlert.under5GB.message",
-                    {
-                        "%S": TERM_REFERENCE(
-                            "-brand-short-name"
-                        ),
-                    }
-                )
-            ),
-            FTL.Message(
-                id=FTL.Identifier("space-alert-over-5gb-pref-button"),
-                attributes=[
-                    FTL.Attribute(
-                        id=FTL.Identifier("label"),
-                        value=FTL.Pattern(
-                            elements=[
-                                FTL.Placeable(
-                                    expression=FTL.SelectExpression(
-                                        selector=FTL.CallExpression(
-                                            callee=FTL.Function("PLATFORM")
-                                        ),
-                                        variants=[
-                                            FTL.Variant(
-                                                key=FTL.VariantName("windows"),
-                                                default=False,
-                                                value=COPY(
-                                                    "browser/chrome/browser/preferences/preferences.properties",
-                                                    "spaceAlert.over5GB.prefButtonWin.label"
-                                                )
-                                            ),
-                                            FTL.Variant(
-                                                key=FTL.VariantName("other"),
-                                                default=True,
-                                                value=COPY(
-                                                    "browser/chrome/browser/preferences/preferences.properties",
-                                                    "spaceAlert.over5GB.prefButton.label"
-                                                )
-                                            ),
-                                        ]
-                                    )
-                                )
-                            ]
-                        )
-                    ),
-                    FTL.Attribute(
-                        id=FTL.Identifier("accesskey"),
-                        value=FTL.Pattern(
-                            elements=[
-                                FTL.Placeable(
-                                    expression=FTL.SelectExpression(
-                                        selector=FTL.CallExpression(
-                                            callee=FTL.Function("PLATFORM")
-                                        ),
-                                        variants=[
-                                            FTL.Variant(
-                                                key=FTL.VariantName("windows"),
-                                                default=False,
-                                                value=COPY(
-                                                    "browser/chrome/browser/preferences/preferences.properties",
-                                                    "spaceAlert.over5GB.prefButtonWin.accesskey"
-                                                )
-                                            ),
-                                            FTL.Variant(
-                                                key=FTL.VariantName("other"),
-                                                default=True,
-                                                value=COPY(
-                                                    "browser/chrome/browser/preferences/preferences.properties",
-                                                    "spaceAlert.over5GB.prefButton.accesskey"
-                                                )
-                                            ),
-                                        ]
-                                    )
-                                )
-                            ]
-                        )
-                    ),
-                ]
-            ),
-            FTL.Message(
-                id=FTL.Identifier("space-alert-over-5gb-message"),
-                value=FTL.Pattern(
-                    elements=[
-                        FTL.Placeable(
-                            expression=FTL.SelectExpression(
-                                selector=FTL.CallExpression(
-                                    callee=FTL.Function("PLATFORM")
-                                ),
-                                variants=[
-                                    FTL.Variant(
-                                        key=FTL.VariantName("windows"),
-                                        default=False,
-                                        value=REPLACE(
-                                            "browser/chrome/browser/preferences/preferences.properties",
-                                            "spaceAlert.over5GB.messageWin1",
-                                            {
-                                                "%S": TERM_REFERENCE(
-                                                    "-brand-short-name"
-                                                ),
-                                            }
-                                        )
-                                    ),
-                                    FTL.Variant(
-                                        key=FTL.VariantName("other"),
-                                        default=True,
-                                        value=REPLACE(
-                                            "browser/chrome/browser/preferences/preferences.properties",
-                                            "spaceAlert.over5GB.message1",
-                                            {
-                                                "%S": TERM_REFERENCE(
-                                                    "-brand-short-name"
-                                                ),
-                                            }
-                                        )
-                                    ),
-                                ]
-                            )
-                        )
-                    ]
-                )
-            ),
-        ],
-    )
-
-    ctx.add_transforms(
-        "browser/browser/preferences/permissions.ftl",
-        "browser/browser/preferences/permissions.ftl",
-        transforms_from(
-            """
-permissions-capabilities-listitem-allow = { COPY(from_path, "can")}
-permissions-capabilities-listitem-allow-first-party = { COPY(from_path, "canAccessFirstParty")}
-permissions-capabilities-listitem-allow-session = { COPY(from_path, "canSession")}
-permissions-capabilities-listitem-block = { COPY(from_path, "cannot")}
-""", from_path="browser/chrome/browser/preferences/preferences.properties"))
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -128,25 +128,19 @@
               // with isDefault set to true. If there is no such button, it is
               // added to the first button (unless that button has isDefault
               // set to false). There cannot be multiple default buttons.
               var defaultElem;
 
               for (var b = 0; b < aButtons.length; b++) {
                 var button = aButtons[b];
                 var buttonElem = document.createXULElement("button");
-
-                if (button["l10n-id"]) {
-                  buttonElem.setAttribute("data-l10n-id", button["l10n-id"]);
-                } else {
-                  buttonElem.setAttribute("label", button.label);
-                  if (typeof button.accessKey == "string")
-                    buttonElem.setAttribute("accesskey", button.accessKey);
-                }
-
+                buttonElem.setAttribute("label", button.label);
+                if (typeof button.accessKey == "string")
+                  buttonElem.setAttribute("accesskey", button.accessKey);
                 buttonElem.classList.add("notification-button");
 
                 if (button.isDefault ||
                     b == 0 && !("isDefault" in button))
                   defaultElem = buttonElem;
 
                 newitem.appendChild(buttonElem);
                 buttonElem.buttonInfo = button;
new file mode 100644
--- /dev/null
+++ b/toolkit/locales/en-US/chrome/mozapps/preferences/preferences.properties
@@ -0,0 +1,17 @@
+# 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/.
+
+#### Master Password
+
+password_not_set=(not set)
+failed_pw_change=Unable to change Master Password.
+incorrect_pw=You did not enter the correct current Master Password. Please try again.
+pw_change_ok=Master Password successfully changed.
+pw_erased_ok=You have deleted your Master Password. 
+pw_not_wanted=Warning! You have decided not to use a Master Password.
+pw_empty_warning=Your stored web and email passwords, form data, and private keys will not be protected.
+pw_change2empty_in_fips_mode=You are currently in FIPS mode. FIPS requires a non-empty Master Password.
+pw_change_success_title=Password Change Succeeded
+pw_change_failed_title=Password Change Failed
+pw_remove_button=Remove
deleted file mode 100644
--- a/toolkit/locales/en-US/toolkit/preferences/preferences.ftl
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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/.
-
-password-not-set =
-    .value = (not set)
-
-failed-pw-change = Unable to change Master Password.
-incorrect-pw = You did not enter the correct current Master Password. Please try again.
-pw-change-ok = Master Password successfully changed.
-
-pw-empty-warning = Your stored web and email passwords, form data, and private keys will not be protected.
-pw-erased-ok = You have deleted your Master Password. { pw-empty-warning }
-pw-not-wanted = Warning! You have decided not to use a Master Password. { pw-empty-warning }
-
-pw-change2empty-in-fips-mode = You are currently in FIPS mode. FIPS requires a non-empty Master Password.
-pw-change-success-title = Password Change Succeeded
-pw-change-failed-title = Password Change Failed
-pw-remove-button =
-    .label = Remove
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -85,16 +85,17 @@
 #ifndef MOZ_FENNEC
   locale/@AB_CD@/mozapps/extensions/extensions.properties         (%chrome/mozapps/extensions/extensions.properties)
   locale/@AB_CD@/mozapps/extensions/blocklist.dtd                 (%chrome/mozapps/extensions/blocklist.dtd)
 #endif
   locale/@AB_CD@/mozapps/handling/handling.dtd                    (%chrome/mozapps/handling/handling.dtd)
   locale/@AB_CD@/mozapps/handling/handling.properties             (%chrome/mozapps/handling/handling.properties)
   locale/@AB_CD@/mozapps/preferences/changemp.dtd                 (%chrome/mozapps/preferences/changemp.dtd)
   locale/@AB_CD@/mozapps/preferences/removemp.dtd                 (%chrome/mozapps/preferences/removemp.dtd)
+  locale/@AB_CD@/mozapps/preferences/preferences.properties       (%chrome/mozapps/preferences/preferences.properties)
   locale/@AB_CD@/mozapps/profile/createProfileWizard.dtd          (%chrome/mozapps/profile/createProfileWizard.dtd)
   locale/@AB_CD@/mozapps/profile/profileSelection.properties      (%chrome/mozapps/profile/profileSelection.properties)
   locale/@AB_CD@/mozapps/profile/profileSelection.dtd             (%chrome/mozapps/profile/profileSelection.dtd)
 #ifndef MOZ_FENNEC
   locale/@AB_CD@/mozapps/update/updates.dtd                       (%chrome/mozapps/update/updates.dtd)
   locale/@AB_CD@/mozapps/update/updates.properties                (%chrome/mozapps/update/updates.properties)
 #endif
 % locale pluginproblem @AB_CD@ %locale/@AB_CD@/pluginproblem/
--- a/toolkit/mozapps/preferences/changemp.js
+++ b/toolkit/mozapps/preferences/changemp.js
@@ -21,28 +21,30 @@ var pw1;
 function init() {
   pw1 = document.getElementById("pw1");
 
   process();
 }
 
 
 function process() {
+  let bundle = document.getElementById("bundlePreferences");
+
   // If the token is unitialized, don't use the old password box.
   // Otherwise, do.
 
   let tokenDB = Cc["@mozilla.org/security/pk11tokendb;1"]
                   .getService(Ci.nsIPK11TokenDB);
   let token = tokenDB.getInternalKeyToken();
   if (token) {
     let oldpwbox = document.getElementById("oldpw");
     let msgBox = document.getElementById("message");
     if ((token.needsLogin() && token.needsUserInit) || !token.needsLogin()) {
       oldpwbox.setAttribute("hidden", "true");
-      document.l10n.setAttributes(msgBox, "password-not-set");
+      msgBox.setAttribute("value", bundle.getString("password_not_set"));
       msgBox.setAttribute("hidden", "false");
 
       if (!token.needsLogin()) {
         oldpwbox.setAttribute("inited", "empty");
       } else {
         oldpwbox.setAttribute("inited", "true");
       }
 
@@ -60,30 +62,23 @@ function process() {
   if (params) {
     // Return value 0 means "canceled"
     params.SetInt(1, 0);
   }
 
   checkPasswords();
 }
 
-async function createAlert(titleL10nId, messageL10nId) {
-  const [title, message] = await document.l10n.formatValues([
-    {id: titleL10nId},
-    {id: messageL10nId},
-  ]);
-  Services.prompt.alert(window, title, message);
-}
-
 function setPassword() {
   var pk11db = Cc[nsPK11TokenDB].getService(nsIPK11TokenDB);
   var token = pk11db.getInternalKeyToken();
 
   var oldpwbox = document.getElementById("oldpw");
   var initpw = oldpwbox.getAttribute("inited");
+  var bundle = document.getElementById("bundlePreferences");
 
   var success = false;
 
   if (initpw == "false" || initpw == "empty") {
     try {
       var oldpw = "";
       var passok = 0;
 
@@ -98,51 +93,63 @@ function setPassword() {
         if (initpw == "empty" && pw1.value == "") {
           // This makes no sense that we arrive here,
           // we reached a case that should have been prevented by checkPasswords.
         } else {
           if (pw1.value == "") {
             var secmoddb = Cc[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
             if (secmoddb.isFIPSEnabled) {
               // empty passwords are not allowed in FIPS mode
-              createAlert("pw-change-failed-title", "pw-change2empty-in-fips-mode");
+              Services.prompt.alert(window,
+                                    bundle.getString("pw_change_failed_title"),
+                                    bundle.getString("pw_change2empty_in_fips_mode"));
               passok = 0;
             }
           }
           if (passok) {
             token.changePassword(oldpw, pw1.value);
             if (pw1.value == "") {
-              createAlert("pw-change-success-title", "pw-erased-ok");
+              Services.prompt.alert(window,
+                                    bundle.getString("pw_change_success_title"),
+                                    bundle.getString("pw_erased_ok")
+                                    + " " + bundle.getString("pw_empty_warning"));
             } else {
-              createAlert("pw-change-success-title", "pw-change-ok");
+              Services.prompt.alert(window,
+                                    bundle.getString("pw_change_success_title"),
+                                    bundle.getString("pw_change_ok"));
             }
             success = true;
           }
         }
       } else {
         oldpwbox.focus();
         oldpwbox.setAttribute("value", "");
-        createAlert("pw-change-failed-title", "incorrect-pw");
+        Services.prompt.alert(window,
+                              bundle.getString("pw_change_failed_title"),
+                              bundle.getString("incorrect_pw"));
       }
     } catch (e) {
-      createAlert("pw-change-failed-title", "failed-pw-change");
+      Services.prompt.alert(window,
+                            bundle.getString("pw_change_failed_title"),
+                            bundle.getString("failed_pw_change"));
     }
   } else {
     token.initPassword(pw1.value);
     if (pw1.value == "") {
-      createAlert("pw-change-success-title", "pw-not-wanted");
+      Services.prompt.alert(window,
+                            bundle.getString("pw_change_success_title"),
+                            bundle.getString("pw_not_wanted")
+                            + " " + bundle.getString("pw_empty_warning"));
     }
     success = true;
   }
 
   // Terminate dialog
   if (success)
     window.close();
-
-  return success;
 }
 
 function setPasswordStrength() {
 // Here is how we weigh the quality of the password
 // number of characters
 // numbers
 // non-alpha-numeric chars
 // upper and lower case characters
--- a/toolkit/mozapps/preferences/changemp.xul
+++ b/toolkit/mozapps/preferences/changemp.xul
@@ -17,19 +17,17 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         style="width: 40em;" 
         ondialogaccept="setPassword();"
         onload="init()">
 
   <script type="application/javascript" src="chrome://mozapps/content/preferences/changemp.js"/>
 
-  <linkset>
-    <link rel="localization" href="toolkit/preferences/preferences.ftl"/>
-  </linkset>
+  <stringbundle id="bundlePreferences" src="chrome://mozapps/locale/preferences/preferences.properties"/>
 
   <description control="pw1">&masterPasswordDescription.label;</description>
 
   <grid>
     <columns>
       <column flex="1"/>
       <column/>
     </columns>
--- a/toolkit/mozapps/preferences/removemp.js
+++ b/toolkit/mozapps/preferences/removemp.js
@@ -3,48 +3,48 @@
 /* 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/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gRemovePasswordDialog = {
   _token: null,
+  _bundle: null,
   _okButton: null,
   _password: null,
   init() {
+    this._bundle = document.getElementById("bundlePreferences");
+
     this._okButton = document.documentElement.getButton("accept");
-    document.l10n.setAttributes(this._okButton, "pw-remove-button");
+    this._okButton.label = this._bundle.getString("pw_remove_button");
 
     this._password = document.getElementById("password");
 
     var pk11db = Cc["@mozilla.org/security/pk11tokendb;1"]
                    .getService(Ci.nsIPK11TokenDB);
     this._token = pk11db.getInternalKeyToken();
 
     // Initialize the enabled state of the Remove button by checking the
     // initial value of the password ("" should be incorrect).
     this.validateInput();
   },
 
   validateInput() {
     this._okButton.disabled = !this._token.checkPassword(this._password.value);
   },
 
-  async createAlert(titleL10nId, messageL10nId) {
-    const [title, message] = await document.l10n.formatValues([
-      {id: titleL10nId},
-      {id: messageL10nId},
-    ]);
-    Services.prompt.alert(window, title, message);
-  },
-
   removePassword() {
     if (this._token.checkPassword(this._password.value)) {
       this._token.changePassword(this._password.value, "");
-      this.createAlert("pw-change-success-title", "pw-erased-ok");
+      Services.prompt.alert(window,
+                            this._bundle.getString("pw_change_success_title"),
+                            this._bundle.getString("pw_erased_ok")
+                            + " " + this._bundle.getString("pw_empty_warning"));
     } else {
       this._password.value = "";
       this._password.focus();
-      this.createAlert("pw-change-failed-title", "incorrect-pw");
+      Services.prompt.alert(window,
+                            this._bundle.getString("pw_change_failed_title"),
+                            this._bundle.getString("incorrect_pw"));
     }
   },
 };
--- a/toolkit/mozapps/preferences/removemp.xul
+++ b/toolkit/mozapps/preferences/removemp.xul
@@ -16,19 +16,17 @@
 <dialog id="removemp" title="&removePassword.title;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
         style="width: 35em;" 
         ondialogaccept="gRemovePasswordDialog.removePassword();" 
         onload="gRemovePasswordDialog.init()">
 
   <script type="application/javascript" src="chrome://mozapps/content/preferences/removemp.js"/>
 
-  <linkset>
-    <link rel="localization" href="toolkit/preferences/preferences.ftl"/>
-  </linkset>
+  <stringbundle id="bundlePreferences" src="chrome://mozapps/locale/preferences/preferences.properties"/>
 
   <vbox id="warnings">
     <description>&removeWarning1.label;</description>
     <description class="header">&removeWarning2.label;</description>
   </vbox>
   
   <separator class="thin"/>