Bug 1451992 - Migrate Preferences::Subdialogs::SelectBookmark to Fluent. r?gijs,pike draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 05 Apr 2018 22:16:34 +0200
changeset 779881 32d0d6ea48e88bea261941eeb6eea1a0cc5d0eb7
parent 779880 ff0013fcf30d45bb9c69fa92210d0b3e2eb7240a
child 779882 dacb81cbb7e00451bcc73f9fd21c9e0c0f9e6749
push id105900
push userbmo:gandalf@aviary.pl
push dateTue, 10 Apr 2018 19:01:04 +0000
reviewersgijs, pike
bugs1451992
milestone61.0a1
Bug 1451992 - Migrate Preferences::Subdialogs::SelectBookmark to Fluent. r?gijs,pike MozReview-Commit-ID: BR74Gq4ULUD
browser/components/preferences/in-content/home.xul
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/selectBookmark.xul
browser/locales/en-US/browser/preferences/selectBookmark.ftl
browser/locales/en-US/chrome/browser/preferences/selectBookmark.dtd
browser/locales/jar.mn
python/l10n/fluent_migrations/bug_1451992_preferences_selectbookmark.py
--- a/browser/components/preferences/in-content/home.xul
+++ b/browser/components/preferences/in-content/home.xul
@@ -61,17 +61,17 @@
                     data-l10n-args='{"tabCount": 0}'
                     disabled="true"
                     preference="pref.browser.homepage.disable_button.current_page"/>
             <button id="useBookmarkBtn"
                     flex="1"
                     class="homepage-button check-home-page-controlled"
                     data-l10n-id="choose-bookmark"
                     preference="pref.browser.homepage.disable_button.bookmark_page"
-                    searchkeywords="&selectBookmark.title; &selectBookmark.label;"/>
+                    search-l10n-ids="select-bookmark-window.title, select-bookmark-desc"/>
           </hbox>
         </vbox>
       </vbox>
     </hbox>
     <hbox id="newTabsOption">
       <label control="newTabMode" data-l10n-id="home-newtabs-mode-label" flex="1" />
 
       <menulist id="newTabMode"
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -13,34 +13,31 @@
   href="chrome://browser/content/preferences/handlers.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/privacy.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-<!ENTITY % selectBookmarkDTD SYSTEM
-  "chrome://browser/locale/preferences/selectBookmark.dtd">
 <!ENTITY % passwordManagerDTD SYSTEM "chrome://passwordmgr/locale/passwordManager.dtd">
 <!ENTITY % historyDTD SYSTEM "chrome://mozapps/locale/update/history.dtd">
 <!ENTITY % certManagerDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
 <!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
 <!ENTITY % siteDataSettingsDTD SYSTEM
   "chrome://browser/locale/preferences/siteDataSettings.dtd" >
 <!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
 <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
 <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
 <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
 <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
 <!ENTITY % contentDTD SYSTEM "chrome://browser/locale/preferences/content.dtd">
 <!ENTITY % aboutDialogDTD SYSTEM "chrome://browser/locale/aboutDialog.dtd" >
 %aboutDialogDTD;
 %brandDTD;
-%selectBookmarkDTD;
 %passwordManagerDTD;
 %historyDTD;
 %certManagerDTD;
 %deviceManangerDTD;
 %siteDataSettingsDTD;
 %privacyDTD;
 %syncBrandDTD;
 %syncDTD;
@@ -66,16 +63,17 @@
   <!-- Links below are only used for search-l10n-ids into subdialogs -->
   <link rel="localization" href="browser/preferences/blocklists.ftl"/>
   <link rel="localization" href="browser/preferences/clearSiteData.ftl"/>
   <link rel="localization" href="browser/preferences/colors.ftl"/>
   <link rel="localization" href="browser/preferences/connection.ftl"/>
   <link rel="localization" href="browser/preferences/fonts.ftl"/>
   <link rel="localization" href="browser/preferences/languages.ftl"/>
   <link rel="localization" href="browser/preferences/permissions.ftl"/>
+  <link rel="localization" href="browser/preferences/selectBookmark.ftl"/>
 
   <script type="text/javascript" src="chrome://global/content/l10n.js"></script>
 
   <html:link rel="shortcut icon"
               href="chrome://browser/skin/settings.svg"/>
 
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
--- a/browser/components/preferences/selectBookmark.xul
+++ b/browser/components/preferences/selectBookmark.xul
@@ -4,25 +4,28 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
 
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
 
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/selectBookmark.dtd">
-
 <dialog id="selectBookmarkDialog"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&selectBookmark.title;" style="width: 32em;"
+        data-l10n-id="select-bookmark-window"
+        data-l10n-attrs="title"
+        style="width: 32em;"
         persist="screenX screenY width height" screenX="24" screenY="24"
         onload="SelectBookmarkDialog.init();"
         ondialogaccept="SelectBookmarkDialog.accept();">
 
+  <link rel="localization" href="browser/preferences/selectBookmark.ftl"/>
+  <script type="application/javascript" src="chrome://global/content/l10n.js"></script>
+
   <script type="application/javascript"
           src="chrome://browser/content/preferences/selectBookmark.js"/>
   <script type="application/javascript"
           src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"><![CDATA[
     ChromeUtils.defineModuleGetter(window,
@@ -34,17 +37,17 @@
 
     ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
     XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView",
       "chrome://browser/content/places/treeView.js");
     XPCOMUtils.defineLazyScriptGetter(window,
       ["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],
        "chrome://browser/content/places/controller.js");
   ]]></script>
-  <description>&selectBookmark.label;</description>
+  <description data-l10n-id="select-bookmark-desc"/>
 
   <separator class="thin"/>
 
   <tree id="bookmarks" flex="1" type="places"
         style="height: 15em;"
         hidecolumnpicker="true"
         seltype="single"
         ondblclick="SelectBookmarkDialog.onItemDblClick();"
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/preferences/selectBookmark.ftl
@@ -0,0 +1,8 @@
+# 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/.
+
+select-bookmark-window =
+    .title = Set Home Page
+
+select-bookmark-desc = Choose a Bookmark to be your Home Page. If you choose a folder, the Bookmarks in that folder will be opened in Tabs.
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/selectBookmark.dtd
+++ /dev/null
@@ -1,9 +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 selectBookmark.title
-  "Set Home Page">
-<!ENTITY selectBookmark.label
-  "Choose a Bookmark to be your Home Page. If you choose a folder, the Bookmarks in that folder will be opened in Tabs.">
-
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -55,17 +55,16 @@
     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/preferences/clearSiteData.properties     (%chrome/browser/preferences/clearSiteData.properties)
     locale/browser/preferences/content.dtd            (%chrome/browser/preferences/content.dtd)
     locale/browser/preferences/preferences.properties     (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
     locale/browser/preferences/security.dtd           (%chrome/browser/preferences/security.dtd)
-    locale/browser/preferences/selectBookmark.dtd     (%chrome/browser/preferences/selectBookmark.dtd)
     locale/browser/preferences/siteDataSettings.dtd     (%chrome/browser/preferences/siteDataSettings.dtd)
     locale/browser/preferences/sync.dtd               (%chrome/browser/preferences/sync.dtd)
     locale/browser/preferences/translation.dtd        (%chrome/browser/preferences/translation.dtd)
     locale/browser/syncBrand.dtd                (%chrome/browser/syncBrand.dtd)
     locale/browser/syncSetup.properties         (%chrome/browser/syncSetup.properties)
 #if BUILD_FASTER
     locale/browser/searchplugins/               (searchplugins/*.xml)
     locale/browser/searchplugins/list.json      (search/list.json)
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1451992_preferences_selectbookmark.py
@@ -0,0 +1,38 @@
+# 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 MESSAGE_REFERENCE
+from fluent.migrate import COPY, CONCAT, REPLACE
+
+def migrate(ctx):
+    """Bug 1451992 - Migrate Preferences::Subdialogs::Select Bookmark to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        'browser/browser/preferences/selectBookmark.ftl',
+        'browser/browser/preferences/selectBookmark.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('select-bookmark-window'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('title'),
+                        COPY(
+                            'browser/chrome/browser/preferences/selectBookmark.dtd',
+                            'selectBookmark.title'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('select-bookmark-desc'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/selectBookmark.dtd',
+                    'selectBookmark.label'
+                )
+            )
+        ]
+    )