Bug 1411012 - Migrate a small chunk of Privacy pane in Preferences to Fluent. r?pike,mshal draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 09 Nov 2017 12:11:32 -0800
changeset 714371 77a950e3b83395a335f55ee48712c211fc563272
parent 714251 f844e99f26b1f1537c7209a020b464ac7da2574f
child 744565 faf6b49e6cb69e018556cae83654f3d652f4b011
push id93895
push userbmo:gandalf@aviary.pl
push dateFri, 22 Dec 2017 10:28:44 +0000
reviewerspike, mshal
bugs1411012
milestone59.0a1
Bug 1411012 - Migrate a small chunk of Privacy pane in Preferences to Fluent. r?pike,mshal MozReview-Commit-ID: ahAZCinoui
browser/components/preferences/in-content/main.xul
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/in-content/privacy.xul
browser/locales/en-US/browser/preferences/preferences.ftl
browser/locales/en-US/chrome/browser/preferences/privacy.dtd
build/virtualenv_packages.txt
python/l10n/fluent_migrations/__init__.py
python/l10n/fluent_migrations/bug_1411012_preferences_do_not_track.py
python/moz.build
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -1,17 +1,14 @@
 # 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/.
 
 <!-- General panel -->
 
-<link rel="localization" href="browser/preferences/main.ftl"/>
-<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
-
 <script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/main.js"/>
 
 #ifdef MOZ_UPDATER
   <script type="application/javascript" src="chrome://browser/content/aboutDialog-appUpdater.js"/>
 #endif
 
 <script type="application/javascript"
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -90,16 +90,20 @@
       xmlns:html="http://www.w3.org/1999/xhtml"
       disablefastfind="true"
 #ifdef USE_WIN_TITLE_STYLE
       title="&prefWindow.titleWin;">
 #else
       title="&prefWindow.title;">
 #endif
 
+  <link rel="localization" href="browser/preferences/main.ftl"/>
+  <link rel="localization" href="browser/preferences/preferences.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"/>
   <script type="application/javascript"
           src="chrome://browser/content/preferences/in-content/preferences.js"/>
   <script src="chrome://browser/content/preferences/in-content/findInPage.js"/>
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -539,22 +539,22 @@
                   label="&changeBlockList2.label;"
                   accesskey="&changeBlockList2.accesskey;"
                   preference="pref.privacy.disable_button.change_blocklist"
                   searchkeywords="&button.cancel.label; &button.ok.label;"/>
         </hbox>
       </vbox>
     </hbox>
     <vbox id="doNotTrackLearnMoreBox">
-      <label><label class="tail-with-learn-more">&doNotTrack.description;</label><label
+      <label><label class="tail-with-learn-more" data-l10n-id="do-not-track-description"></label><label
       class="learnMore text-link" href="https://www.mozilla.org/dnt"
-      >&doNotTrack.learnMore.label;</label></label>
+      data-l10n-id="do-not-track-learn-more"></label></label>
       <radiogroup id="doNotTrackRadioGroup" aria-labelledby="doNotTrackDesc" preference="privacy.donottrackheader.enabled">
-        <radio value="false" label="&doNotTrack.default.label;"/>
-        <radio value="true" label="&doNotTrack.always.label;"/>
+        <radio value="false" data-l10n-id="do-not-track-option-default"/>
+        <radio value="true" data-l10n-id="do-not-track-option-always"/>
       </radiogroup>
     </vbox>
   </vbox>
 </groupbox>
 
 <hbox id="permissionsCategory"
       class="subcategory"
       hidden="true"
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -0,0 +1,10 @@
+// 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/.
+
+do-not-track-description = Send websites a “Do Not Track” signal that you don’t want to be tracked
+do-not-track-learn-more = Learn more
+do-not-track-option-default
+    .label = Only when using Tracking Protection
+do-not-track-option-always
+    .label = Always
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -17,21 +17,16 @@
 
 <!-- LOCALIZATION NOTE (trackingProtectionPBM6.label): This string is displayed if privacy.trackingprotection.ui.enabled is set to false. This currently happens on the release and beta channel. -->
 <!ENTITY trackingProtectionPBM6.label         "Use Tracking Protection in Private Browsing to block known trackers">
 <!ENTITY trackingProtectionPBM6.accesskey     "v">
 <!ENTITY trackingProtectionPBMLearnMore.label "Learn more">
 <!ENTITY changeBlockList2.label               "Change Block List…">
 <!ENTITY changeBlockList2.accesskey           "C">
 
-<!ENTITY  doNotTrack.description        "Send websites a “Do Not Track” signal that you don’t want to be tracked">
-<!ENTITY  doNotTrack.learnMore.label    "Learn more">
-<!ENTITY  doNotTrack.default.label      "Only when using Tracking Protection">
-<!ENTITY  doNotTrack.always.label       "Always">
-
 <!ENTITY  history.label                 "History">
 <!ENTITY  permissions.label             "Permissions">
 
 <!ENTITY  addressBar.label              "Address Bar">
 <!ENTITY  addressBar.suggest.label      "When using the address bar, suggest">
 <!ENTITY  locbar.history2.label         "Browsing history">
 <!ENTITY  locbar.history2.accesskey     "H">
 <!ENTITY  locbar.bookmarks.label        "Bookmarks">
@@ -109,9 +104,9 @@
 <!ENTITY  browserContainersEnabled.label        "Enable Container Tabs">
 <!ENTITY  browserContainersEnabled.accesskey    "n">
 <!ENTITY  browserContainersSettings.label        "Settings…">
 <!ENTITY  browserContainersSettings.accesskey    "i">
 
 <!ENTITY  a11yPrivacy.checkbox.label     "Prevent accessibility services from accessing your browser">
 <!ENTITY  a11yPrivacy.checkbox.accesskey "a">
 <!ENTITY  a11yPrivacy.learnmore.label    "Learn more">
-<!ENTITY enableSafeBrowsingLearnMore.label "Learn more">
\ No newline at end of file
+<!ENTITY enableSafeBrowsingLearnMore.label "Learn more">
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -1,14 +1,15 @@
 mozilla.pth:python/mach
 mozilla.pth:python/mozboot
 mozilla.pth:python/mozbuild
 mozilla.pth:python/mozlint
 mozilla.pth:python/mozterm
 mozilla.pth:python/mozversioncontrol
+mozilla.pth:python/l10n
 mozilla.pth:third_party/python/blessings
 mozilla.pth:third_party/python/compare-locales
 mozilla.pth:third_party/python/configobj
 mozilla.pth:third_party/python/cram
 mozilla.pth:third_party/python/dlmanager
 mozilla.pth:third_party/python/fluent
 mozilla.pth:third_party/python/futures
 mozilla.pth:third_party/python/hglib
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1411012_preferences_do_not_track.py
@@ -0,0 +1,57 @@
+# 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 import COPY
+
+
+def migrate(ctx):
+    """Bug 1411012 - Migrate Do Not Track preferences to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        'browser/browser/preferences/preferences.ftl',
+        'browser/locales/en-US/browser/preferences/preferences.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('do-not-track-description'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/privacy.dtd',
+                    'doNotTrack.description'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('do-not-track-learn-more'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/privacy.dtd',
+                    'doNotTrack.learnMore.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('do-not-track-option-default'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/privacy.dtd',
+                            'doNotTrack.default.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('do-not-track-option-always'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/privacy.dtd',
+                            'doNotTrack.always.label'
+                        )
+                    )
+                ]
+            ),
+        ]
+    )
--- a/python/moz.build
+++ b/python/moz.build
@@ -21,16 +21,19 @@ with Files('mozbuild/**'):
     BUG_COMPONENT = ('Core', 'Build Config')
 
 with Files('mozlint/**'):
     BUG_COMPONENT = ('Testing', 'Lint')
 
 with Files('mozversioncontrol/**'):
     BUG_COMPONENT = ('Core', 'Build Config')
 
+with Files('l10n/**'):
+    BUG_COMPONENT = ('Core', 'Localization')
+
 SPHINX_PYTHON_PACKAGE_DIRS += [
     'mach',
     'mozbuild/mozbuild',
     'mozbuild/mozpack',
     'mozlint/mozlint',
     'mozversioncontrol/mozversioncontrol',
 ]