Bug 1488788 - Migrate about:restartrequired from DTD to Fluent. r=gijs,jaws,flod
☠☠ backed out by b295ff1a58a9 ☠ ☠
authorraza <haiders2@msu.edu>
Mon, 24 Sep 2018 18:59:55 +0100
changeset 437925 eade7b3002168c6d346aae3ce561aff9d2857968
parent 437924 2b3bd3d1a83f1363e704b8327b4c99491e1b5f85
child 437926 68e27d43311b158a4e44bd4a1eafc0a81bf6e77f
push id108194
push usergijskruitbosch@gmail.com
push dateMon, 24 Sep 2018 18:19:13 +0000
treeherdermozilla-inbound@eade7b300216 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, jaws, flod
bugs1488788
milestone64.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 1488788 - Migrate about:restartrequired from DTD to Fluent. r=gijs,jaws,flod Differential Revision: https://phabricator.services.mozilla.com/D5495
browser/base/content/aboutRestartRequired.xhtml
browser/locales/en-US/browser/aboutRestartRequired.ftl
browser/locales/en-US/chrome/browser/aboutRestartRequired.dtd
browser/locales/jar.mn
python/l10n/fluent_migrations/bug_1488788_aboutrestartrequired.py
--- a/browser/base/content/aboutRestartRequired.xhtml
+++ b/browser/base/content/aboutRestartRequired.xhtml
@@ -1,56 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
+<?xml version="1.0" encoding="UTF-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/. -->
-
-<!DOCTYPE html [
-  <!ENTITY % htmlDTD
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "DTD/xhtml1-strict.dtd">
-  %htmlDTD;
-  <!ENTITY % globalDTD
-    SYSTEM "chrome://global/locale/global.dtd">
-  %globalDTD;
-  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-  %brandDTD;
-  <!ENTITY % restartRequiredDTD
-    SYSTEM "chrome://browser/locale/aboutRestartRequired.dtd">
-  %restartRequiredDTD;
-]>
+<!DOCTYPE html>
 
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
-    <title>&restartRequired.title;</title>
+    <title data-l10n-id="restart-required-title"></title>
     <link rel="stylesheet" type="text/css" media="all"
           href="chrome://browser/skin/aboutRestartRequired.css"/>
     <!-- If the location of the favicon is changed here, the
          FAVICON_ERRORPAGE_URL symbol in
          toolkit/components/places/src/nsFaviconService.h should be updated. -->
-    <link rel="icon" id="favicon"
+    <link rel="icon" type="image/png" id="favicon"
           href="chrome://global/skin/icons/warning.svg"/>
+    <link rel="localization" href="branding/brand.ftl"/>
+    <link rel="localization" href="browser/aboutRestartRequired.ftl"/>
   </head>
-
-  <body dir="&locale.dir;">
+  <body>
     <!-- PAGE CONTAINER (for styling purposes only) -->
     <div id="errorPageContainer">
       <div id="text-container">
-        <div id="title">
-          <h1 id="title-text">&restartRequired.header;</h1>
+        <div>
+          <h1 id="title-text" data-l10n-id="restart-required-header"></h1>
         </div>
         <div id="errorLongContent">
-          <div id="errorLongDesc">&restartRequired.description;</div>
+          <div id="errorLongDesc">
+            <p data-l10n-id="restart-required-intro"></p>
+            <p data-l10n-id="restart-required-description"></p>
+          </div>
         </div>
       </div>
       <!-- Restart Button -->
       <div id="restartButtonContainer" class="button-container">
-        <button id="restart" class="primary" autocomplete="off"
-                onclick="AboutRestartRequired.restart();">
-          &restartButton.label;
-        </button>
+        <button id="restart" data-l10n-id="restart-button-label" class="primary" autocomplete="off"
+                onclick="AboutRestartRequired.restart();"></button>
       </div>
     </div>
   </body>
   <script type="text/javascript"
-           src="chrome://browser/content/aboutRestartRequired.js"/>
+          src="chrome://browser/content/aboutRestartRequired.js"/>
 </html>
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/aboutRestartRequired.ftl
@@ -0,0 +1,11 @@
+# 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/.
+
+restart-required-title = Restart Required
+restart-required-header = Sorry. We just need to do one small thing to keep going.
+restart-required-intro = We have just installed an update in the background. Click Restart { -brand-short-name } to finish
+    applying it.
+restart-required-description = We will restore all your pages, windows and tabs afterwards, so you can be on your way quickly.
+
+restart-button-label = Restart { -brand-short-name }
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/aboutRestartRequired.dtd
+++ /dev/null
@@ -1,13 +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 restartRequired.title "Restart Required">
-
-<!ENTITY restartRequired.header "Sorry. We just need to do one small thing to keep going.">
-<!ENTITY restartRequired.description "
-<p>We have just installed an update in the background. Click Restart &brandShortName; to finish applying it.</p>
-<p>We will restore all your pages, windows and tabs afterwards, so you can be on your way quickly.</p>
-">
-
-<!ENTITY restartButton.label "Restart &brandShortName;">
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -13,17 +13,16 @@
 @AB_CD@.jar:
 % locale browser @AB_CD@ %locale/browser/
 # bookmarks.html is produced by LOCALIZED_GENERATED_FILES.
     locale/browser/bookmarks.html                  (bookmarks.html)
     locale/browser/aboutDialog.dtd                 (%chrome/browser/aboutDialog.dtd)
     locale/browser/aboutPrivateBrowsing.dtd        (%chrome/browser/aboutPrivateBrowsing.dtd)
     locale/browser/aboutRobots.dtd                 (%chrome/browser/aboutRobots.dtd)
     locale/browser/accounts.properties             (%chrome/browser/accounts.properties)
-    locale/browser/aboutRestartRequired.dtd        (%chrome/browser/aboutRestartRequired.dtd)
     locale/browser/aboutSearchReset.dtd            (%chrome/browser/aboutSearchReset.dtd)
     locale/browser/aboutSessionRestore.dtd         (%chrome/browser/aboutSessionRestore.dtd)
     locale/browser/aboutTabCrashed.dtd             (%chrome/browser/aboutTabCrashed.dtd)
     locale/browser/browser.dtd                     (%chrome/browser/browser.dtd)
     locale/browser/baseMenuOverlay.dtd             (%chrome/browser/baseMenuOverlay.dtd)
     locale/browser/browser.properties              (%chrome/browser/browser.properties)
     locale/browser/customizableui/customizableWidgets.properties (%chrome/browser/customizableui/customizableWidgets.properties)
     locale/browser/lightweightThemes.properties    (%chrome/browser/lightweightThemes.properties)
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1488788_aboutrestartrequired.py
@@ -0,0 +1,25 @@
+# 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
+from fluent.migrate.helpers import TERM_REFERENCE
+from fluent.migrate import REPLACE
+
+def migrate(ctx):
+    """Bug 1488788- Migrate about:restartrequired from DTD to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        "browser/browser/aboutRestartRequired.ftl",
+        "browser/browser/aboutRestartRequired.ftl",
+        transforms_from(
+"""
+restart-required-title = { COPY("browser/chrome/browser/aboutRestartRequired.dtd", "restartRequired.title") }
+
+restart-required-header = { COPY("browser/chrome/browser/aboutRestartRequired.dtd", "restartRequired.header") }
+""")
+        )
+