Bug 1163062 - Make e10s strings localizable. r=ttaubert
authorFelipe Gomes <felipc@gmail.com>
Fri, 08 May 2015 15:35:24 -0300
changeset 274515 ff55066a395b92a1f96ade7e70bf2b9b6c176a42
parent 274514 8edc3877e0e09d3f4dc65cf281eda70202ffc8be
child 274516 8c7c0bb5cf5557c5b00be628d7a1a369d2f41dd4
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1163062
milestone40.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 1163062 - Make e10s strings localizable. r=ttaubert
browser/components/nsBrowserGlue.js
browser/components/preferences/in-content/main.xul
browser/locales/en-US/chrome/browser/browser.properties
browser/locales/en-US/chrome/browser/preferences/main.dtd
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2924,21 +2924,24 @@ let E10SUINotification = {
   _showE10sActivatedNotice: function() {
     let win = RecentWindow.getMostRecentBrowserWindow();
     if (!win)
       return;
 
     Services.prefs.setIntPref("browser.displayedE10SNotice", this.CURRENT_NOTICE_COUNT);
 
     let nb = win.document.getElementById("high-priority-global-notificationbox");
-    let message = "You're now helping to test Process Separation (e10s)! Please report problems you find.";
+    let message = win.gNavigatorBundle.getFormattedString(
+                    "e10s.postActivationInfobar.message",
+                    [gBrandBundle.GetStringFromName("brandShortName")]
+                  );
     let buttons = [
       {
-        label: "Learn More",
-        accessKey: "L",
+        label: win.gNavigatorBundle.getString("e10s.postActivationInfobar.learnMore.label"),
+        accessKey: win.gNavigatorBundle.getString("e10s.postActivationInfobar.learnMore.accesskey"),
         callback: function () {
           win.openUILinkIn("https://wiki.mozilla.org/Electrolysis", "tab");
         }
       }
     ];
     nb.appendNotification(message, "e10s-activated-noticed",
                           null, nb.PRIORITY_WARNING_MEDIUM, buttons);
 
@@ -2946,51 +2949,54 @@ let E10SUINotification = {
 
   _showE10SPrompt: function BG__showE10SPrompt() {
     let win = RecentWindow.getMostRecentBrowserWindow();
     if (!win)
       return;
 
     let browser = win.gBrowser.selectedBrowser;
 
-    let promptMessage = "Multi-process is coming soon to Firefox. You can start using it now to get early access to some of the benefits:";
+    let promptMessage = win.gNavigatorBundle.getFormattedString(
+                          "e10s.offerPopup.mainMessage",
+                          [gBrandBundle.GetStringFromName("brandShortName")]
+                        );
     let mainAction = {
-      label: "Enable and Restart",
-      accessKey: "E",
+      label: win.gNavigatorBundle.getString("e10s.offerPopup.enableAndRestart.label"),
+      accessKey: win.gNavigatorBundle.getString("e10s.offerPopup.enableAndRestart.accesskey"),
       callback: function () {
         Services.prefs.setBoolPref("browser.tabs.remote.autostart", true);
         Services.prefs.setBoolPref("browser.enabledE10SFromPrompt", true);
         // Restart the app
         let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
         Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
         if (cancelQuit.data)
           return; // somebody canceled our quit request
         Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
       }
     };
     let secondaryActions = [
       {
-        label: "No thanks",
-        accessKey: "N",
+        label: win.gNavigatorBundle.getString("e10s.offerPopup.noThanks.label"),
+        accessKey: win.gNavigatorBundle.getString("e10s.offerPopup.noThanks.accesskey"),
         callback: function () {
           Services.prefs.setIntPref(E10SUINotification.CURRENT_PROMPT_PREF, 5);
         }
       }
     ];
     let options = {
       popupIconURL: "chrome://browser/skin/e10s-64@2x.png",
       learnMoreURL: "https://wiki.mozilla.org/Electrolysis",
       persistWhileVisible: true
     };
 
     win.PopupNotifications.show(browser, "enable-e10s", promptMessage, null, mainAction, secondaryActions, options);
 
     let highlights = [
-      "Improved responsiveness",
-      "Fewer crashes"
+      win.gNavigatorBundle.getString("e10s.offerPopup.highlight1"),
+      win.gNavigatorBundle.getString("e10s.offerPopup.highlight2")
     ];
 
     let doorhangerExtraContent = win.document.getElementById("enable-e10s-notification")
                                              .querySelector("popupnotificationcontent");
     for (let highlight of highlights) {
       let highlightLabel = win.document.createElement("label");
       highlightLabel.setAttribute("value", highlight);
       doorhangerExtraContent.appendChild(highlightLabel);
@@ -3011,33 +3017,36 @@ let E10SUINotification = {
     if (!win) {
       // Just restart immediately.
       Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
       return;
     }
 
     let browser = win.gBrowser.selectedBrowser;
 
-    let promptMessage = "Multiprocess Nightly (e10s) does not yet support accessibility features. Multiprocessing will be disabled if you restart Firefox. Would you like to restart?";
+    let promptMessage = win.gNavigatorBundle.getFormattedString(
+                          "e10s.accessibilityNotice.mainMessage",
+                          [gBrandBundle.GetStringFromName("brandShortName")]
+                        );
     let mainAction = {
-      label: "Disable and Restart",
-      accessKey: "R",
+      label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.disableAndRestart.label"),
+      accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.disableAndRestart.accesskey"),
       callback: function () {
         // Restart the app
         let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
         Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
         if (cancelQuit.data)
           return; // somebody canceled our quit request
         Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
       }
     };
     let secondaryActions = [
       {
-        label: "Don't Disable",
-        accessKey: "D",
+        label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.label"),
+        accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.accesskey"),
         callback: function () {
           Services.prefs.setBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y", false);
         }
       }
     ];
     let options = {
       popupIconURL: "chrome://browser/skin/e10s-64@2x.png",
       learnMoreURL: "https://wiki.mozilla.org/Electrolysis",
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -125,17 +125,17 @@
       <label id="useFirefoxSync">&useFirefoxSync.label;</label>
       <label id="getStarted" class="text-link">&getStarted.label;</label>
     </hbox>
   </vbox>
 #endif
 
 #ifdef E10S_TESTING_ONLY
   <checkbox id="e10sAutoStart"
-            label="Enable E10S (multi-process)"/>
+            label="&e10sEnabled.label;"/>
 #endif
 
 #ifdef HAVE_SHELL_SERVICE
   <vbox id="defaultBrowserBox">
     <hbox align="center">
       <checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
                 label="&alwaysCheckDefault2.label;" accesskey="&alwaysCheckDefault2.accesskey;"/>
     </hbox>
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -780,8 +780,43 @@ readingList.prepopulatedArticles.support
 # This will show as an item in the Reading List, and will link to a SUMO article describing the Reader View:
 #   https://support.mozilla.org/kb/enjoy-clutter-free-web-pages-reader-view
 readingList.prepopulatedArticles.supportReaderView = Enjoy clutter-free Web pages with Reader View
 # LOCALIZATION NOTE(readingList.prepopulatedArticles.learnMore):
 # This will show as an item in the Reading List, and will link to a SUMO article describing Sync:
 #   https://support.mozilla.org/kb/how-do-i-set-up-firefox-sync
 # %S is syncBrandShortName
 readingList.prepopulatedArticles.supportSync = Access your Reading List anywhere with %S
+
+# LOCALIZATION NOTE (e10s.offerPopup.mainMessage
+#                    e10s.offerPopup.highlight1
+#                    e10s.offerPopup.highlight2
+#                    e10s.offerPopup.enableAndRestart.label
+#                    e10s.offerPopup.enableAndRestart.accesskey
+#                    e10s.offerPopup.noThanks.label
+#                    e10s.offerPopup.noThanks.accesskey
+#                    e10s.postActivationInfobar.message
+#                    e10s.postActivationInfobar.learnMore.label
+#                    e10s.postActivationInfobar.learnMore.accesskey
+#                    e10s.accessibilityNotice.mainMessage
+#                    e10s.accessibilityNotice.disableAndRestart.label
+#                    e10s.accessibilityNotice.disableAndRestart.accesskey
+#                    e10s.accessibilityNotice.dontDisable.label
+#                    e10s.accessibilityNotice.dontDisable.accesskey):
+# These strings are related to the messages we display to offer e10s (Multi-process) to users
+# on the pre-release channels. They won't be used in release but they will likely be used in
+# beta starting from version 41, so it's still useful to have these strings properly localized.
+# %S is brandShortName
+e10s.offerPopup.mainMessage = Multi-process is coming soon to %S. You can start using it now to get early access to some of the benefits:
+e10s.offerPopup.highlight1 = Improved responsiveness
+e10s.offerPopup.highlight2 = Fewer crashes
+e10s.offerPopup.enableAndRestart.label = Enable and Restart
+e10s.offerPopup.enableAndRestart.accesskey = E
+e10s.offerPopup.noThanks.label = No, thanks
+e10s.offerPopup.noThanks.accesskey = N
+e10s.postActivationInfobar.message = You're now helping to test multi-process in %S! Please report problems you find.
+e10s.postActivationInfobar.learnMore.label = Learn More
+e10s.postActivationInfobar.learnMore.accesskey = L
+e10s.accessibilityNotice.mainMessage = Multi-process does not yet support accessibility features. Multi-process will be disabled if you restart %S. Would you like to restart?
+e10s.accessibilityNotice.disableAndRestart.label = Disable and Restart
+e10s.accessibilityNotice.disableAndRestart.accesskey = R
+e10s.accessibilityNotice.dontDisable.label = Don't Disable
+e10s.accessibilityNotice.dontDisable.accesskey = D
--- a/browser/locales/en-US/chrome/browser/preferences/main.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/main.dtd
@@ -36,8 +36,10 @@
 <!ENTITY setAsMyDefaultBrowser2.label     "Make Default">
 <!ENTITY setAsMyDefaultBrowser2.accesskey "D">
 <!ENTITY isDefault.label                  "&brandShortName; is currently your default browser">
 <!ENTITY isNotDefault.label               "&brandShortName; is not your default browser">
 
 <!ENTITY separateProfileMode.label        "Allow &brandShortName; and Firefox to run at the same time">
 <!ENTITY useFirefoxSync.label             "Tip: This uses separate profiles. Use Sync to share data between them.">
 <!ENTITY getStarted.label                 "Start using Sync…">
+
+<!ENTITY e10sEnabled.label                "Enable multi-process &brandShortName;">