Bug 1609562 - Migrate popup-notifications.inc to Fluent. r=fluent-reviewers,Gijs,flod
authorJulian <shomalij@msu.edu>
Fri, 17 Apr 2020 20:13:27 +0000
changeset 524667 9c465ec21df9f822ba5f51c72e4029697f6e150b
parent 524666 76e6b2d37fe41792eac5a988656ea17307c15bee
child 524668 fc49269ac8a65d98fd6e6cf288d1e16d8c3727b7
push id113329
push usergijskruitbosch@gmail.com
push dateFri, 17 Apr 2020 20:25:18 +0000
treeherderautoland@9c465ec21df9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfluent-reviewers, Gijs, flod
bugs1609562
milestone77.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 1609562 - Migrate popup-notifications.inc to Fluent. r=fluent-reviewers,Gijs,flod Differential Revision: https://phabricator.services.mozilla.com/D69754
browser/base/content/popup-notifications.inc
browser/locales/en-US/browser/browser.ftl
browser/locales/en-US/chrome/browser/browser.dtd
python/l10n/fluent_migrations/bug_1609562_popup_notifications.py
--- a/browser/base/content/popup-notifications.inc
+++ b/browser/base/content/popup-notifications.inc
@@ -5,45 +5,43 @@
            position="after_start"
            hidden="true"
            orient="vertical"
            noautofocus="true"
            role="alert"/>
 
     <popupnotification id="webRTC-shareDevices-notification" hidden="true">
       <popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
-        <label value="&getUserMedia.selectCamera.label;"
-               accesskey="&getUserMedia.selectCamera.accesskey;"
+        <label data-l10n-id="popup-select-camera"
                control="webRTC-selectCamera-menulist"/>
         <menulist id="webRTC-selectCamera-menulist">
           <menupopup id="webRTC-selectCamera-menupopup"/>
         </menulist>
       </popupnotificationcontent>
 
       <popupnotificationcontent id="webRTC-selectWindowOrScreen" orient="vertical">
         <label id="webRTC-selectWindow-label"
                control="webRTC-selectWindow-menulist"/>
         <menulist id="webRTC-selectWindow-menulist"
                   oncommand="webrtcUI.updateWarningLabel(this);">
           <menupopup id="webRTC-selectWindow-menupopup"/>
         </menulist>
-        <description id="webRTC-all-windows-shared" hidden="true">&getUserMedia.allWindowsShared.message;</description>
+        <description id="webRTC-all-windows-shared" hidden="true" data-l10n-id="popup-all-windows-shared"></description>
       </popupnotificationcontent>
 
       <popupnotificationcontent id="webRTC-preview" hidden="true">
         <html:video id="webRTC-previewVideo"/>
         <vbox id="webRTC-previewWarningBox">
           <spacer flex="1"/>
           <description id="webRTC-previewWarning"/>
         </vbox>
       </popupnotificationcontent>
 
       <popupnotificationcontent id="webRTC-selectMicrophone" orient="vertical">
-        <label value="&getUserMedia.selectMicrophone.label;"
-               accesskey="&getUserMedia.selectMicrophone.accesskey;"
+        <label data-l10n-id="popup-select-microphone"
                control="webRTC-selectMicrophone-menulist"/>
         <menulist id="webRTC-selectMicrophone-menulist">
           <menupopup id="webRTC-selectMicrophone-menupopup"/>
         </menulist>
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="servicesInstall-notification" hidden="true">
@@ -55,17 +53,16 @@
     <popupnotification id="password-notification" hidden="true">
       <popupnotificationcontent orient="vertical">
         <html:input id="password-notification-username"/>
         <html:input id="password-notification-password" type="password"/>
         <checkbox id="password-notification-visibilityToggle" hidden="true"/>
       </popupnotificationcontent>
     </popupnotification>
 
-
     <popupnotification id="addon-progress-notification" is="addon-progress-notification" hidden="true">
       <popupnotificationcontent orient="vertical">
         <html:progress id="addon-progress-notification-progressmeter" max="100"/>
         <label id="addon-progress-notification-progresstext" crop="end"/>
       </popupnotificationcontent>
     </popupnotification>
 
     <popupnotification id="addon-install-confirmation-notification" hidden="true">
--- a/browser/locales/en-US/browser/browser.ftl
+++ b/browser/locales/en-US/browser/browser.ftl
@@ -213,8 +213,18 @@ identity-more-info-link-text =
 browser-window-minimize-button =
   .tooltiptext = Minimize
 browser-window-maximize-button =
   .tooltiptext = Maximize
 browser-window-restore-button =
   .tooltiptext = Restore
 browser-window-close-button =
   .tooltiptext = Close
+
+## WebRTC Pop-up notifications
+
+popup-select-camera =
+.value = Camera to share:
+.accesskey = C
+popup-select-microphone =
+.value = Microphone to share:
+.accesskey = M
+popup-all-windows-shared = All visible windows on your screen will be shared.
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -336,22 +336,16 @@ this container is a toolbar. This avoids
 <!-- Name for the tabs toolbar as spoken by screen readers.
      The word "toolbar" is appended automatically and should not be contained below! -->
 <!ENTITY tabsToolbar.label "Browser tabs">
 
 <!ENTITY syncBrand.shortName.label    "Sync">
 
 <!ENTITY customizeMode.autoHideDownloadsButton.label "Auto-hide">
 
-<!ENTITY getUserMedia.selectCamera.label "Camera to share:">
-<!ENTITY getUserMedia.selectCamera.accesskey "C">
-<!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
-<!ENTITY getUserMedia.selectMicrophone.accesskey "M">
-<!ENTITY getUserMedia.allWindowsShared.message "All visible windows on your screen will be shared.">
-
 <!ENTITY contentBlocking.trackingProtection4.label "Tracking Content">
 
 <!ENTITY contentBlocking.manageSettings2.label "Manage Protection Settings">
 <!ENTITY contentBlocking.manageSettings2.accesskey "M">
 
 <!ENTITY contentBlocking.socialblock.label "Social Media Trackers">
 
 <!ENTITY contentBlocking.cryptominers.label "Cryptominers">
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1609562_popup_notifications.py
@@ -0,0 +1,27 @@
+# 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, TERM_REFERENCE, MESSAGE_REFERENCE
+from fluent.migrate import COPY_PATTERN, REPLACE, COPY
+
+def migrate(ctx):
+    """Bug 1609562 - Migrate popup-notifications.inc to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        'browser/browser/browser.ftl',
+        'browser/browser/browser.ftl',
+        transforms_from(
+"""
+popup-select-camera =
+    .value = { COPY(from_path, "getUserMedia.selectCamera.label") }
+    .accesskey = { COPY(from_path, "getUserMedia.selectCamera.accesskey") }
+popup-select-microphone =
+    .value = { COPY(from_path, "getUserMedia.selectMicrophone.label") }
+    .accesskey = { COPY(from_path, "getUserMedia.selectMicrophone.accesskey") }
+popup-all-windows-shared = { COPY(from_path, "getUserMedia.allWindowsShared.message") }
+""", from_path="browser/chrome/browser/browser.dtd")
+    )