Commit 28bccea7 authored by Eemeli Aro's avatar Eemeli Aro
Browse files

Bug 1771752 - Migrate notification alert DTD strings to Fluent. r=fluent-reviewers,flod,jaws

The alert.properties file is not migrated here, as its contents are
also used by OS-specific alert notifications:
- widget/cocoa/OSXNotificationCenter.mm
- widget/windows/ToastNotificationHandler.cpp

Differential Revision: https://phabricator.services.mozilla.com/D154380
parent 41a2bac0
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
# 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 COPY


def migrate(ctx):
    """Bug 1771752 - Migrate notification alert from DTD to FTL, part {index}"""

    ctx.add_transforms(
        "toolkit/toolkit/global/alert.ftl",
        "toolkit/toolkit/global/alert.ftl",
        transforms_from(
            """

alert-close =
    .tooltiptext = { COPY(path1, "closeAlert.tooltip") }
alert-settings-title =
    .tooltiptext = { COPY(path1, "settings.label") }
""",
            path1="toolkit/chrome/alerts/alert.dtd",
        ),
    )
+7 −6
Original line number Diff line number Diff line
@@ -3,10 +3,7 @@
   - 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 window [
<!ENTITY % alertDTD SYSTEM "chrome://alerts/locale/alert.dtd">
%alertDTD;
]>
<!DOCTYPE window>

<?xml-stylesheet href="chrome://global/content/alerts/alert.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/alert.css" type="text/css"?>
@@ -21,6 +18,10 @@
        onclick="onAlertClick();"
        onbeforeunload="onAlertBeforeUnload();">

  <linkset>
    <xhtml:link rel="localization" href="toolkit/global/alert.ftl"/>
  </linkset>

  <script src="chrome://global/content/alerts/alert.js"/>

  <vbox id="alertBox">
@@ -29,7 +30,7 @@
      <label id="alertTitleLabel" class="alertTitle plain" crop="end"/>
      <vbox>
        <toolbarbutton class="close-icon"
                       tooltiptext="&closeAlert.tooltip;"
                       data-l10n-id="alert-close"
                       onclick="event.stopPropagation();"
                       oncommand="onAlertClose();"/>
      </vbox>
@@ -44,7 +45,7 @@
        <spacer flex="1"/>
        <box id="alertFooter">
          <label id="alertSourceLabel" class="alertSource plain"/>
          <button type="menu" id="alertSettings" tooltiptext="&settings.label;">
          <button type="menu" id="alertSettings" data-l10n-id="alert-settings-title">
            <menupopup position="after_end">
              <menuitem id="doNotDisturbMenuItem"
                        oncommand="doNotDisturb();"/>
+0 −6
Original line number Diff line number Diff line
<!-- 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     closeAlert.tooltip          "Close this notification">
<!ENTITY     settings.label              "Settings">
+8 −0
Original line number Diff line number Diff line
# 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/.

alert-close =
    .tooltiptext = Close this notification
alert-settings-title =
    .tooltiptext = Settings
+0 −1
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@
  locale/@AB_CD@/mozapps/update/updates.properties                (%chrome/mozapps/update/updates.properties)
#endif
% locale alerts @AB_CD@ %locale/@AB_CD@/alerts/
  locale/@AB_CD@/alerts/alert.dtd                                (%chrome/alerts/alert.dtd)
  locale/@AB_CD@/alerts/alert.properties                         (%chrome/alerts/alert.properties)
% locale passwordmgr @AB_CD@ %locale/@AB_CD@/passwordmgr/
  locale/@AB_CD@/passwordmgr/passwordmgr.properties (%chrome/passwordmgr/passwordmgr.properties)