Bug 1609555 - Migrate sidebar menu DTD to fluent r=Gijs,fluent-reviewers
authorArtem <salniker@msu.edu>
Tue, 24 Mar 2020 19:25:55 +0000
changeset 520265 581560b069b4a21494b9f8b9953b0860034d0616
parent 520264 be2533473311e2fc79d5917998d419c9cc479543
child 520266 ced448c84e743ef8529357fb59749d9daf4950f7
push id37246
push useropoprus@mozilla.com
push dateWed, 25 Mar 2020 03:40:33 +0000
treeherdermozilla-central@14b59d4adc95 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, fluent-reviewers
bugs1609555
milestone76.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 1609555 - Migrate sidebar menu DTD to fluent r=Gijs,fluent-reviewers Differential Revision: https://phabricator.services.mozilla.com/D67784
browser/base/content/browser.xhtml
browser/locales/en-US/browser/sidebarMenu.ftl
browser/locales/en-US/chrome/browser/browser.dtd
python/l10n/fluent_migrations/bug_1609555_sidebarMenu.py
--- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml
@@ -62,16 +62,17 @@
   <link rel="localization" href="toolkit/global/textActions.ftl"/>
   <link rel="localization" href="browser/browser.ftl"/>
   <link rel="localization" href="browser/browserContext.ftl"/>
   <link rel="localization" href="browser/browserSets.ftl"/>
   <link rel="localization" href="browser/menubar.ftl"/>
   <link rel="localization" href="browser/protectionsPanel.ftl"/>
   <link rel="localization" href="browser/appmenu.ftl"/>
   <link rel="localization" href="preview/interventions.ftl"/>
+  <link rel="localization" href="browser/sidebarMenu.ftl"/>
 
   <title
     data-l10n-id="browser-main-window-title"
     data-l10n-args='{"mode": "default"}'></title>
 
 # 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.xhtml.
@@ -251,17 +252,17 @@
         />
     </menulist>
 
     <!-- for invalid form error message -->
     <panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent">
       <description/>
     </panel>
 
-    <html:template id="editBookmarkPanelTemplate"> 
+    <html:template id="editBookmarkPanelTemplate">
       <panel id="editBookmarkPanel"
              class="panel-no-padding"
              type="arrow"
              orient="vertical"
              ignorekeys="true"
              hidden="true"
              tabspecific="true"
              aria-labelledby="editBookmarkPanelTitle">
@@ -352,39 +353,39 @@
            role="group"
            type="arrow"
            hidden="true"
            flip="slide"
            orient="vertical"
            position="bottomcenter topleft">
       <toolbarbutton id="sidebar-switcher-bookmarks"
                      type="checkbox"
-                     label="&bookmarksButton.label;"
+                     data-l10n-id="sidebar-menu-bookmarks"
                      class="subviewbutton subviewbutton-iconic"
                      key="viewBookmarksSidebarKb"
                      oncommand="SidebarUI.show('viewBookmarksSidebar');"/>
       <toolbarbutton id="sidebar-switcher-history"
                      type="checkbox"
-                     label="&historyButton.label;"
+                     data-l10n-id="sidebar-menu-history"
                      class="subviewbutton subviewbutton-iconic"
                      key="key_gotoHistory"
                      oncommand="SidebarUI.show('viewHistorySidebar');"/>
       <toolbarbutton id="sidebar-switcher-tabs"
                      type="checkbox"
-                     label="&syncedTabs.sidebar.label;"
+                     data-l10n-id="sidebar-menu-synced-tabs"
                      class="subviewbutton subviewbutton-iconic sync-ui-item"
                      oncommand="SidebarUI.show('viewTabsSidebar');"/>
       <toolbarseparator/>
       <!-- Extension toolbarbuttons go here. -->
       <toolbarseparator id="sidebar-extensions-separator"/>
       <toolbarbutton id="sidebar-reverse-position"
                      class="subviewbutton"
                      oncommand="SidebarUI.reversePosition()"/>
       <toolbarseparator/>
-      <toolbarbutton label="&sidebarMenuClose.label;"
+      <toolbarbutton data-l10n-id="sidebar-menu-close"
                      class="subviewbutton"
                      oncommand="SidebarUI.hide()"/>
     </panel>
 
     <menupopup id="toolbar-context-menu"
                onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator')); ToolbarContextMenu.updateDownloadsAutoHide(this); ToolbarContextMenu.updateExtension(this)">
       <menuitem oncommand="ToolbarContextMenu.openAboutAddonsForContextAction(this.parentElement)"
                 accesskey="&customizeMenu.manageExtension.accesskey;"
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/sidebarMenu.ftl
@@ -0,0 +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/.
+
+sidebar-menu-bookmarks =
+  .label = Bookmarks
+
+sidebar-menu-history =
+  .label = History
+
+sidebar-menu-synced-tabs =
+  .label = Synced Tabs
+
+sidebar-menu-close =
+  .label = Close Sidebar
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -262,17 +262,16 @@ this container is a toolbar. This avoids
 <!ENTITY saveToPocketCmd.label        "Save Page to Pocket">
 <!ENTITY pocketMenuitem.label         "View Pocket List">
 
 <!ENTITY emailPageCmd.label           "Email Linkā€¦">
 
 <!ENTITY fullZoom.label                 "Zoom">
 
 <!ENTITY sidebarCloseButton.tooltip     "Close sidebar">
-<!ENTITY sidebarMenuClose.label         "Close Sidebar">
 
 <!ENTITY quitApplicationCmdWin2.label       "Exit">
 <!ENTITY quitApplicationCmdWin2.accesskey   "x">
 <!ENTITY quitApplicationCmdWin2.tooltip     "Exit &brandShorterName;">
 <!ENTITY quitApplicationCmd.label       "Quit">
 <!ENTITY quitApplicationCmd.accesskey   "Q">
 <!ENTITY quitApplicationCmdMac2.label   "Quit &brandShorterName;">
 
@@ -337,18 +336,16 @@ this container is a toolbar. This avoids
 <!ENTITY protections.fingerprinters.description "Fingerprinters collect settings from your browser and computer to create a profile of you. Using this digital fingerprint, they can track you across different websites.">
 <!ENTITY protections.trackingContent2.description "Websites may load external ads, videos, and other content with tracking code. Blocking tracking content can help sites load faster, but some buttons, forms, and login fields might not work.">
 <!ENTITY protections.socialMediaTrackers.description "Social networks place trackers on other websites to follow what you do, see, and watch online. This allows social media companies to learn more about you beyond what you share on your social media profiles.">
 
 <!-- Name for the tabs toolbar as spoken by screen readers.
      The word "toolbar" is appended automatically and should not be contained below! -->
 <!ENTITY tabsToolbar.label "Browser tabs">
 
-<!ENTITY syncedTabs.sidebar.label              "Synced Tabs">
-
 <!ENTITY syncBrand.shortName.label    "Sync">
 
 <!ENTITY customizeMode.autoHideDownloadsButton.label "Auto-hide">
 
 <!ENTITY getUserMedia.selectCamera.label "Camera to share:">
 <!ENTITY getUserMedia.selectCamera.accesskey "C">
 <!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
 <!ENTITY getUserMedia.selectMicrophone.accesskey "M">
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1609555_sidebarMenu.py
@@ -0,0 +1,26 @@
+# coding=utf8
+
+# 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 1609555 - Migrate sidebar menu to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        "browser/browser/sidebarMenu.ftl",
+        "browser/browser/sidebarMenu.ftl",
+    transforms_from(
+"""
+sidebar-menu-bookmarks =
+    .label = { COPY(from_path, "bookmarksButton.label") }
+sidebar-menu-history =
+    .label = { COPY(from_path, "historyButton.label") }
+sidebar-menu-synced-tabs =
+    .label = { COPY(from_path, "syncedTabs.sidebar.label") }
+sidebar-menu-close =
+    .label = { COPY(from_path, "sidebarMenuClose.label") }
+""", from_path="browser/chrome/browser/browser.dtd"))