Bug 1131303 - Update strings for reader view/reading list UI, and add title text to reader view toolbar buttons. r=Unfocused,rnewman
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Thu, 12 Feb 2015 09:15:45 -0800
changeset 229935 1146999121f4e324280fdb16864b7f148ba69720
parent 229934 5595892c4c07ea2b80381e5864b66c1879c7737f
child 229936 41e0d2bd2fcf4fdb3b034859c556f4e20be357df
push id28303
push usercbook@mozilla.com
push dateFri, 20 Feb 2015 14:07:30 +0000
treeherdermozilla-central@80bd1ae9dd0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused, rnewman
bugs1131303
milestone38.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 1131303 - Update strings for reader view/reading list UI, and add title text to reader view toolbar buttons. r=Unfocused,rnewman
browser/locales/en-US/chrome/browser/readerMode.properties
browser/modules/ReaderParent.jsm
mobile/android/chrome/content/Reader.js
mobile/android/locales/en-US/chrome/browser.properties
toolkit/components/reader/AboutReader.jsm
toolkit/locales/en-US/chrome/global/aboutReader.properties
--- a/browser/locales/en-US/chrome/browser/readerMode.properties
+++ b/browser/locales/en-US/chrome/browser/readerMode.properties
@@ -1,6 +1,6 @@
 # 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/.
 
-readerMode.enter=Enter Reader Mode
-readerMode.exit=Exit Reader Mode
+readerView.enter=Enter Reader View
+readerView.exit=Exit Reader View
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -88,20 +88,20 @@ let ReaderParent = {
     if (browser != win.gBrowser.selectedBrowser) {
       return;
     }
 
     let button = win.document.getElementById("reader-mode-button");
     if (browser.currentURI.spec.startsWith("about:reader")) {
       button.setAttribute("readeractive", true);
       button.hidden = false;
-      button.setAttribute("tooltiptext", gStringBundle.GetStringFromName("readerMode.exit"));
+      button.setAttribute("tooltiptext", gStringBundle.GetStringFromName("readerView.exit"));
     } else {
       button.removeAttribute("readeractive");
-      button.setAttribute("tooltiptext", gStringBundle.GetStringFromName("readerMode.enter"));
+      button.setAttribute("tooltiptext", gStringBundle.GetStringFromName("readerView.enter"));
       button.hidden = !browser.isArticle;
     }
   },
 
   handleReaderButtonEvent: function(event) {
     event.stopPropagation();
 
     if ((event.type == "click" && event.button != 0) ||
--- a/mobile/android/chrome/content/Reader.js
+++ b/mobile/android/chrome/content/Reader.js
@@ -154,34 +154,34 @@ let Reader = {
     if (this.pageAction.id) {
       PageActions.remove(this.pageAction.id);
       delete this.pageAction.id;
     }
 
     let browser = tab.browser;
     if (browser.currentURI.spec.startsWith("about:reader")) {
       this.pageAction.id = PageActions.add({
-        title: Strings.browser.GetStringFromName("readerMode.exit"),
+        title: Strings.browser.GetStringFromName("readerView.exit"),
         icon: "drawable://reader_active",
         clickCallback: () => this.pageAction.readerModeCallback(tab.id),
         important: true
       });
 
       // Only start a reader session if the viewer is in the foreground. We do
       // not track background reader viewers.
       UITelemetry.startSession("reader.1", null);
       return;
     }
 
     // Only stop a reader session if the foreground viewer is not visible.
     UITelemetry.stopSession("reader.1", "", null);
 
     if (browser.isArticle) {
       this.pageAction.id = PageActions.add({
-        title: Strings.browser.GetStringFromName("readerMode.enter"),
+        title: Strings.browser.GetStringFromName("readerView.enter"),
         icon: "drawable://reader",
         clickCallback: () => this.pageAction.readerModeCallback(tab.id),
         longClickCallback: () => this.pageAction.readerModeActiveCallback(tab.id),
         important: true
       });
     }
   },
 
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -356,19 +356,19 @@ getUserMedia.videoSource.tabShare = Choo
 getUserMedia.videoSource.prompt = Video source
 getUserMedia.audioDevice.default = Microphone %S
 getUserMedia.audioDevice.none = No Audio
 getUserMedia.audioDevice.prompt = Microphone to use
 getUserMedia.sharingCamera.message2 = Camera is on
 getUserMedia.sharingMicrophone.message2 = Microphone is on
 getUserMedia.sharingCameraAndMicrophone.message2 = Camera and microphone are on
 
-#Reader mode
-readerMode.enter = Enter Reader Mode
-readerMode.exit = Exit Reader Mode
+#Reader view
+readerView.enter = Enter Reader View
+readerView.exit = Exit Reader View
 
 # LOCALIZATION NOTE (readerMode.toolbarTip):
 # Tip shown to users the first time we hide the reader mode toolbar.
 readerMode.toolbarTip=Tap the screen to show reader options
 
 #Open in App
 openInApp.pageAction = Open in App
 openInApp.ok = OK
--- a/toolkit/components/reader/AboutReader.jsm
+++ b/toolkit/components/reader/AboutReader.jsm
@@ -51,19 +51,20 @@ let AboutReader = function(mm, win) {
 
   win.addEventListener("unload", this, false);
   win.addEventListener("scroll", this, false);
   win.addEventListener("resize", this, false);
 
   doc.addEventListener("visibilitychange", this, false);
 
   this._setupStyleDropdown();
-  this._setupButton("close-button", this._onReaderClose.bind(this));
-  this._setupButton("toggle-button", this._onReaderToggle.bind(this));
-  this._setupButton("share-button", this._onShare.bind(this));
+  this._setupButton("close-button", this._onReaderClose.bind(this), "aboutReader.toolbar.close");
+  this._setupButton("toggle-button", this._onReaderToggle.bind(this), "aboutReader.toolbar.addToReadingList");
+  this._setupButton("share-button", this._onShare.bind(this), "aboutReader.toolbar.share");
+  this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
 
   let colorSchemeValues = JSON.parse(Services.prefs.getCharPref("reader.color_scheme.values"));
   let colorSchemeOptions = colorSchemeValues.map((value) => {
     return { name: gStrings.GetStringFromName("aboutReader.colorScheme." + value),
              value: value,
              itemClass: value + "-button" };
   });
 
@@ -216,22 +217,24 @@ AboutReader.prototype = {
       case "unload":
         this._mm.removeMessageListener("Reader:Added", this);
         this._mm.removeMessageListener("Reader:Removed", this);
         break;
     }
   },
 
   _updateToggleButton: function Reader_updateToggleButton() {
-    let classes = this._doc.getElementById("toggle-button").classList;
+    let button = this._doc.getElementById("toggle-button");
 
     if (this._isReadingListItem == 1) {
-      classes.add("on");
+      button.classList.add("on");
+      button.setAttribute("title", gStrings.GetStringFromName("aboutReader.toolbar.removeFromReadingList"));
     } else {
-      classes.remove("on");
+      button.classList.remove("on");
+      button.setAttribute("title", gStrings.GetStringFromName("aboutReader.toolbar.addToReadingList"));
     }
   },
 
   _requestReadingListStatus: function Reader_requestReadingListStatus() {
     let handleListStatusData = (message) => {
       this._mm.removeMessageListener("Reader:ListStatusData", handleListStatusData);
 
       let args = message.data;
@@ -276,16 +279,20 @@ AboutReader.prototype = {
 
     this._mm.sendAsyncMessage("Reader:Share", {
       url: this._article.url,
       title: this._article.title
     });
     UITelemetry.addEvent("share.1", "list", null);
   },
 
+  _onList: function() {
+    // To be implemented (bug 1132665)
+  },
+
   _setFontSize: function Reader_setFontSize(newFontSize) {
     let htmlClasses = this._doc.documentElement.classList;
 
     if (this._fontSize > 0)
       htmlClasses.remove("font-size" + this._fontSize);
 
     this._fontSize = newFontSize;
     htmlClasses.add("font-size" + this._fontSize);
@@ -672,18 +679,19 @@ AboutReader.prototype = {
         callback(option.value);
       }.bind(this), true);
 
       if (option.value === initialValue)
         item.classList.add("selected");
     }
   },
 
-  _setupButton: function Reader_setupButton(id, callback) {
+  _setupButton: function Reader_setupButton(id, callback, titleEntity) {
     let button = this._doc.getElementById(id);
+    button.setAttribute("title", gStrings.GetStringFromName(titleEntity));
 
     button.addEventListener("click", function(aEvent) {
       if (!aEvent.isTrusted)
         return;
 
       aEvent.stopPropagation();
       callback();
     }, true);
@@ -723,16 +731,17 @@ AboutReader.prototype = {
     win.addEventListener("resize", event => {
       if (!event.isTrusted)
         return;
 
       // Wait for reflow before calculating the new position of the popup.
       win.setTimeout(updatePopupPosition, 0);
     }, true);
 
+    dropdownToggle.setAttribute("title", gStrings.GetStringFromName("aboutReader.toolbar.typeControls"));
     dropdownToggle.addEventListener("click", event => {
       if (!event.isTrusted)
         return;
 
       event.stopPropagation();
 
       if (dropdown.classList.contains("open")) {
         dropdown.classList.remove("open");
--- a/toolkit/locales/en-US/chrome/global/aboutReader.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutReader.properties
@@ -21,8 +21,18 @@ aboutReader.fontType.charis-sil=Charis S
 aboutReader.fontType.clear-sans=Clear Sans
 
 # LOCALIZATION NOTE (aboutReader.fontTypeSample): String used to sample font types.
 aboutReader.fontTypeSample=Aa
 
 # LOCALIZATION NOTE (aboutReader.fontSizeSample): String used to sample a relative font size
 # for the font size setting. Tapping different samples will change the font size.
 aboutReader.fontSizeSample=A
+
+aboutReader.toolbar.close=Close Reader View
+aboutReader.toolbar.typeControls=Type controls
+aboutReader.toolbar.addToReadingList=Add to Reading List
+aboutReader.toolbar.removeFromReadingList=Remove from Reading List
+aboutReader.toolbar.openReadingList=Open Reading List
+aboutReader.toolbar.closeReadingList=Close Reading List
+aboutReader.toolbar.share=Share
+
+aboutReader.footer.deleteThisArticle=Delete this article