Bug 1626381 - Include a title on about:addons categories. r=rpl,flod, a=RyanVM
authorMark Striemer <mstriemer@mozilla.com>
Fri, 10 Apr 2020 06:03:35 +0000
changeset 585553 02d6cf7788837da73e2bd9cc4e2aca4aff1d6b67
parent 585552 51547f0e01d225f480dbbafaa1cc5a4552f4d063
child 585554 28fc014e05465eaf9bb08f11ce4326534347450b
push id13012
push userryanvm@gmail.com
push dateThu, 16 Apr 2020 18:38:12 +0000
treeherdermozilla-beta@28fc014e0546 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl, flod, RyanVM
bugs1626381
milestone76.0
Bug 1626381 - Include a title on about:addons categories. r=rpl,flod, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D69571
python/l10n/fluent_migrations/bug_1626381_about_addons_sidebar_titles.py
toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
toolkit/mozapps/extensions/content/aboutaddons.html
toolkit/mozapps/extensions/content/aboutaddons.js
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1626381_about_addons_sidebar_titles.py
@@ -0,0 +1,45 @@
+
+# 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 import COPY_PATTERN
+
+
+def migrate(ctx):
+    """Bug 1626381 - Add titles to about:addons sidebar, part {index}"""
+
+    ctx.add_transforms(
+        'toolkit/toolkit/about/aboutAddons.ftl',
+        'toolkit/toolkit/about/aboutAddons.ftl',
+        transforms_from(
+"""
+header-back-button =
+    .title = {COPY_PATTERN(from_path, "go-back-button.tooltiptext")}
+
+addon-category-discover-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-discover")}
+addon-category-available-updates-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-available-updates")}
+addon-category-recent-updates-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-recent-updates")}
+addon-category-extension-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-extension")}
+addon-category-theme-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-theme")}
+addon-category-locale-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-locale")}
+addon-category-plugin-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-plugin")}
+addon-category-dictionary-title =
+    .title = {COPY_PATTERN(from_path, "addon-category-dictionary")}
+
+sidebar-help-button-title =
+    .title = {COPY_PATTERN(from_path, "help-button")}
+sidebar-preferences-button-title =
+    .title = {COPY_PATTERN(from_path, "preferences")}
+"""
+        , from_path='toolkit/toolkit/about/aboutAddons.ftl')
+    )
--- a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
@@ -24,22 +24,30 @@ list-empty-recent-updates =
 
 list-empty-find-updates =
     .label = Check For Updates
 
 list-empty-button =
     .label = Learn more about add-ons
 
 help-button = Add-ons Support
+sidebar-help-button-title =
+    .title = Add-ons Support
 
 preferences =
     { PLATFORM() ->
         [windows] { -brand-short-name } Options
        *[other] { -brand-short-name } Preferences
     }
+sidebar-preferences-button-title =
+    .title =
+        { PLATFORM() ->
+            [windows] { -brand-short-name } Options
+           *[other] { -brand-short-name } Preferences
+        }
 
 show-unsigned-extensions-button =
     .label = Some extensions could not be verified
 
 show-all-extensions-button =
     .label = Show all extensions
 
 cmd-show-details =
@@ -193,23 +201,39 @@ legacy-extensions-description =
 private-browsing-description2 =
     { -brand-short-name } is changing how extensions work in private browsing. Any new extensions you add to
     { -brand-short-name } won’t run by default in Private Windows. Unless you allow it in settings, the
     extension won’t work while private browsing, and won’t have access to your online activities
     there. We’ve made this change to keep your private browsing private.
     <label data-l10n-name="private-browsing-learn-more">Learn how to manage extension settings</label>
 
 addon-category-discover = Recommendations
+addon-category-discover-title =
+    .title = Recommendations
 addon-category-extension = Extensions
+addon-category-extension-title =
+    .title = Extensions
 addon-category-theme = Themes
+addon-category-theme-title =
+    .title = Themes
 addon-category-plugin = Plugins
+addon-category-plugin-title =
+    .title = Plugins
 addon-category-dictionary = Dictionaries
+addon-category-dictionary-title =
+    .title = Dictionaries
 addon-category-locale = Languages
+addon-category-locale-title =
+    .title = Languages
 addon-category-available-updates = Available Updates
+addon-category-available-updates-title =
+    .title = Available Updates
 addon-category-recent-updates = Recent Updates
+addon-category-recent-updates-title =
+    .title = Recent Updates
 
 ## These are global warnings
 
 extensions-warning-safe-mode = All add-ons have been disabled by safe mode.
 extensions-warning-check-compatibility = Add-on compatibility checking is disabled. You may have incompatible add-ons.
 extensions-warning-check-compatibility-button = Enable
     .title = Enable add-on compatibility checking
 extensions-warning-update-security = Add-on update security checking is disabled. You may be compromised by updates.
@@ -293,18 +317,18 @@ shortcuts-exists = Already in use by { $
 
 shortcuts-card-expand-button =
     { $numberToShow ->
         *[other] Show { $numberToShow } More
     }
 
 shortcuts-card-collapse-button = Show Less
 
-go-back-button =
-    .tooltiptext = Go back
+header-back-button =
+    .title = Go back
 
 ## Recommended add-ons page
 
 # Explanatory introduction to the list of recommended add-ons. The action word
 # ("recommends") in the final sentence is a link to external documentation.
 discopane-intro =
     Extensions and themes are like apps for your browser, and they let you
     protect passwords, download videos, find deals, block annoying ads, change
--- a/toolkit/mozapps/extensions/content/aboutaddons.html
+++ b/toolkit/mozapps/extensions/content/aboutaddons.html
@@ -64,17 +64,17 @@
 
     <template name="addon-page-header">
       <div class="sticky-container">
         <div class="main-search">
           <label for="search-addons" class="search-label"></label>
           <search-addons data-l10n-id="search-header-shortcut" data-l10n-attrs="key"></search-addons>
         </div>
         <div class="main-heading">
-          <button class="back-button" action="go-back" data-l10n-id="go-back-button" hidden></button>
+          <button class="back-button" action="go-back" data-l10n-id="header-back-button" hidden></button>
           <h1 class="header-name"></h1>
           <div class="spacer"></div>
           <addon-updates-message id="updates-message" hidden></addon-updates-message>
           <div class="page-options-menu">
             <button class="more-options-button" action="page-options" aria-haspopup="menu" aria-expanded="false" data-l10n-id="addon-page-options-button"></button>
           </div>
         </div>
       </div>
--- a/toolkit/mozapps/extensions/content/aboutaddons.js
+++ b/toolkit/mozapps/extensions/content/aboutaddons.js
@@ -1637,16 +1637,18 @@ class CategoryButton extends HTMLButtonE
   connectedCallback() {
     if (this.childElementCount != 0) {
       return;
     }
 
     // Make sure the aria-selected attribute is set correctly.
     this.selected = this.hasAttribute("selected");
 
+    document.l10n.setAttributes(this, `addon-category-${this.name}-title`);
+
     let text = document.createElement("span");
     text.classList.add("category-name");
     document.l10n.setAttributes(text, `addon-category-${this.name}`);
 
     this.append(text);
   }
 
   load() {
@@ -1915,16 +1917,17 @@ class SidebarFooter extends HTMLElement 
     list.classList.add("sidebar-footer-list");
 
     let prefsItem = document.createElement("li");
     prefsItem.classList.add("sidebar-footer-item");
     let prefsLink = document.createElement("a");
     prefsLink.classList.add("sidebar-footer-link", "preferences-icon");
     prefsLink.id = "preferencesButton";
     prefsLink.href = "about:preferences";
+    document.l10n.setAttributes(prefsLink, "sidebar-preferences-button-title");
     let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
     prefsLink.addEventListener("click", e => {
       e.preventDefault();
       AMTelemetry.recordLinkEvent({
         object: "aboutAddons",
         value: "about:preferences",
         extra: {
           view: getTelemetryViewName(this),
@@ -1939,16 +1942,17 @@ class SidebarFooter extends HTMLElement 
     prefsText.classList.add("sidebar-footer-link-text");
     document.l10n.setAttributes(prefsText, "preferences");
     prefsLink.append(prefsText);
     prefsItem.append(prefsLink);
 
     let supportItem = document.createElement("li");
     supportItem.classList.add("sidebar-footer-item");
     let supportLink = document.createElement("a", { is: "support-link" });
+    document.l10n.setAttributes(supportLink, "sidebar-help-button-title");
     supportLink.classList.add("sidebar-footer-link", "help-icon");
     supportLink.id = "help-button";
     supportLink.setAttribute("support-page", "addons-help");
     supportLink.addEventListener("click", e => {
       AMTelemetry.recordLinkEvent({
         object: "aboutAddons",
         value: "support",
         extra: {