Bug 1063702 - Update all Reset Firefox strings and relevant UI to new UX requirements. r=MattN
authorMark Hammond <mhammond@skippinet.com.au>
Sat, 11 Oct 2014 12:37:16 +1100
changeset 233131 38ce31cc93346f73023732004ac5d457b1221101
parent 233130 4c6a3e307c609c8da86722c5199b242ccdace442
child 233132 c6e8abf0f825027c38b51a4d3c32381ee4faffc3
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1063702
milestone35.0a1
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
Bug 1063702 - Update all Reset Firefox strings and relevant UI to new UX requirements. r=MattN
browser/base/content/safeMode.js
browser/base/content/safeMode.xul
browser/components/migration/content/aboutWelcomeBack.xhtml
browser/components/nsBrowserGlue.js
browser/components/sessionstore/content/aboutSessionRestore.js
browser/locales/en-US/chrome/browser/aboutSessionRestore.dtd
browser/locales/en-US/chrome/browser/safeMode.dtd
toolkit/content/aboutSupport.xhtml
toolkit/content/resetProfile.js
toolkit/content/resetProfile.xul
toolkit/content/resetProfileProgress.xul
toolkit/locales/en-US/chrome/global/resetProfile.dtd
toolkit/locales/en-US/chrome/global/resetProfile.properties
toolkit/themes/windows/global/aboutSupport.css
--- a/browser/base/content/safeMode.js
+++ b/browser/base/content/safeMode.js
@@ -67,17 +67,16 @@ function onExtra1() {
 }
 
 function onLoad() {
   let dialog = document.documentElement;
   if (appStartup.automaticSafeModeNecessary) {
     document.getElementById("autoSafeMode").hidden = false;
     document.getElementById("safeMode").hidden = true;
     if (ResetProfile.resetSupported()) {
-      populateResetPane("resetProfileItems");
       document.getElementById("resetProfile").hidden = false;
     } else {
       // Hide the reset button is it's not supported.
       document.documentElement.getButton("extra1").hidden = true;
     }
   } else {
     if (!ResetProfile.resetSupported()) {
       // Hide the reset button and text if it's not supported.
--- a/browser/base/content/safeMode.xul
+++ b/browser/base/content/safeMode.xul
@@ -16,47 +16,36 @@
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://browser/content/safeMode.css"?>
 
 <dialog id="safeModeDialog"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&safeModeDialog.title;"
             buttons="accept,extra1"
             buttonlabelaccept="&startSafeMode.label;"
-            buttonlabelextra1="&resetProfile.label;"
+            buttonlabelextra1="&refreshProfile.label;"
             maxwidth="&window.maxWidth;"
             ondialogaccept="return onDefaultButton()"
             ondialogcancel="onCancel();"
             ondialogextra1="return onExtra1()"
             onload="onLoad()">
 
   <script type="application/javascript" src="chrome://global/content/resetProfile.js"/>
   <script type="application/javascript" src="chrome://browser/content/safeMode.js"/>
 
   <vbox id="autoSafeMode" hidden="true">
-    <description>&autoSafeModeDescription2.label;</description>
+    <description>&autoSafeModeDescription3.label;</description>
   </vbox>
 
-  <vbox id ="safeMode">
+  <vbox id="safeMode">
     <label>&safeModeDescription3.label;</label>
     <separator class="thin"/>
     <label>&safeModeDescription4.label;</label>
     <separator class="thin"/>
-    <label id="resetProfileInstead">&resetProfileInstead.label;</label>
+    <label id="resetProfileInstead">&refreshProfileInstead.label;</label>
   </vbox>
 
   <vbox id="resetProfile" hidden="true">
-    <label>&resetProfile.dialog.items2.label;</label>
-
-    <vbox id="resetProfileItems" class="indent">
-    </vbox>
-
-    <separator class="thin"/>
-
-    <label id="resetProfileFooter">&resetProfileFooter.label;</label>
-
-    <label>&safeModeInstead.label;</label>
-
-    <separator/>
+    <label id="resetProfileInstead">&refreshProfileInstead.label;</label>
   </vbox>
 
   <separator class="thin"/>
 </dialog>
--- a/browser/components/migration/content/aboutWelcomeBack.xhtml
+++ b/browser/components/migration/content/aboutWelcomeBack.xhtml
@@ -28,25 +28,27 @@
 
   <body dir="&locale.dir;">
 
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer">
 
       <!-- Error Title -->
       <div id="errorTitle">
-        <h1 id="errorTitleText">&welcomeback.pageTitle;</h1>
+        <h1 id="errorTitleText">&welcomeback2.pageTitle;</h1>
       </div>
 
       <!-- LONG CONTENT (the section most likely to require scrolling) -->
       <div id="errorLongContent">
 
         <!-- Short Description -->
         <div id="errorShortDesc">
-          <p id="errorShortDescText">&welcomeback.pageInfo;</p>
+          <p>&welcomeback2.pageInfo1;</p>
+          <!-- Note a href in the anchor below is added by JS -->
+          <p>&welcomeback2.beforelink.pageInfo2;<a id="linkMoreTroubleshooting" target="_blank">&welcomeback2.link.pageInfo2;</a>&welcomeback2.afterlink.pageInfo2;</p>
         </div>
 
         <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
         <div id="errorLongDesc">
         </div>
 
         <!-- Short Description -->
         <div id="errorTrailerDesc">
@@ -61,30 +63,18 @@
             </treecols>
             <treechildren flex="1"/>
           </tree>
         </div>
       </div>
 
       <!-- Buttons -->
       <hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="buttons">
-#ifdef XP_UNIX
-        <button id="errorCancel" label="&restorepage.closeButton;"
-                accesskey="&restorepage.close.access;"
-                oncommand="startNewSession();"/>
-        <button id="errorTryAgain" label="&restorepage.tryagainButton;"
-                accesskey="&restorepage.restore.access;"
+        <button id="errorTryAgain" label="&welcomeback2.restoreButton;"
+                accesskey="&welcomeback2.restoreButton.access;"
                 oncommand="restoreSession();"/>
-#else
-        <button id="errorTryAgain" label="&restorepage.tryagainButton;"
-                accesskey="&restorepage.restore.access;"
-                oncommand="restoreSession();"/>
-        <button id="errorCancel" label="&restorepage.closeButton;"
-                accesskey="&restorepage.close.access;"
-                oncommand="startNewSession();"/>
-#endif
       </hbox>
       <!-- holds the session data for when the tab is closed -->
       <input type="text" id="sessionData" style="display: none;"/>
     </div>
 
   </body>
 </html>
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -632,18 +632,18 @@ BrowserGlue.prototype = {
                               .createBundle("chrome://branding/locale/brand.properties")
                               .GetStringFromName("brandShortName");
     let resetBundle = Services.strings
                               .createBundle("chrome://global/locale/resetProfile.properties");
 
     let message = resetBundle.formatStringFromName("resetUnusedProfile.message", [productName], 1);
     let buttons = [
       {
-        label:     resetBundle.formatStringFromName("resetProfile.resetButton.label", [productName], 1),
-        accessKey: resetBundle.GetStringFromName("resetProfile.resetButton.accesskey"),
+        label:     resetBundle.formatStringFromName("refreshProfile.resetButton.label", [productName], 1),
+        accessKey: resetBundle.GetStringFromName("refreshProfile.resetButton.accesskey"),
         callback: function () {
           ResetProfile.openConfirmationDialog(win);
         }
       },
     ];
 
     let nb = win.document.getElementById("global-notificationbox");
     nb.appendNotification(message, "reset-unused-profile",
--- a/browser/components/sessionstore/content/aboutSessionRestore.js
+++ b/browser/components/sessionstore/content/aboutSessionRestore.js
@@ -1,21 +1,30 @@
 /* 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/. */
 
-const Cc = Components.classes;
-const Ci = Components.interfaces;
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
+
+Cu.import("resource://gre/modules/Services.jsm");
 
 var gStateObject;
 var gTreeData;
 
 // Page initialization
 
 window.onload = function() {
+  // pages used by this script may have a link that needs to be updated to
+  // the in-product link.
+  let anchor = document.getElementById("linkMoreTroubleshooting");
+  if (anchor) {
+    let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
+    anchor.setAttribute("href", baseURL + "troubleshooting");
+  }
+
   // the crashed session state is kept inside a textbox so that SessionStore picks it up
   // (for when the tab is closed or the session crashes right again)
   var sessionData = document.getElementById("sessionData");
   if (!sessionData.value) {
     document.getElementById("errorTryAgain").disabled = true;
     return;
   }
 
@@ -65,16 +74,24 @@ function initTreeView() {
   tabList.view.selection.select(0);
 }
 
 // User actions
 
 function restoreSession() {
   document.getElementById("errorTryAgain").disabled = true;
 
+  if (!gTreeData.some(aItem => aItem.checked)) {
+    // This should only be possible when we have no "cancel" button, and thus
+    // the "Restore session" button always remains enabled.  In that case and
+    // when nothing is selected, we just want a new session.
+    startNewSession();
+    return;
+  }
+
   // remove all unselected tabs from the state before restoring it
   var ix = gStateObject.windows.length - 1;
   for (var t = gTreeData.length - 1; t >= 0; t--) {
     if (treeView.isContainer(t)) {
       if (gTreeData[t].checked === 0)
         // this window will be restored partially
         gStateObject.windows[ix].tabs =
           gStateObject.windows[ix].tabs.filter(function(aTabData, aIx)
@@ -186,17 +203,20 @@ function toggleRowChecked(aIx) {
   }
   else {
     // update the window's checkmark as well (0 means "partially checked")
     item.parent.checked = item.parent.tabs.every(isChecked) ? true :
                           item.parent.tabs.some(isChecked) ? 0 : false;
     treeView.treeBox.invalidateRow(gTreeData.indexOf(item.parent));
   }
 
-  document.getElementById("errorTryAgain").disabled = !gTreeData.some(isChecked);
+  // we only disable the button when there's no cancel button.
+  if (document.getElementById("errorCancel")) {
+    document.getElementById("errorTryAgain").disabled = !gTreeData.some(isChecked);
+  }
 }
 
 function restoreSingleTab(aIx, aShifted) {
   var tabbrowser = getBrowserWindow().gBrowser;
   var newTab = tabbrowser.addTab();
   var item = gTreeData[aIx];
 
   var ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
--- a/browser/locales/en-US/chrome/browser/aboutSessionRestore.dtd
+++ b/browser/locales/en-US/chrome/browser/aboutSessionRestore.dtd
@@ -18,17 +18,33 @@
 <!ENTITY restorepage.close.access   "C">
 
 <!ENTITY restorepage.restoreHeader  "Restore">
 <!ENTITY restorepage.listHeader     "Windows and Tabs">
 <!-- LOCALIZATION NOTE: &#37;S will be replaced with a number. -->
 <!ENTITY restorepage.windowLabel    "Window &#37;S">
 
 
-<!-- LOCALIZATION NOTE: The following 'welcomeback' strings are for about:welcomeback,
+<!-- LOCALIZATION NOTE: The following 'welcomeback2' strings are for about:welcomeback,
      not for about:sessionstore -->
-<!ENTITY welcomeback.tabtitle       "Welcome Back!">
+
+<!ENTITY welcomeback2.restoreButton  "Let's go!">
+<!ENTITY welcomeback2.restoreButton.access "L">
+
+<!ENTITY welcomeback2.tabtitle      "Success!">
+
+<!ENTITY welcomeback2.pageTitle     "Success!">
+<!ENTITY welcomeback2.pageInfo1     "&brandShortName; is ready to go.">
 
-<!-- LOCALIZATION NOTE: The title is intended to be welcoming and congratulatory,
-     expressing joy that the user has successfully migrated their stuff and hope
-     that now they have a better experience.  -->
-<!ENTITY welcomeback.pageTitle      "Welcome Back!">
-<!ENTITY welcomeback.pageInfo       "&brandShortName; successfully reset your profile. Below is a list of windows and tabs you had open; you can restore them or start with a clean slate.">
+<!ENTITY welcomeback2.label.restoreAll  "Restore all Windows and Tabs">
+<!ENTITY welcomeback2.label.restoreSome "Restore only the ones you want">
+
+
+<!-- LOCALIZATION NOTE (welcomeback2.beforelink.pageInfo2,
+welcomeback2.afterlink.pageInfo2): these two string are used respectively
+before and after the the "learn more" link (welcomeback2.link.pageInfo2).
+Localizers can use one of them, or both, to better adapt this sentence to
+their language.
+-->
+<!ENTITY welcomeback2.beforelink.pageInfo2  "Your add-ons and customizations have been removed and your browser settings have been restored to their defaults. If this didn't fix your issue, ">
+<!ENTITY welcomeback2.afterlink.pageInfo2   "">
+
+<!ENTITY welcomeback2.link.pageInfo2        "learn more about what you can do.">
--- a/browser/locales/en-US/chrome/browser/safeMode.dtd
+++ b/browser/locales/en-US/chrome/browser/safeMode.dtd
@@ -1,19 +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/. -->
 
 <!ENTITY safeModeDialog.title         "&brandShortName; Safe Mode">
 <!ENTITY window.maxWidth              "400">
 
 <!ENTITY startSafeMode.label          "Start in Safe Mode">
-<!ENTITY resetProfile.label           "Reset &brandShortName;">
+<!ENTITY refreshProfile.label         "Refresh &brandShortName;">
 
 <!ENTITY safeModeDescription3.label   "Safe Mode is a special mode of &brandShortName; that can be used to troubleshoot issues.">
 <!ENTITY safeModeDescription4.label   "Your add-ons and custom settings will be temporarily disabled.">
 
-<!ENTITY resetProfileInstead.label    "You can also Reset &brandShortName; if you want to start fresh.">
+<!ENTITY refreshProfileInstead.label  "You can also skip troubleshooting and try refreshing &brandShortName;.">
 
-<!-- LOCALIZATION NOTE (autoSafeModeDescription2.label safeModeInstead.label resetProfileFooter.label): Shown on the safe mode dialog after multiple startup crashes. See also chrome/global/resetProfile.dtd -->
-<!ENTITY autoSafeModeDescription2.label "&brandShortName; closed unexpectedly while starting. This might be caused by add-ons or other problems. You can try to resolve the problem by resetting &brandShortName; to its default state or troubleshooting in Safe Mode.">
-<!ENTITY resetProfileFooter.label       "Everything else will be reset to factory defaults.">
-<!ENTITY safeModeInstead.label          "If you don't want this, you can continue in Safe Mode to do your own troubleshooting with your add-ons and custom settings temporarily disabled.">
+<!-- LOCALIZATION NOTE (autoSafeModeDescription3.label): Shown on the safe mode dialog after multiple startup crashes. See also chrome/global/resetProfile.dtd -->
+<!ENTITY autoSafeModeDescription3.label "&brandShortName; closed unexpectedly while starting. This might be caused by add-ons or other problems. You can try to resolve the problem by troubleshooting in Safe Mode.">
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -25,20 +25,19 @@
             src="chrome://global/content/aboutSupport.js"/>
     <script type="application/javascript;version=1.7"
             src="chrome://global/content/resetProfile.js"/>
   </head>
 
   <body dir="&locale.dir;">
 
     <div id="reset-box">
-      <h3>&resetProfile.title;</h3>
-      <p>&resetProfile.description;</p>
+      <h3>&refreshProfile.title;</h3>
       <button id="reset-box-button">
-        &resetProfile.button.label2;
+        &refreshProfile.button.label;
       </button>
     </div>
 
     <h1>
       &aboutSupport.pageTitle;
     </h1>
 
     <div class="page-subtitle">
--- a/toolkit/content/resetProfile.js
+++ b/toolkit/content/resetProfile.js
@@ -9,31 +9,12 @@
 // Proceed with caution:
 if (!("Cu" in window)) {
   window.Cu = Components.utils;
 }
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/ResetProfile.jsm");
 
-// based on onImportItemsPageShow from migration.js
-function populateResetPane(aContainerID) {
-  let resetProfileItems = document.getElementById(aContainerID);
-  try {
-    let dataTypes = ResetProfile.getMigratedData();
-    for (let dataType of dataTypes) {
-      let label = document.createElement("label");
-      label.setAttribute("value", dataType);
-      resetProfileItems.appendChild(label);
-    }
-  } catch (ex) {
-    Cu.reportError(ex);
-  }
-}
-
-function onResetProfileLoad() {
-  populateResetPane("migratedItems");
-}
-
 function onResetProfileAccepted() {
   let retVals = window.arguments[0];
   retVals.reset = true;
 }
--- a/toolkit/content/resetProfile.xul
+++ b/toolkit/content/resetProfile.xul
@@ -11,27 +11,25 @@
 %resetProfileDTD;
 ]>
 
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://global/content/resetProfile.css"?>
 
 <dialog id="resetProfileDialog"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-            title="&resetProfile.dialog.title;"
+            title="&refreshProfile.dialog.title;"
             buttons="accept,cancel"
             defaultButton="cancel"
-            buttonlabelaccept="&resetProfile.dialog.button.label;"
+            buttonlabelaccept="&refreshProfile.dialog.button.label;"
             ondialogaccept="return onResetProfileAccepted();"
-            ondialogcancel="window.close();"
-            onload="onResetProfileLoad();">
+            ondialogcancel="window.close();">
 
   <script type="application/javascript" src="chrome://global/content/resetProfile.js"/>
 
-  <description>&resetProfile.dialog.description;</description>
+  <description value="&refreshProfile.dialog.description1;"></description>
+  <label value="&refreshProfile.dialog.description2;"/>
 
-  <label value="&resetProfile.dialog.items2.label;"/>
   <vbox id="migratedItems">
+    <label class="migratedLabel" value="&refreshProfile.dialog.items.label1;"/>
+    <label class="migratedLabel" value="&refreshProfile.dialog.items.label2;"/>
   </vbox>
-
-  <label id="resetProfileFooter" value="&resetProfile.dialog.footer.label;"/>
-
 </dialog>
--- a/toolkit/content/resetProfileProgress.xul
+++ b/toolkit/content/resetProfileProgress.xul
@@ -11,14 +11,15 @@
 %resetProfileDTD;
 ]>
 
 <?xml-stylesheet href="chrome://global/content/resetProfile.css"?>
 <?xml-stylesheet href="chrome://global/skin/"?>
 
 <window id="resetProfileProgressDialog"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&resetProfile.dialog.title;">
+        title="&refreshProfile.dialog.title;"
+        style="min-width: 300px;">
   <vbox>
-    <description>&resetProfile.cleaning.description;</description>
+    <description>&refreshProfile.cleaning.description;</description>
     <progressmeter mode="undetermined"/>
   </vbox>
 </window>
--- a/toolkit/locales/en-US/chrome/global/resetProfile.dtd
+++ b/toolkit/locales/en-US/chrome/global/resetProfile.dtd
@@ -1,15 +1,15 @@
 <!-- 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 resetProfile.dialog.title        "Reset &brandShortName;">
-<!ENTITY resetProfile.dialog.description  "Are you sure you want to reset &brandShortName; to its initial state?">
-<!ENTITY resetProfile.dialog.items2.label "&brandShortName; will try to preserve your:">
-<!ENTITY resetProfile.dialog.footer.label "&brandShortName; will restart and everything else will be removed.">
-<!ENTITY resetProfile.dialog.button.label "Reset &brandShortName;">
+<!ENTITY refreshProfile.dialog.title         "Refresh &brandShortName;">
+<!ENTITY refreshProfile.dialog.description1  "Start fresh to fix problems and restore performance.">
+<!ENTITY refreshProfile.dialog.description2  "This will:">
+<!ENTITY refreshProfile.dialog.items.label1  "Remove your add-ons and customizations">
+<!ENTITY refreshProfile.dialog.items.label2  "Restore your browser settings to their defaults">
+<!ENTITY refreshProfile.dialog.button.label  "Refresh &brandShortName;">
 
-<!ENTITY resetProfile.title               "Reset &brandShortName; to its default state">
-<!ENTITY resetProfile.description         "If you're having major problems which you can't resolve, start fresh with only your essential information.">
-<!ENTITY resetProfile.button.label2       "Reset &brandShortName;…">
+<!ENTITY refreshProfile.title                "Give &brandShortName; a tune up">
+<!ENTITY refreshProfile.button.label         "Refresh &brandShortName;…">
 
-<!ENTITY resetProfile.cleaning.description "Please wait while &brandShortName; cleans up your old data…">
+<!ENTITY refreshProfile.cleaning.description "Almost done…">
--- a/toolkit/locales/en-US/chrome/global/resetProfile.properties
+++ b/toolkit/locales/en-US/chrome/global/resetProfile.properties
@@ -2,11 +2,11 @@
 # 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/.
 
 # LOCALIZATION NOTE: These strings are used for profile reset.
 
 # LOCALIZATION NOTE (resetUnusedProfile.message): %S is brandShortName.
 resetUnusedProfile.message=It looks like you haven't started %S in a while. Do you want to clean it up for a fresh, like-new experience? And by the way, welcome back!
 
-# LOCALIZATION NOTE (resetProfile.resetButton.label): %S is brandShortName.
-resetProfile.resetButton.label=Reset %S…
-resetProfile.resetButton.accesskey=e
+# LOCALIZATION NOTE (refreshProfile.resetButton.label): %S is brandShortName.
+refreshProfile.resetButton.label=Refresh %S…
+refreshProfile.resetButton.accesskey=e
--- a/toolkit/themes/windows/global/aboutSupport.css
+++ b/toolkit/themes/windows/global/aboutSupport.css
@@ -97,17 +97,16 @@ td {
 }
 
 #reset-box > h3 {
   margin-top: 0;
 }
 
 #reset-box > button {
   display: block;
-  margin: auto;
 }
 
 .block {
   display: block;
 }
 
 .hidden {
   display: none;