Bug 1453800 - Move the container removal dialog strings to preferences.ftl. r?flod draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 12 Apr 2018 14:17:28 -0700
changeset 782213 b1541646213ade7cd8fcf1d4bf30e0b3ca901e98
parent 782003 6547c27303bc4d8961b11e656751e839807d65c7
push id106500
push userbmo:gandalf@aviary.pl
push dateSat, 14 Apr 2018 21:19:19 +0000
reviewersflod
bugs1453800
milestone61.0a1
Bug 1453800 - Move the container removal dialog strings to preferences.ftl. r?flod MozReview-Commit-ID: JAAfviRvbJb
browser/components/preferences/in-content/preferences.xul
browser/locales/en-US/browser/preferences/containers.ftl
browser/locales/en-US/browser/preferences/preferences.ftl
python/l10n/fluent_migrations/bug_1453800_container_removal.py
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -51,17 +51,16 @@
       xmlns:html="http://www.w3.org/1999/xhtml"
       disablefastfind="true"
       data-l10n-id="pref-page"
       data-l10n-attrs="title">
 
   <link rel="localization" href="branding/brand.ftl"/>
   <link rel="localization" href="browser/branding/sync-brand.ftl"/>
   <link rel="localization" href="browser/preferences/preferences.ftl"/>
-  <link rel="localization" href="browser/preferences/containers.ftl"/>
 
   <!-- Links below are only used for search-l10n-ids into subdialogs -->
   <link rel="localization" href="browser/preferences/blocklists.ftl"/>
   <link rel="localization" href="browser/preferences/clearSiteData.ftl"/>
   <link rel="localization" href="browser/preferences/colors.ftl"/>
   <link rel="localization" href="browser/preferences/connection.ftl"/>
   <link rel="localization" href="browser/preferences/fonts.ftl"/>
   <link rel="localization" href="browser/preferences/languages.ftl"/>
--- a/browser/locales/en-US/browser/preferences/containers.ftl
+++ b/browser/locales/en-US/browser/preferences/containers.ftl
@@ -39,29 +39,16 @@ containers-icon-label = Icon
 containers-color-label = Color
     .accesskey = o
     .style = { -containers-labels-style }
 
 containers-button-done =
     .label = Done
     .accesskey = D
 
-containers-remove-alert-title = Remove This Container?
-
-# Variables:
-#   $count (Number) - Number of tabs that will be closed.
-containers-remove-alert-msg =
-    { $count ->
-       *[one] If you remove this Container now, { $count } container tab will be closed. Are you sure you want to remove this Container?
-        [other] If you remove this Container now, { $count } container tabs will be closed. Are you sure you want to remove this Container?
-    }
-
-containers-remove-ok-button = Remove this Container
-containers-remove-cancel-button = Don’t remove this Container
-
 containers-color-blue =
     .label = Blue
 containers-color-turquoise =
     .label = Turquoise
 containers-color-green =
     .label = Green
 containers-color-yellow =
     .label = Yellow
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -170,16 +170,30 @@ containers-disable-alert-desc =
 
 containers-disable-alert-ok-button =
     { $tabCount ->
         [one] Close { $tabCount } Container Tab
        *[other] Close { $tabCount } Container Tabs
     }
 containers-disable-alert-cancel-button = Keep enabled
 
+containers-remove-alert-title = Remove This Container?
+
+# Variables:
+#   $count (Number) - Number of tabs that will be closed.
+containers-remove-alert-msg =
+    { $count ->
+        [one] If you remove this Container now, { $count } container tab will be closed. Are you sure you want to remove this Container?
+       *[other] If you remove this Container now, { $count } container tabs will be closed. Are you sure you want to remove this Container?
+    }
+
+containers-remove-ok-button = Remove this Container
+containers-remove-cancel-button = Don’t remove this Container
+
+
 ## General Section - Language & Appearance
 
 language-and-appearance-header = Language and Appearance
 
 fonts-and-colors-header = Fonts & Colors
 
 default-font = Default font
     .accesskey = D
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1453800_container_removal.py
@@ -0,0 +1,56 @@
+# 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 EXTERNAL_ARGUMENT
+from fluent.migrate import COPY
+from fluent.migrate.transforms import PLURALS, REPLACE_IN_TEXT
+
+
+def migrate(ctx):
+    """Bug 1453800 - Migrate Container removal strings to Fluent, part {index}."""
+
+    ctx.add_transforms(
+        'browser/browser/preferences/preferences.ftl',
+        'browser/browser/preferences/preferences.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('containers-remove-alert-title'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/preferences.properties',
+                    'removeContainerAlertTitle',
+                ),
+            ),
+            FTL.Message(
+                id=FTL.Identifier('containers-remove-alert-msg'),
+                value=PLURALS(
+                    'browser/chrome/browser/preferences/preferences.properties',
+                    'removeContainerMsg',
+                    EXTERNAL_ARGUMENT('count'),
+                    lambda text: REPLACE_IN_TEXT(
+                        text,
+                        {
+                            '#S': EXTERNAL_ARGUMENT('count')
+                        }
+                    )
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('containers-remove-ok-button'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/preferences.properties',
+                    'removeContainerOkButton',
+                ),
+            ),
+            FTL.Message(
+                id=FTL.Identifier('containers-remove-cancel-button'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/preferences.properties',
+                    'removeContainerButton2',
+                ),
+            ),
+        ]
+    )