Bug 1588142 - Move Fluent about:preferences title attribute to a title tag r=fluent-reviewers,Gijs
☠☠ backed out by b42b42456573 ☠ ☠
authorKirk Steuber <ksteuber@mozilla.com>
Tue, 12 Nov 2019 18:00:05 +0000
changeset 501808 1a5f2b044f827e6063218f6f6ff6a6b7e6066106
parent 501807 87336cc7f8a1afe7dbd042fd23de5ae3010b0845
child 501809 939b6b3922c2802abedb336712b08e605687e716
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfluent-reviewers, Gijs
bugs1588142
milestone72.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 1588142 - Move Fluent about:preferences title attribute to a title tag r=fluent-reviewers,Gijs Differential Revision: https://phabricator.services.mozilla.com/D51713
browser/components/preferences/in-content/preferences.xul
browser/locales/en-US/browser/preferences/preferences.ftl
python/l10n/fluent_migrations/bug_1588142_about_preferences_title.py
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -15,27 +15,27 @@
 <?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 html>
 
 <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:html="http://www.w3.org/1999/xhtml"
-        role="document"
-        data-l10n-id="pref-page"
-        data-l10n-attrs="title">
+        role="document">
 
 <head>
   <!-- @CSP: The 'oncommand' handler for 'focusSearch1' can not easily be rewritten (see Bug 371900)
        hence we are allowing the inline handler in the script-src directive using the hash
        sha512-X8+p/CqXeMdssOoFOf5RV+RpkvnN9pukQ20acGc7LqMgfYLW+lR0WAYT66OtSTpFHE/Qgx/ZCBs2RMc4QrA8FQ==
        Additionally we should remove 'unsafe-inline' from style-src, see Bug 1579160 -->
   <meta http-equiv="Content-Security-Policy" content="default-src chrome:; script-src chrome: 'sha512-X8+p/CqXeMdssOoFOf5RV+RpkvnN9pukQ20acGc7LqMgfYLW+lR0WAYT66OtSTpFHE/Qgx/ZCBs2RMc4QrA8FQ=='; img-src chrome: moz-icon: https: data:; style-src chrome: data: 'unsafe-inline'; object-src 'none'" />
 
+  <title data-l10n-id="pref-page-title"></title>
+
   <link rel="localization" href="branding/brand.ftl"/>
   <link rel="localization" href="browser/branding/brandings.ftl"/>
   <link rel="localization" href="browser/branding/sync-brand.ftl"/>
   <link rel="localization" href="browser/preferences/preferences.ftl"/>
   <!-- Used by fontbuilder.js -->
   <link rel="localization" href="browser/preferences/fonts.ftl"/>
 
   <!-- Links below are only used for search-l10n-ids into subdialogs -->
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -4,22 +4,21 @@
 
 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-content-blocking-known =
     .label = Only when { -brand-short-name } is set to block known trackers
 do-not-track-option-always =
     .label = Always
 
-pref-page =
-    .title =
-        { PLATFORM() ->
-            [windows] Options
-           *[other] Preferences
-        }
+pref-page-title =
+    { PLATFORM() ->
+        [windows] Options
+       *[other] Preferences
+    }
 
 # This is used to determine the width of the search field in about:preferences,
 # in order to make the entire placeholder string visible
 #
 # Please keep the placeholder string short to avoid truncation.
 #
 # Notice: The value of the `.style` attribute is a CSS string, and the `width`
 # is the name of the CSS property. It is intended only to adjust the element's width.
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1588142_about_preferences_title.py
@@ -0,0 +1,19 @@
+# coding=utf8
+
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+from __future__ import absolute_import
+from fluent.migrate import COPY_PATTERN
+from fluent.migrate.helpers import transforms_from
+
+def migrate(ctx):
+    """Bug 1588142 - about:preferences - migrate the root xul:window element to an html:html element, part {index}."""
+
+    ctx.add_transforms(
+        "browser/browser/preferences/preferences.ftl",
+        "browser/browser/preferences/preferences.ftl",
+        transforms_from(
+"""
+pref-page-title = {COPY_PATTERN(from_file, "pref-page.title")}
+""", from_file="browser/browser/preferences/preferences.ftl"))