Bug 1624713 - Convert editBookmarkOverlay.dtd to fluent r=Gijs,fluent-reviewers,flod
☠☠ backed out by a74b5711286b ☠ ☠
authorArtem <salniker@msu.edu>
Thu, 26 Mar 2020 17:26:09 +0000
changeset 520610 49509cff8c94d3758e0713c26d3ed43a7762570b
parent 520609 508ff70decaa4c5a3ac5bdceac9396d89b63d820
child 520611 5b32eaa3d9546bedb2dd638043c3ada384279a9b
push id37254
push usernerli@mozilla.com
push dateFri, 27 Mar 2020 04:48:07 +0000
treeherdermozilla-central@2d758b42bd73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, fluent-reviewers, flod
bugs1624713
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 1624713 - Convert editBookmarkOverlay.dtd to fluent r=Gijs,fluent-reviewers,flod Differential Revision: https://phabricator.services.mozilla.com/D68118
browser/base/content/browser-doctype.inc
browser/base/content/browser-places.js
browser/components/places/content/bookmarkProperties.xhtml
browser/components/places/content/editBookmarkPanel.inc.xhtml
browser/components/places/content/places.xhtml
browser/locales/en-US/browser/editBookmarkOverlay.ftl
browser/locales/en-US/chrome/browser/places/editBookmarkOverlay.dtd
browser/locales/jar.mn
python/l10n/fluent_migrations/bug_1624713_editBookmarkOverlay.py
--- a/browser/base/content/browser-doctype.inc
+++ b/browser/base/content/browser-doctype.inc
@@ -11,10 +11,8 @@
 <!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
 %downloadsDTD;
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
 %syncBrandDTD;
 <!ENTITY % brandingsDTD SYSTEM "chrome://browser/locale/brandings.dtd">
 %brandingsDTD;
-<!ENTITY % editBookmarkOverlayDTD SYSTEM "chrome://browser/locale/places/editBookmarkOverlay.dtd">
-%editBookmarkOverlayDTD;
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -298,16 +298,17 @@ var StarUI = {
     });
 
     this.panel.openPopup(this._anchorElement, "bottomcenter topright");
   },
 
   _createPanelIfNeeded() {
     // Lazy load the editBookmarkPanel the first time we need to display it.
     if (!this._element("editBookmarkPanel")) {
+      MozXULElement.insertFTLIfNeeded("browser/editBookmarkOverlay.ftl");
       let template = this._element("editBookmarkPanelTemplate");
       let clone = template.content.cloneNode(true);
       template.replaceWith(clone);
     }
   },
 
   _setIconAndPreviewImage() {
     let faviconImage = this._element("editBookmarkPanelFavicon");
--- a/browser/components/places/content/bookmarkProperties.xhtml
+++ b/browser/components/places/content/bookmarkProperties.xhtml
@@ -4,32 +4,33 @@
    - 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/. -->
 
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://browser/skin/places/editBookmark.css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/tree-icons.css"?>
 <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
 
-<!DOCTYPE window [
-  <!ENTITY % editBookmarkOverlayDTD SYSTEM "chrome://browser/locale/places/editBookmarkOverlay.dtd">
-  %editBookmarkOverlayDTD;
-]>
+<!DOCTYPE window>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         id="bookmarkproperties"
         onload="BookmarkPropertiesPanel.onDialogLoad();"
         onunload="BookmarkPropertiesPanel.onDialogUnload();"
         style="min-width: 30em;"
         persist="screenX screenY width">
 <dialog id="bookmarkpropertiesdialog"
         buttons="accept, cancel"
         buttoniconaccept="save">
 
+  <linkset>
+    <html:link rel="localization" href="browser/editBookmarkOverlay.ftl"/>
+  </linkset>
+
   <stringbundleset id="stringbundleset">
     <stringbundle id="stringBundle"
                   src="chrome://browser/locale/places/bookmarkProperties.properties"/>
   </stringbundleset>
 
   <script src="chrome://browser/content/places/editBookmark.js"/>
   <script src="chrome://browser/content/places/bookmarkProperties.js"/>
   <script src="chrome://global/content/globalOverlay.js"/>
--- a/browser/components/places/content/editBookmarkPanel.inc.xhtml
+++ b/browser/components/places/content/editBookmarkPanel.inc.xhtml
@@ -5,98 +5,93 @@
 <vbox id="editBookmarkPanelContent" flex="1">
   <hbox id="editBMPanel_selectionCount" pack="center">
     <label id="editBMPanel_itemsCountText"/>
   </hbox>
 
   <vbox id="editBookmarkPanelRows">
     <vbox id="editBMPanel_nameRow"
           collapsed="true">
-      <label value="&editBookmarkOverlay.name.label;"
-             accesskey="&editBookmarkOverlay.name.accesskey;"
+      <label data-l10n-id="bookmark-overlay-name"
              control="editBMPanel_namePicker"/>
       <html:input id="editBMPanel_namePicker"
                   onchange="gEditItemOverlay.onNamePickerChange().catch(Cu.reportError);"/>
     </vbox>
 
     <vbox id="editBMPanel_locationRow"
           collapsed="true">
-      <label value="&editBookmarkOverlay.location.label;"
-             accesskey="&editBookmarkOverlay.location.accesskey;"
+      <label data-l10n-id="bookmark-overlay-location"
              control="editBMPanel_locationField"/>
       <html:input id="editBMPanel_locationField"
                   class="uri-element"
                   onchange="gEditItemOverlay.onLocationFieldChange();"/>
     </vbox>
 
     <vbox id="editBMPanel_folderRow"
           collapsed="true">
-      <label value="&editBookmarkOverlay.folder.label;"
+      <label data-l10n-id="bookmark-overlay-folder"
              control="editBMPanel_folderMenuList"/>
       <hbox flex="1" align="center">
         <menulist id="editBMPanel_folderMenuList"
                   class="folder-icon panel-button"
                   flex="1"
                   oncommand="gEditItemOverlay.onFolderMenuListCommand(event).catch(Cu.reportError);">
           <menupopup>
             <!-- Static item for special folders -->
             <menuitem id="editBMPanel_toolbarFolderItem"
                       class="menuitem-iconic folder-icon"/>
             <menuitem id="editBMPanel_bmRootItem"
                       class="menuitem-iconic folder-icon"/>
             <menuitem id="editBMPanel_unfiledRootItem"
                       class="menuitem-iconic folder-icon"/>
             <menuseparator id="editBMPanel_chooseFolderSeparator"/>
             <menuitem id="editBMPanel_chooseFolderMenuItem"
-                      label="&editBookmarkOverlay.choose.label;"
+                      data-l10n-id="bookmark-overlay-choose"
                       class="menuitem-iconic folder-icon"/>
             <menuseparator id="editBMPanel_foldersSeparator" hidden="true"/>
           </menupopup>
         </menulist>
         <button id="editBMPanel_foldersExpander"
                 class="expander-down panel-button"
-                tooltiptext="&editBookmarkOverlay.foldersExpanderDown.tooltip;"
-                tooltiptextdown="&editBookmarkOverlay.foldersExpanderDown.tooltip;"
-                tooltiptextup="&editBookmarkOverlay.expanderUp.tooltip;"
+                data-l10n-id="bookmark-overlay-folders-expander"
+                data-l10n-attrs="tooltiptextdown, tooltiptextup"
                 oncommand="gEditItemOverlay.toggleFolderTreeVisibility();"/>
       </hbox>
     </vbox>
 
     <vbox id="editBMPanel_folderTreeRow"
           collapsed="true">
       <!-- editBMPanel_folderTree will go here when this is shown -->
       <hbox id="editBMPanel_newFolderBox">
-        <button label="&editBookmarkOverlay.newFolderButton.label;"
+        <button data-1l0n-id="bookmark-overlay-new-folder-button"
                 id="editBMPanel_newFolderButton"
-                accesskey="&editBookmarkOverlay.newFolderButton.accesskey;"
                 oncommand="gEditItemOverlay.newFolder().catch(Cu.reportError);"/>
       </hbox>
     </vbox>
 
     <vbox id="editBMPanel_tagsRow"
           collapsed="true">
-      <label value="&editBookmarkOverlay.tags.label;"
-             accesskey="&editBookmarkOverlay.tags.accesskey;"
+      <label data-l10n-id="bookmark-overlay-tags"
              control="editBMPanel_tagsField"/>
       <hbox flex="1" align="center" role="combobox">
         <html:input id="editBMPanel_tagsField"
                  is="autocomplete-input"
                  style="-moz-box-flex: 1;"
                  autocompletesearch="places-tag-autocomplete"
                  autocompletepopup="editBMPanel_tagsAutocomplete"
                  completedefaultindex="true"
                  completeselectedindex="true"
                  tabscrolling="true"
-                 placeholder="&editBookmarkOverlay.tagsEmptyDesc.label;"
+                 data-l10n-id="bookmark-overlay-tags-empty-description"
+                 data-l10n-attrs="placeholder"
                  onchange="gEditItemOverlay.onTagsFieldChange();"/>
         <button id="editBMPanel_tagsSelectorExpander"
                 class="expander-down panel-button"
-                tooltiptext="&editBookmarkOverlay.tagsExpanderDown.tooltip;"
-                tooltiptextdown="&editBookmarkOverlay.tagsExpanderDown.tooltip;"
-                tooltiptextup="&editBookmarkOverlay.expanderUp.tooltip;"
+                data-l10n-id="bookmark-overlay-tags-expander"
+                data-l10n-attrs="tooltiptextdown, tooltiptextup"
                 oncommand="gEditItemOverlay.toggleTagsSelector().catch(Cu.reportError);"/>
         <popupset>
           <panel is="autocomplete-richlistbox-popup"
                  type="autocomplete-richlistbox"
                  id="editBMPanel_tagsAutocomplete"
                  role="group"
                  noautofocus="true"
                  hidden="true"
@@ -111,16 +106,15 @@
           collapsed="true">
       <richlistbox id="editBMPanel_tagsSelector"
                    styled="true"
                    height="150"/>
     </vbox>
 
     <vbox id="editBMPanel_keywordRow"
           collapsed="true">
-      <label value="&editBookmarkOverlay.keyword.label;"
-             accesskey="&editBookmarkOverlay.keyword.accesskey;"
+      <label data-l10n-id="bookmark-overlay-keyword"
              control="editBMPanel_keywordField"/>
       <html:input id="editBMPanel_keywordField"
                   onchange="gEditItemOverlay.onKeywordFieldChange();"/>
     </vbox>
   </vbox>
 </vbox>
--- a/browser/components/places/content/places.xhtml
+++ b/browser/components/places/content/places.xhtml
@@ -18,18 +18,16 @@
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 <!ENTITY % downloadsDTD SYSTEM "chrome://browser/locale/downloads/downloads.dtd">
 %downloadsDTD;
 <!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
 %editMenuOverlayDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
 %browserDTD;
-<!ENTITY % editBookmarkOverlayDTD SYSTEM "chrome://browser/locale/places/editBookmarkOverlay.dtd">
-%editBookmarkOverlayDTD;
 #ifdef XP_MACOSX
 #include ../../../base/content/browser-doctype.inc
 #endif
 ]>
 
 <window id="places"
         title="&places.library.title;"
         windowtype="Places:Organizer"
@@ -40,16 +38,17 @@
         width="&places.library.width;" height="&places.library.height;"
         screenX="10" screenY="10"
         toggletoolbar="true"
         persist="width height screenX screenY sizemode">
 
   <linkset>
     <html:link rel="localization" href="toolkit/global/textActions.ftl"/>
     <html:link rel="localization" href="browser/browserSets.ftl"/>
+    <html:link rel="localization" href="browser/editBookmarkOverlay.ftl"/>
   </linkset>
 
   <script src="chrome://browser/content/places/places.js"/>
   <script src="chrome://global/content/editMenuOverlay.js"/>
 #ifndef XP_MACOSX
   <!-- On Mac, this is included via macWindow.inc.xhtml -> global-scripts.inc -> browser.js -> defineLazyScriptGetter -->
   <script src="chrome://browser/content/places/editBookmark.js"/>
   <!-- On Mac, thes are included via macWindow.inc.xhtml -> global-scripts.inc -->
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/editBookmarkOverlay.ftl
@@ -0,0 +1,42 @@
+# 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/.
+
+bookmark-overlay-name =
+  .value = Name:
+  .accesskey = N
+
+bookmark-overlay-location =
+  .value = Location:
+  .accesskey = L
+
+bookmark-overlay-folder =
+  .value = Folder:
+
+bookmark-overlay-choose =
+  .label = Choose…
+
+bookmark-overlay-folders-expander =
+  .tooltiptext = Show all the bookmarks folders
+  .tooltiptextdown = { bookmark-overlay-folders-expander.tooltiptext }
+  .tooltiptextup = Hide
+
+bookmark-overlay-new-folder-button =
+  .label = New Folder
+  .accesskey = o
+
+bookmark-overlay-tags =
+  .value = Tags:
+  .accesskey = T
+
+bookmark-overlay-tags-empty-description =
+  .placeholder = Separate tags with commas
+
+bookmark-overlay-tags-expander =
+  .tooltiptext = Show all tags
+  .tooltiptextdown = { bookmark-overlay-tags-expander.tooltiptext }
+  .tooltiptextup = Hide
+
+bookmark-overlay-keyword =
+  .value = Keyword:
+  .accesskey = K
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/places/editBookmarkOverlay.dtd
+++ /dev/null
@@ -1,20 +0,0 @@
-<!-- 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/. -->
-
-<!ENTITY editBookmarkOverlay.name.label                      "Name:">
-<!ENTITY editBookmarkOverlay.name.accesskey                  "N">
-<!ENTITY editBookmarkOverlay.location.label                  "Location:">
-<!ENTITY editBookmarkOverlay.location.accesskey              "L">
-<!ENTITY editBookmarkOverlay.folder.label                    "Folder:">
-<!ENTITY editBookmarkOverlay.foldersExpanderDown.tooltip     "Show all the bookmarks folders">
-<!ENTITY editBookmarkOverlay.expanderUp.tooltip              "Hide">
-<!ENTITY editBookmarkOverlay.tags.label                      "Tags:">
-<!ENTITY editBookmarkOverlay.tags.accesskey                  "T">
-<!ENTITY editBookmarkOverlay.tagsEmptyDesc.label             "Separate tags with commas">
-<!ENTITY editBookmarkOverlay.keyword.label                   "Keyword:">
-<!ENTITY editBookmarkOverlay.keyword.accesskey               "K">
-<!ENTITY editBookmarkOverlay.tagsExpanderDown.tooltip        "Show all tags">
-<!ENTITY editBookmarkOverlay.choose.label                    "Choose…">
-<!ENTITY editBookmarkOverlay.newFolderButton.label           "New Folder">
-<!ENTITY editBookmarkOverlay.newFolderButton.accesskey       "o">
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -33,17 +33,16 @@
     locale/browser/taskbar.properties              (%chrome/browser/taskbar.properties)
     locale/browser/translation.dtd                 (%chrome/browser/translation.dtd)
     locale/browser/translation.properties          (%chrome/browser/translation.properties)
     locale/browser/webrtcIndicator.properties      (%chrome/browser/webrtcIndicator.properties)
     locale/browser/downloads/downloads.dtd         (%chrome/browser/downloads/downloads.dtd)
     locale/browser/downloads/downloads.properties  (%chrome/browser/downloads/downloads.properties)
     locale/browser/places/places.dtd               (%chrome/browser/places/places.dtd)
     locale/browser/places/places.properties        (%chrome/browser/places/places.properties)
-    locale/browser/places/editBookmarkOverlay.dtd  (%chrome/browser/places/editBookmarkOverlay.dtd)
     locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties)
     locale/browser/safebrowsing/safebrowsing.properties   (%chrome/browser/safebrowsing/safebrowsing.properties)
     locale/browser/feeds/subscribe.properties       (%chrome/browser/feeds/subscribe.properties)
     locale/browser/migration/migration.dtd         (%chrome/browser/migration/migration.dtd)
     locale/browser/migration/migration.properties  (%chrome/browser/migration/migration.properties)
     locale/browser/syncBrand.dtd                (%chrome/browser/syncBrand.dtd)
     locale/browser/syncSetup.properties         (%chrome/browser/syncSetup.properties)
 % locale browser-region @AB_CD@ %locale/browser-region/
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1624713_editBookmarkOverlay.py
@@ -0,0 +1,47 @@
+# 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 1624713 - Convert editBookmarkOverlay to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        "browser/browser/editBookmarkOverlay.ftl",
+        "browser/browser/editBookmarkOverlay.ftl",
+    transforms_from(
+"""
+bookmark-overlay-name =
+    .value = { COPY(from_path, "editBookmarkOverlay.name.label") }
+    .accesskey = { COPY(from_path, "editBookmarkOverlay.name.accesskey") }
+bookmark-overlay-location =
+    .value = { COPY(from_path, "editBookmarkOverlay.location.label") }
+    .accesskey = { COPY(from_path, "editBookmarkOverlay.location.accesskey") }
+bookmark-overlay-folder =
+    .value = { COPY(from_path, "editBookmarkOverlay.folder.label") }
+bookmark-overlay-choose =
+    .label = { COPY(from_path, "editBookmarkOverlay.choose.label") }
+bookmark-overlay-folders-expander =
+  .tooltiptext = { COPY(from_path, "editBookmarkOverlay.foldersExpanderDown.tooltip") }
+  .tooltiptextdown = { bookmark-overlay-folders-expander.tooltiptext }
+  .tooltiptextup = { COPY(from_path, "editBookmarkOverlay.expanderUp.tooltip") }
+bookmark-overlay-new-folder-button =
+    .label = { COPY(from_path, "editBookmarkOverlay.newFolderButton.label") }
+    .accesskey = { COPY(from_path, "editBookmarkOverlay.newFolderButton.accesskey") }
+bookmark-overlay-tags =
+    .value = { COPY(from_path, "editBookmarkOverlay.tags.label") }
+    .accesskey ={ COPY(from_path, "editBookmarkOverlay.tags.accesskey") }
+bookmark-overlay-tags-empty-description =
+    .placeholder = { COPY(from_path, "editBookmarkOverlay.tagsEmptyDesc.label") }
+bookmark-overlay-tags-expander =
+  .tooltiptext = { COPY(from_path, "editBookmarkOverlay.tagsExpanderDown.tooltip") }
+  .tooltiptextdown = { bookmark-overlay-tags-expander.tooltiptext }
+  .tooltiptextup = { COPY(from_path, "editBookmarkOverlay.expanderUp.tooltip") }
+bookmark-overlay-keyword =
+    .value = { COPY(from_path, "editBookmarkOverlay.keyword.label") }
+    .accesskey = { COPY(from_path, "editBookmarkOverlay.keyword.accesskey") }
+""", from_path="browser/chrome/browser/places/editBookmarkOverlay.dtd"))