Bug 1451992 - Migrate Preferences::Subdialogs::SiteData to Fluent. r?jaws,flod draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 05 Apr 2018 22:37:59 +0200
changeset 780608 de67978e179179ff3f718a525126482ffb3278c7
parent 780607 76a21401ff9b01e5777fd68f6897f344de55134e
child 780609 f3996141f71c405173d1933945bf3cec5416edba
push id106035
push userbmo:gandalf@aviary.pl
push dateWed, 11 Apr 2018 15:42:00 +0000
reviewersjaws, flod
bugs1451992
milestone61.0a1
Bug 1451992 - Migrate Preferences::Subdialogs::SiteData to Fluent. r?jaws,flod MozReview-Commit-ID: KzEP0iCfzGf
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/siteDataRemoveSelected.xul
browser/components/preferences/siteDataSettings.xul
browser/locales/en-US/browser/preferences/siteDataSettings.ftl
browser/locales/en-US/chrome/browser/preferences/siteDataSettings.dtd
browser/locales/jar.mn
python/l10n/fluent_migrations/bug_1451992_preferences_sitedata.py
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -17,32 +17,29 @@
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/privacy.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.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;
 %passwordManagerDTD;
 %historyDTD;
 %certManagerDTD;
 %deviceManangerDTD;
-%siteDataSettingsDTD;
 %privacyDTD;
 %syncBrandDTD;
 %syncDTD;
 %sanitizeDTD;
 %aboutHomeDTD;
 %contentDTD;
 ]>
 
@@ -64,16 +61,17 @@
   <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"/>
+  <link rel="localization" href="browser/preferences/siteDataSettings.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/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -228,20 +228,22 @@
             icon="clear"
             search-l10n-ids="clear-site-data-cookies, clear-site-data-cache"
             data-l10n-id="sitedata-clear"/>
       </hbox>
       <hbox>
         <button id="siteDataSettings"
                 class="accessory-button"
                 data-l10n-id="sitedata-settings"
-                searchkeywords="&window2.title;
-                                &hostCol.label;
-                                &cookiesCol.label;
-                                &usageCol.label;"/>
+                search-l10n-ids="
+                  site-data-settings-window.title,
+                  site-data-column-host.label,
+                  site-data-column-cookies.label,
+                  site-data-column-storage.label,
+                "/>
       </hbox>
       <hbox>
         <button id="cookieExceptions"
                 class="accessory-button"
                 data-l10n-id="sitedata-cookies-exceptions"
                 preference="pref.privacy.disable_button.cookie_exceptions"
                 search-l10n-ids="
                   permissions-address,
--- a/browser/components/preferences/siteDataRemoveSelected.xul
+++ b/browser/components/preferences/siteDataRemoveSelected.xul
@@ -3,53 +3,56 @@
 <!-- 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/. -->
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/content/preferences/siteDataSettings.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/siteDataSettings.css" type="text/css"?>
 
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/siteDataSettings.dtd" >
-
 <dialog id="SiteDataRemoveSelectedDialog"
         windowtype="Browser:SiteDataRemoveSelected"
         width="500"
-        title="&removingDialog1.title;"
+        data-l10n-id="site-data-removing-window"
+        data-l10n-attrs="title"
         onload="gSiteDataRemoveSelected.init();"
         ondialogaccept="gSiteDataRemoveSelected.ondialogaccept(); return true;"
         ondialogcancel="gSiteDataRemoveSelected.ondialogcancel(); return true;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
+  <link rel="localization" href="browser/preferences/siteDataSettings.ftl"/>
+  <script type="application/javascript" src="chrome://global/content/l10n.js"></script>
+
   <script src="chrome://browser/content/preferences/siteDataRemoveSelected.js"/>
 
   <stringbundle id="bundlePreferences"
                 src="chrome://browser/locale/preferences/preferences.properties"/>
 
   <vbox id="contentContainer">
     <hbox flex="1">
       <vbox>
         <image class="question-icon"/>
       </vbox>
       <vbox flex="1">
         <!-- Only show this label on OS X because of no dialog title -->
         <label id="removing-label"
+               data-l10n-id="site-data-removing-header"
 #ifndef XP_MACOSX
                hidden="true"
 #endif
-        >&removingDialog1.title;</label>
+        />
         <separator class="thin"/>
-        <description id="removing-description">&removingSelected1.description;</description>
+        <description id="removing-description" data-l10n-id="site-data-removing-desc"/>
       </vbox>
     </hbox>
 
     <separator />
 
     <vbox flex="1">
-      <label>&siteTree3.label;</label>
+      <label data-l10n-id="site-data-removing-table"/>
       <separator class="thin"/>
       <tree id="sitesTree" flex="1" seltype="single" hidecolumnpicker="true">
         <treecols>
           <treecol primary="true" flex="1" hideheader="true"/>
         </treecols>
         <treechildren />
       </tree>
     </vbox>
--- a/browser/components/preferences/siteDataSettings.xul
+++ b/browser/components/preferences/siteDataSettings.xul
@@ -4,58 +4,61 @@
    - 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/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/content/preferences/siteDataSettings.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/siteDataSettings.css" type="text/css"?>
 
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/siteDataSettings.dtd" >
-
 <window id="SiteDataSettingsDialog" windowtype="Browser:SiteDataSettings"
-        class="windowDialog" title="&window2.title;"
+        data-l10n-id="site-data-settings-window"
+        data-l10n-attrs="title"
+        class="windowDialog"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         style="width: 45em;"
         onload="gSiteDataSettings.init();"
         onkeypress="gSiteDataSettings.onKeyPress(event);"
         persist="screenX screenY width height">
 
+  <link rel="localization" href="browser/preferences/siteDataSettings.ftl"/>
+  <script type="application/javascript" src="chrome://global/content/l10n.js"></script>
+
   <script src="chrome://browser/content/preferences/siteDataSettings.js"/>
 
   <stringbundle id="bundlePreferences"
                 src="chrome://browser/locale/preferences/preferences.properties"/>
   <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
 
   <vbox flex="1">
     <description id="settingsDescription"></description>
     <separator class="thin"/>
 
     <hbox id="searchBoxContainer">
       <textbox id="searchBox" type="search" flex="1"
-        placeholder="&searchTextboxPlaceHolder;" accesskey="&searchTextboxPlaceHolder.accesskey;"/>
+        data-l10n-id="site-data-search-textbox"/>
     </hbox>
     <separator class="thin"/>
 
     <richlistbox id="sitesList" orient="vertical" flex="1">
       <listheader>
-        <treecol flex="4" width="50" label="&hostCol.label;" id="hostCol"/>
-        <treecol flex="1" width="50" label="&cookiesCol.label;" id="cookiesCol"/>
+        <treecol flex="4" width="50" data-l10n-id="site-data-column-host" id="hostCol"/>
+        <treecol flex="1" width="50" data-l10n-id="site-data-column-cookies" id="cookiesCol"/>
         <!-- Sorted by usage so the user can quickly see which sites use the most data. -->
-        <treecol flex="2" width="50" label="&usageCol.label;" id="usageCol" data-isCurrentSortCol="true"/>
-        <treecol flex="2" width="50" label="&lastAccessedCol.label;" id="lastAccessedCol" />
+        <treecol flex="2" width="50" data-l10n-id="site-data-column-storage" id="usageCol" data-isCurrentSortCol="true"/>
+        <treecol flex="2" width="50" data-l10n-id="site-data-column-last-used" id="lastAccessedCol" />
       </listheader>
     </richlistbox>
   </vbox>
 
   <hbox align="start">
-    <button id="removeSelected" label="&removeSelected.label;" accesskey="&removeSelected.accesskey;"/>
+    <button id="removeSelected" data-l10n-id="site-data-remove-selected"/>
     <button id="removeAll"/>
   </hbox>
 
   <vbox align="end">
     <hbox>
-        <button id="cancel" label="&cancel.label;" accesskey="&cancel.accesskey;"/>
-        <button id="save" label="&save.label;" accesskey="&save.accesskey;"/>
+        <button id="cancel" data-l10n-id="site-data-button-cancel"/>
+        <button id="save" data-l10n-id="site-data-button-save"/>
     </hbox>
   </vbox>
 
 </window>
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/preferences/siteDataSettings.ftl
@@ -0,0 +1,45 @@
+# 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/.
+
+
+## Settings
+
+site-data-settings-window =
+    .title = Manage Cookies and Site Data
+
+site-data-search-textbox =
+    .placeholder = Search websites
+    .accesskey = S
+
+site-data-column-host =
+    .label = Site
+site-data-column-cookies =
+    .label = Cookies
+site-data-column-storage =
+    .label = Storage
+site-data-column-last-used =
+    .label = Last Used
+
+site-data-remove-selected =
+    .label = Remove Selected
+    .accesskey = R
+
+site-data-button-cancel =
+    .label = Cancel
+    .accesskey = C
+
+site-data-button-save =
+    .label = Save Changes
+    .accesskey = a
+
+## Removing
+
+site-data-removing-window =
+    .title = { site-data-removing-header }
+
+site-data-removing-header = Removing Cookies and Site Data
+
+site-data-removing-desc = Removing cookies and site data may log you out of websites. Are you sure you want to make the changes?
+
+site-data-removing-table = Cookies and site data for the following websites will be removed
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/siteDataSettings.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     window2.title                 "Manage Cookies and Site Data">
-<!ENTITY     hostCol.label                 "Site">
-<!ENTITY     cookiesCol.label              "Cookies">
-<!ENTITY     usageCol.label                "Storage">
-<!ENTITY     lastAccessedCol.label                "Last Used">
-<!ENTITY     searchTextboxPlaceHolder             "Search websites">
-<!ENTITY     searchTextboxPlaceHolder.accesskey   "S">
-<!ENTITY     removeSelected.label          "Remove Selected">
-<!ENTITY     removeSelected.accesskey      "r">
-<!ENTITY     save.label                    "Save Changes">
-<!ENTITY     save.accesskey                "a">
-<!ENTITY     cancel.label                  "Cancel">
-<!ENTITY     cancel.accesskey              "C">
-<!ENTITY     removingDialog1.title         "Removing Cookies and Site Data">
-<!ENTITY     removingSelected1.description "Removing cookies and site data may log you out of websites. Are you sure you want to make the changes?">
-<!ENTITY     siteTree3.label               "Cookies and site data for the following websites will be removed">
--- 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/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)
 #else
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1451992_preferences_sitedata.py
@@ -0,0 +1,187 @@
+# 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::Site Data to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        'browser/browser/preferences/siteDataSettings.ftl',
+        'browser/browser/preferences/siteDataSettings.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('site-data-settings-window'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('title'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'window2.title'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-search-textbox'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('placeholder'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'searchTextboxPlaceHolder'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'searchTextboxPlaceHolder.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-column-host'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'hostCol.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-column-cookies'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'cookiesCol.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-column-storage'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'usageCol.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-column-last-used'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'lastAccessedCol.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-remove-selected'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'removeSelected.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'removeSelected.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-button-cancel'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'cancel.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'cancel.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-button-save'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'save.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                            'save.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-removing-window'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('title'),
+                        CONCAT(
+                            MESSAGE_REFERENCE('site-data-removing-header'),
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-removing-header'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                    'removingDialog1.title'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-removing-desc'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                    'removingSelected1.description'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('site-data-removing-table'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/siteDataSettings.dtd',
+                    'siteTree3.label'
+                )
+            )
+        ]
+    )