Bug 1453800 - Move the container removal dialog strings to preferences.ftl. r=flod
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 12 Apr 2018 14:17:28 -0700
changeset 466895 ffcb6aa7e8717e58ee14e13eb370e2f902c9d03c
parent 466894 5067d8ae88c30bd7ba80f47e81f7f4d5240a3bbf
child 466914 008f977fc4ac4fc09b98580ff4355b03c14f1e19
child 466917 0c7db264c68e1f3074462cc17c488047a16f85c4
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflod
bugs1453800
milestone61.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 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',
+                ),
+            ),
+        ]
+    )