Bug 1488788 - Migrate about:restartrequired from DTD to Fluent. r=gijs,jaws,flod
authorRaza Haider <haiders2@msu.edu>
Mon, 24 Sep 2018 18:59:55 +0100
changeset 439357 6ed1e83038877539749f73b32c83ec887ae36681
parent 439356 a1855d696e1ca886a4ed8f3668bc6830a8d1ccd6
child 439358 903c7caf3a0543db8398171045af0d5a362a4ced
push id108561
push usergijskruitbosch@gmail.com
push dateWed, 03 Oct 2018 10:44:11 +0000
treeherdermozilla-inbound@6ed1e8303887 [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>
+          <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") }
+""")
+        )
+