Bug 1561184 - Show tooltip text for protection report in app menu r=fluent-reviewers,johannh,flod
authorErica Wright <ewright@mozilla.com>
Tue, 17 Sep 2019 12:56:43 +0000
changeset 493583 1b4e9677c51626b04295d3d485141c85abe44024
parent 493582 474de32786de843bc6b9069c39584ce298ca5e67
child 493584 9954a34a9d49d2b71f9c51adbceecb0489a3acf6
push id36585
push usermalexandru@mozilla.com
push dateWed, 18 Sep 2019 09:56:40 +0000
treeherdermozilla-central@e71921b729c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfluent-reviewers, johannh, flod
bugs1561184
milestone71.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 1561184 - Show tooltip text for protection report in app menu r=fluent-reviewers,johannh,flod Differential Revision: https://phabricator.services.mozilla.com/D45583
browser/base/content/browser-siteProtections.js
browser/base/content/browser.xhtml
browser/components/customizableui/content/panelUI.inc.xul
browser/locales/en-US/browser/appmenu.ftl
browser/locales/en-US/chrome/browser/browser.properties
python/l10n/fluent_migrations/bug_1561184_app_menu_protection_report_tooltip.py
--- a/browser/base/content/browser-siteProtections.js
+++ b/browser/base/content/browser-siteProtections.js
@@ -1105,22 +1105,16 @@ var gProtectionsHandler = {
     ));
   },
   get animatedIcon() {
     delete this.animatedIcon;
     return (this.animatedIcon = document.getElementById(
       "tracking-protection-icon-animatable-image"
     ));
   },
-  get appMenuLabel() {
-    delete this.appMenuLabel;
-    return (this.appMenuLabel = document.getElementById(
-      "appMenu-protection-report-text"
-    ));
-  },
   get _protectionsIconBox() {
     delete this._protectionsIconBox;
     return (this._protectionsIconBox = document.getElementById(
       "tracking-protection-icon-animatable-box"
     ));
   },
   get _protectionsPopupMultiView() {
     delete this._protectionsPopupMultiView;
@@ -1239,30 +1233,16 @@ var gProtectionsHandler = {
     ));
   },
 
   get hasException() {
     return this._protectionsPopup.hasAttribute("hasException");
   },
 
   strings: {
-    get appMenuTitle() {
-      delete this.appMenuTitle;
-      return (this.appMenuTitle = gNavigatorBundle.getString(
-        "protectionReport.title"
-      ));
-    },
-
-    get appMenuTooltip() {
-      delete this.appMenuTooltip;
-      return (this.appMenuTooltip = gNavigatorBundle.getString(
-        "protectionReport.tooltip"
-      ));
-    },
-
     get activeTooltipText() {
       delete this.activeTooltipText;
       return (this.activeTooltipText = gNavigatorBundle.getString(
         "trackingProtection.icon.activeTooltip2"
       ));
     },
 
     get disabledTooltipText() {
@@ -1323,19 +1303,16 @@ var gProtectionsHandler = {
       this.PREF_ANIMATIONS_ENABLED,
       this.updateAnimationsEnabled
     );
 
     let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
     gProtectionsHandler._protectionsPopupSendReportLearnMore.href =
       baseURL + "blocking-breakage";
 
-    this.appMenuLabel.setAttribute("value", this.strings.appMenuTitle);
-    this.appMenuLabel.setAttribute("tooltiptext", this.strings.appMenuTooltip);
-
     // Add an observer to observe that the history has been cleared.
     Services.obs.addObserver(this, "browser:purge-session-history");
   },
 
   uninit() {
     for (let blocker of this.blockers) {
       if (blocker.uninit) {
         blocker.uninit();
--- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml
@@ -72,16 +72,17 @@
         persist="screenX screenY width height sizemode"
         data-l10n-sync="true">
 
 <linkset>
   <html:link rel="localization" href="branding/brand.ftl"/>
   <html:link rel="localization" href="browser/branding/sync-brand.ftl"/>
   <html:link rel="localization" href="browser/browser.ftl"/>
   <html:link rel="localization" href="browser/menubar.ftl"/>
+  <html:link rel="localization" href="browser/appmenu.ftl"/>
 </linkset>
 
 # All JS files which are needed by browser.xhtml and other top level windows to
 # support MacOS specific features *must* go into the global-scripts.inc file so
 # that they can be shared with macWindow.inc.xul.
 #include global-scripts.inc
 
 <script>
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -246,19 +246,23 @@
                         label="&fxa.menu.signin.label;"
                         closemenu="none"
                         oncommand="gSync.toggleAccountPanel('PanelUI-fxa', this, event)"/>
         </toolbaritem>
         <toolbarseparator class="sync-ui-item"/>
         <toolbaritem>
           <toolbarbutton id="appMenu-protection-report-button"
                class="subviewbutton subviewbutton-iconic"
-               oncommand="gProtectionsHandler.openProtections();">
+               oncommand="gProtectionsHandler.openProtections();"
+               data-l10n-id="appmenuitem-protection-report-tooltip">
             <image id="appMenu-protection-report-icon" class="toolbarbutton-icon"/>
-            <label id="appMenu-protection-report-text" class="toolbarbutton-text">Privacy Protections</label>
+            <label id="appMenu-protection-report-text"
+                   class="toolbarbutton-text"
+                   data-l10n-id="appmenuitem-protection-report-title">
+            </label>
           </toolbarbutton>
         </toolbaritem>
         <toolbarseparator id="appMenu-tp-separator"/>
         <toolbarbutton id="appMenu-new-window-button"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newNavigatorCmd.label;"
                        key="key_newNavigator"
                        command="cmd_newNavigator"/>
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/appmenu.ftl
@@ -0,0 +1,9 @@
+# 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/.
+
+## App Menu
+
+appmenuitem-protection-report-title = Protection Report
+appmenuitem-protection-report-tooltip =
+    .tooltiptext = Go to your privacy report
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -485,19 +485,16 @@ identity.ev.contentOwner2=Certificate is
 # use a synonym for "safe" or "private" if "secure" is too long.
 identity.notSecure.label=Not Secure
 identity.notSecure.tooltip=Connection is not secure
 
 identity.extension.label=Extension (%S)
 identity.extension.tooltip=Loaded by extension: %S
 identity.showDetails.tooltip=Show connection details
 
-protectionReport.title=Privacy Protections
-protectionReport.tooltip=Go to your privacy report
-
 # LOCALIZATION NOTE (contentBlocking.trackersView.blocked.label):
 #   This label is shown next to a tracker in the trackers subview.
 #   It forms the end of the (imaginary) sentence "www.example.com [was] Blocked"
 contentBlocking.trackersView.blocked.label=Blocked
 
 contentBlocking.trackersView.empty.label=None detected on this site
 
 # LOCALIZATION NOTE (contentBlocking.cookies.blockingTrackers.label, contentBlocking.cookies.blocking3rdParty.label,
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1561184_app_menu_protection_report_tooltip.py
@@ -0,0 +1,19 @@
+# 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
+
+def migrate(ctx):
+    """Bug 1561184 - Show tooltip text for protection report in app menu, part {index}"""
+
+    ctx.add_transforms(
+        'browser/browser/appmenu.ftl',
+        'browser/browser/appmenu.ftl',
+        transforms_from(
+"""
+appmenuitem-protection-report-title = { COPY(from_path, "protectionReport.title") }
+appmenuitem-protection-report-tooltip =
+    .tooltiptext = { COPY(from_path, "protectionReport.tooltip") }
+""", from_path="browser/chrome/browser/browser.properties"))