Bug 1488788 - Migrate about:restartrequired from DTD to Fluent. r=gijs,jaws,flod

Differential Revision: https://phabricator.services.mozilla.com/D5495

--HG--
extra : rebase_source : 45231ec585fa3157e3c8f491c96acd527531c201
This commit is contained in:
raza 2018-09-24 18:59:55 +01:00
Родитель 08a1d10fb1
Коммит 95c3928939
5 изменённых файлов: 52 добавлений и 43 удалений

Просмотреть файл

@ -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>

Просмотреть файл

@ -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 }

Просмотреть файл

@ -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;">

Просмотреть файл

@ -18,7 +18,6 @@
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)

Просмотреть файл

@ -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") }
""")
)