Bug 1415733 - Migrate the "Search" section of Preferences to the new Localization API. r?pike draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Wed, 08 Nov 2017 22:16:28 -0800
changeset 703521 454326e7eb3c6e2e9646da042313727fe95ff471
parent 703363 4ce67352b2a9744ac51f0333cea0455e3d59bbf3
child 741796 32a6d05304e319105d6a2b7c179085583c02317f
push id90843
push userbmo:gandalf@aviary.pl
push dateSun, 26 Nov 2017 20:26:59 +0000
reviewerspike
bugs1415733
milestone59.0a1
Bug 1415733 - Migrate the "Search" section of Preferences to the new Localization API. r?pike MozReview-Commit-ID: 96rEJkYbLSq
browser/branding/aurora/locales/en-US/brand.ftl
browser/branding/aurora/locales/jar.mn
browser/branding/nightly/locales/en-US/brand.ftl
browser/branding/nightly/locales/jar.mn
browser/branding/official/locales/en-US/brand.ftl
browser/branding/official/locales/jar.mn
browser/branding/unofficial/locales/en-US/brand.ftl
browser/branding/unofficial/locales/jar.mn
browser/components/preferences/in-content/main.xul
browser/components/preferences/in-content/preferences.xul
browser/components/preferences/in-content/search.js
browser/components/preferences/in-content/search.xul
browser/locales/en-US/browser/preferences/search.ftl
browser/locales/en-US/chrome/browser/engineManager.properties
browser/locales/en-US/chrome/browser/preferences/search.dtd
browser/locales/jar.mn
build/virtualenv_packages.txt
python/l10n/fluent_migrations/__init__.py
python/l10n/fluent_migrations/bug_1415733.py
new file mode 100644
--- /dev/null
+++ b/browser/branding/aurora/locales/en-US/brand.ftl
@@ -0,0 +1,1 @@
+brand-short-name = Firefox
--- a/browser/branding/aurora/locales/jar.mn
+++ b/browser/branding/aurora/locales/jar.mn
@@ -1,12 +1,14 @@
 #filter substitution
 # 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/.
 
+[localization] @AB_CD@.jar:
+  branding                                          (en-US/**/*.ftl)
 
 @AB_CD@.jar:
 % locale branding @AB_CD@ %locale/branding/
 # Aurora branding only exists in en-US
   locale/branding/brand.dtd        (en-US/brand.dtd)
   locale/branding/brand.properties (en-US/brand.properties)
   locale/branding/browserconfig.properties
new file mode 100644
--- /dev/null
+++ b/browser/branding/nightly/locales/en-US/brand.ftl
@@ -0,0 +1,1 @@
+brand-short-name = Nightly
--- a/browser/branding/nightly/locales/jar.mn
+++ b/browser/branding/nightly/locales/jar.mn
@@ -1,12 +1,14 @@
 #filter substitution
 # 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/.
 
+[localization] @AB_CD@.jar:
+  branding                                          (en-US/**/*.ftl)
 
 @AB_CD@.jar:
 % locale branding @AB_CD@ %locale/branding/
 # Nightly branding only exists in en-US
   locale/branding/brand.dtd        (en-US/brand.dtd)
   locale/branding/brand.properties (en-US/brand.properties)
   locale/branding/browserconfig.properties
new file mode 100644
--- /dev/null
+++ b/browser/branding/official/locales/en-US/brand.ftl
@@ -0,0 +1,1 @@
+brand-short-name = Firefox
--- a/browser/branding/official/locales/jar.mn
+++ b/browser/branding/official/locales/jar.mn
@@ -1,11 +1,13 @@
 #filter substitution
 # 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/.
 
+[localization] @AB_CD@.jar:
+  branding                                          (%*.ftl)
 
 @AB_CD@.jar:
 % locale branding @AB_CD@ %locale/branding/
   locale/branding/brand.dtd        (%brand.dtd)
   locale/branding/brand.properties (%brand.properties)
   locale/branding/browserconfig.properties
new file mode 100644
--- /dev/null
+++ b/browser/branding/unofficial/locales/en-US/brand.ftl
@@ -0,0 +1,1 @@
+brand-short-name = Nightly
--- a/browser/branding/unofficial/locales/jar.mn
+++ b/browser/branding/unofficial/locales/jar.mn
@@ -1,12 +1,14 @@
 #filter substitution
 # 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/.
 
+[localization] @AB_CD@.jar:
+  branding                                          (en-US/**/*.ftl)
 
 @AB_CD@.jar:
 % locale branding @AB_CD@ %locale/branding/
 # Unofficial branding only exists in en-US
   locale/branding/brand.dtd        (en-US/brand.dtd)
   locale/branding/brand.properties (en-US/brand.properties)
   locale/branding/browserconfig.properties
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -1,17 +1,14 @@
 # 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/.
 
 <!-- General panel -->
 
-<link rel="localization" href="browser/preferences/main.ftl"/>
-<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
-
 <script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/main.js"/>
 
 #ifdef MOZ_UPDATER
   <script type="application/javascript" src="chrome://browser/content/aboutDialog-appUpdater.js"/>
 #endif
 
 <script type="application/javascript"
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -31,17 +31,16 @@
 <!ENTITY % historyDTD SYSTEM "chrome://mozapps/locale/update/history.dtd">
 <!ENTITY % certManagerDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
 <!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
 <!ENTITY % connectionDTD SYSTEM "chrome://browser/locale/preferences/connection.dtd">
 <!ENTITY % siteDataSettingsDTD SYSTEM
   "chrome://browser/locale/preferences/siteDataSettings.dtd" >
 <!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
 <!ENTITY % tabsDTD SYSTEM "chrome://browser/locale/preferences/tabs.dtd">
-<!ENTITY % searchDTD SYSTEM "chrome://browser/locale/preferences/search.dtd">
 <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
 <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
 <!ENTITY % securityDTD SYSTEM
   "chrome://browser/locale/preferences/security.dtd">
 <!ENTITY % containersDTD SYSTEM
   "chrome://browser/locale/preferences/containers.dtd">
 <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
 <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
@@ -64,17 +63,16 @@
 %passwordManagerDTD;
 %historyDTD;
 %certManagerDTD;
 %deviceManangerDTD;
 %connectionDTD;
 %siteDataSettingsDTD;
 %privacyDTD;
 %tabsDTD;
-%searchDTD;
 %syncBrandDTD;
 %syncDTD;
 %securityDTD;
 %containersDTD;
 %sanitizeDTD;
 %mainDTD;
 %aboutHomeDTD;
 %contentDTD;
@@ -90,16 +88,21 @@
       xmlns:html="http://www.w3.org/1999/xhtml"
       disablefastfind="true"
 #ifdef USE_WIN_TITLE_STYLE
       title="&prefWindow.titleWin;">
 #else
       title="&prefWindow.title;">
 #endif
 
+  <link rel="localization" href="branding/brand.ftl"/>
+  <link rel="localization" href="browser/preferences/main.ftl"/>
+  <link rel="localization" href="browser/preferences/search.ftl"/>
+  <script type="text/javascript" src="chrome://global/content/l10n.js"></script>
+
   <html:link rel="shortcut icon"
               href="chrome://browser/skin/settings.svg"/>
 
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/preferences/in-content/preferences.js"/>
   <script src="chrome://browser/content/preferences/in-content/findInPage.js"/>
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -289,22 +289,26 @@ var gSearchPane = {
           eduplicate = true;
           dupName = engine.name;
           break;
         }
       }
 
       // Notify the user if they have chosen an existing engine/bookmark keyword
       if (eduplicate || bduplicate) {
-        let strings = document.getElementById("engineManagerBundle");
-        let dtitle = strings.getString("duplicateTitle");
-        let bmsg = strings.getString("duplicateBookmarkMsg");
-        let emsg = strings.getFormattedString("duplicateEngineMsg", [dupName]);
+        let msgids = [["duplicate-title"]];
+        if (eduplicate) {
+          msgids.push(["duplicate-engine-msg", { name: dupName }]);
+        } else {
+          msgids.push(["duplicate-bookmark-msg"]);
+        }
 
-        Services.prompt.alert(window, dtitle, eduplicate ? emsg : bmsg);
+        let [dtitle, msg] = await document.l10n.formatValues(msgids);
+
+        Services.prompt.alert(window, dtitle, msg);
         return false;
       }
     }
 
     gEngineView._engineStore.changeEngine(aEngine, "alias", keyword);
     gEngineView.invalidate();
     return true;
   },
--- a/browser/components/preferences/in-content/search.xul
+++ b/browser/components/preferences/in-content/search.xul
@@ -16,92 +16,86 @@
                   name="browser.search.widget.inNavBar"
                   type="bool"/>
 
     </preferences>
 
     <script type="application/javascript"
             src="chrome://browser/content/preferences/in-content/search.js"/>
 
-    <stringbundle id="engineManagerBundle" src="chrome://browser/locale/engineManager.properties"/>
-
     <hbox id="searchCategory"
           class="subcategory"
           hidden="true"
           data-category="paneSearch">
-      <label class="header-name" flex="1">&paneSearch.title;</label>
+      <label class="header-name" flex="1" data-l10n-id="pane-search-title"></label>
     </hbox>
 
     <groupbox id="searchbarGroup" data-category="paneSearch">
-      <caption><label id="searchbarLabel">&searchBar.label;</label></caption>
+      <caption><label id="searchbarLabel" data-l10n-id="search-bar-label"></label></caption>
       <radiogroup id="searchBarVisibleGroup" aria-labelledby="searchbarLabel" preference="browser.search.widget.inNavBar">
-        <radio id="searchBarHiddenRadio" value="false" label="&searchBar.hidden.label;"/>
+        <radio id="searchBarHiddenRadio" value="false" data-l10n-id="search-bar-hidden"/>
         <image class="searchBarImage searchBarHiddenImage" role="presentation"/>
-        <radio id="searchBarShownRadio" value="true" label="&searchBar.shown.label;"/>
+        <radio id="searchBarShownRadio" value="true" data-l10n-id="search-bar-shown"/>
         <image class="searchBarImage searchBarShownImage" role="presentation"/>
       </radiogroup>
     </groupbox>
 
     <!-- Default Search Engine -->
     <groupbox id="defaultEngineGroup" data-category="paneSearch">
-      <caption><label>&defaultSearchEngine.label;</label></caption>
-      <description>&chooseYourDefaultSearchEngine2.label;</description>
+      <caption><label data-l10n-id="default-search-engine"></label></caption>
+      <description data-l10n-id="default-search-engine-cta"></description>
 
       <hbox id="browserDefaultSearchExtensionContent" align="center" hidden="true">
         <description control="disableDefaultSearchExtension" flex="1"/>
       </hbox>
 
       <hbox>
         <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
         <hbox>
           <menulist id="defaultEngine">
             <menupopup/>
           </menulist>
         </hbox>
       </hbox>
 
       <checkbox id="suggestionsInSearchFieldsCheckbox"
-                label="&provideSearchSuggestions.label;"
-                accesskey="&provideSearchSuggestions.accesskey;"
+                data-l10n-id="provide-search-suggestions"
                 preference="browser.search.suggest.enabled"/>
       <vbox class="indent">
-        <checkbox id="urlBarSuggestion" label="&showURLBarSuggestions2.label;"
-                  accesskey="&showURLBarSuggestions2.accesskey;"
+        <checkbox id="urlBarSuggestion" data-l10n-id="show-url-bar-suggestions"
                   preference="browser.urlbar.suggest.searches"/>
         <hbox id="urlBarSuggestionPermanentPBLabel"
               align="center" class="indent">
-          <label flex="1">&urlBarSuggestionsPermanentPB.label;</label>
+          <label flex="1" data-l10n-id="url-bar-suggestions-permanent-pb"></label>
         </hbox>
       </vbox>
     </groupbox>
 
     <groupbox id="oneClickSearchProvidersGroup" data-category="paneSearch">
-      <caption><label>&oneClickSearchEngines.label;</label></caption>
-      <description>&chooseWhichOneToDisplay2.label;</description>
+      <caption><label data-l10n-id="one-click-search-engines"></label></caption>
+      <description data-l10n-id="one-click-search-engines-cta"></description>
 
       <tree id="engineList" flex="1" rows="8" hidecolumnpicker="true" editable="true"
             seltype="single" allowunderflowscroll="true">
         <treechildren id="engineChildren" flex="1"/>
         <treecols>
           <treecol id="engineShown" type="checkbox" editable="true" sortable="false"/>
-          <treecol id="engineName" flex="4" label="&engineNameColumn.label;" sortable="false"/>
-          <treecol id="engineKeyword" flex="1" label="&engineKeywordColumn.label;" editable="true"
+          <treecol id="engineName" flex="4" data-l10n-id="engine-name-column" sortable="false"/>
+          <treecol id="engineKeyword" flex="1" data-l10n-id="engine-keyword-column" editable="true"
                    sortable="false"/>
         </treecols>
       </tree>
 
       <hbox>
         <button id="restoreDefaultSearchEngines"
-                label="&restoreDefaultSearchEngines.label;"
-                accesskey="&restoreDefaultSearchEngines.accesskey;"
+                data-l10n-id="restore-default-se"
                 />
         <spacer flex="1"/>
         <button id="removeEngineButton"
                 class="searchEngineAction"
-                label="&removeEngine.label;"
-                accesskey="&removeEngine.accesskey;"
+                data-l10n-id="remove-engine"
                 disabled="true"
                 />
       </hbox>
       <hbox id="addEnginesBox" pack="start">
-        <label id="addEngines" class="text-link">&findMoreSearchEngines.label;</label>
+        <label id="addEngines" class="text-link" data-l10n-id="find-more-se"></label>
       </hbox>
     </groupbox>
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/preferences/search.ftl
@@ -0,0 +1,47 @@
+pane-search-title = Search
+
+search-bar-label = Search Bar
+search-bar-hidden
+    .label = Use the address bar for search and navigation
+search-bar-shown
+    .label = Add search bar in toolbar
+
+default-search-engine = Default Search Engine
+default-search-engine-cta = Choose the default search engine to use in the address bar and search bar.
+
+provide-search-suggestions
+    .label = Provide search suggestions
+    .accesskey = s
+
+show-url-bar-suggestions
+    .label = Show search suggestions in address bar results
+    .accesskey = l
+
+url-bar-suggestions-permanent-pb = Search suggestions will not be shown in location bar results because you have configured { brand-short-name } to never remember history.
+
+one-click-search-engines = One-Click Search Engines
+
+one-click-search-engines-cta = Choose the alternative search engines that appear below the address bar and search bar when you start to enter a keyword.
+
+engine-name-column
+    .label = Search Engine
+engine-keyword-column
+    .label = Keyword
+
+restore-default-se
+    .label = Restore Default Search Engines
+    .accesskey = D
+
+remove-engine
+    .label = Remove
+    .accesskey = R
+
+find-more-se = Find more search engines
+
+duplicate-title = Duplicate Keyword
+
+// Variables:
+//   $name (String): name of the engine using selected keyword
+duplicate-engine-msg = You have chosen a keyword that is currently in use by ā€œ{ $name }ā€. Please select another.
+
+duplicate-bookmark-msg = You have chosen a keyword that is currently in use by a bookmark. Please select another.
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/engineManager.properties
+++ /dev/null
@@ -1,7 +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/.
-
-duplicateTitle=Duplicate Keyword
-duplicateEngineMsg=You have chosen a keyword that is currently in use by ā€œ%Sā€. Please select another.
-duplicateBookmarkMsg=You have chosen a keyword that is currently in use by a bookmark. Please select another.
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/search.dtd
+++ /dev/null
@@ -1,34 +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 searchBar.label                       "Search Bar">
-
-<!ENTITY searchBar.hidden.label                "Use the address bar for search and navigation">
-<!ENTITY searchBar.shown.label                 "Add search bar in toolbar">
-
-<!ENTITY defaultSearchEngine.label             "Default Search Engine">
-
-<!ENTITY chooseYourDefaultSearchEngine2.label   "Choose the default search engine to use in the address bar and search bar.">
-
-<!ENTITY provideSearchSuggestions.label        "Provide search suggestions">
-<!ENTITY provideSearchSuggestions.accesskey    "s">
-
-<!ENTITY showURLBarSuggestions2.label           "Show search suggestions in address bar results">
-<!ENTITY showURLBarSuggestions2.accesskey       "l">
-<!ENTITY urlBarSuggestionsPermanentPB.label    "Search suggestions will not be shown in location bar results because you have configured &brandShortName; to never remember history.">
-
-<!ENTITY oneClickSearchEngines.label           "One-Click Search Engines">
-
-<!ENTITY chooseWhichOneToDisplay2.label         "Choose the alternative search engines that appear below the address bar and search bar when you start to enter a keyword.">
-
-<!ENTITY engineNameColumn.label                "Search Engine">
-<!ENTITY engineKeywordColumn.label             "Keyword">
-
-<!ENTITY restoreDefaultSearchEngines.label     "Restore Default Search Engines">
-<!ENTITY restoreDefaultSearchEngines.accesskey "d">
-
-<!ENTITY removeEngine.label                    "Remove">
-<!ENTITY removeEngine.accesskey                "r">
-
-<!ENTITY findMoreSearchEngines.label           "Find more search engines">
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -34,17 +34,16 @@
     locale/browser/newTab.properties               (%chrome/browser/newTab.properties)
     locale/browser/pageInfo.dtd                    (%chrome/browser/pageInfo.dtd)
     locale/browser/pageInfo.properties             (%chrome/browser/pageInfo.properties)
     locale/browser/quitDialog.properties           (%chrome/browser/quitDialog.properties)
     locale/browser/safeMode.dtd                    (%chrome/browser/safeMode.dtd)
     locale/browser/sanitize.dtd                    (%chrome/browser/sanitize.dtd)
     locale/browser/search.properties               (%chrome/browser/search.properties)
     locale/browser/sitePermissions.properties      (%chrome/browser/sitePermissions.properties)
-    locale/browser/engineManager.properties        (%chrome/browser/engineManager.properties)
     locale/browser/setDesktopBackground.dtd        (%chrome/browser/setDesktopBackground.dtd)
     locale/browser/shellservice.properties         (%chrome/browser/shellservice.properties)
     locale/browser/tabbrowser.properties           (%chrome/browser/tabbrowser.properties)
     locale/browser/taskbar.properties              (%chrome/browser/taskbar.properties)
     locale/browser/translation.dtd                 (%chrome/browser/translation.dtd)
     locale/browser/translation.properties          (%chrome/browser/translation.properties)
     locale/browser/webrtcIndicator.properties      (%chrome/browser/webrtcIndicator.properties)
     locale/browser/downloads/downloads.dtd         (%chrome/browser/downloads/downloads.dtd)
@@ -75,17 +74,16 @@
     locale/browser/preferences/donottrack.dtd         (%chrome/browser/preferences/donottrack.dtd)
     locale/browser/preferences/fonts.dtd              (%chrome/browser/preferences/fonts.dtd)
     locale/browser/preferences/languages.dtd          (%chrome/browser/preferences/languages.dtd)
     locale/browser/preferences/main.dtd               (%chrome/browser/preferences/main.dtd)
     locale/browser/preferences/permissions.dtd        (%chrome/browser/preferences/permissions.dtd)
     locale/browser/preferences/preferences.dtd        (%chrome/browser/preferences/preferences.dtd)
     locale/browser/preferences/preferences.properties     (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
-    locale/browser/preferences/search.dtd             (%chrome/browser/preferences/search.dtd)
     locale/browser/preferences/security.dtd           (%chrome/browser/preferences/security.dtd)
     locale/browser/preferences/selectBookmark.dtd     (%chrome/browser/preferences/selectBookmark.dtd)
     locale/browser/preferences/siteDataSettings.dtd     (%chrome/browser/preferences/siteDataSettings.dtd)
     locale/browser/preferences/sync.dtd               (%chrome/browser/preferences/sync.dtd)
     locale/browser/preferences/tabs.dtd               (%chrome/browser/preferences/tabs.dtd)
     locale/browser/preferences/translation.dtd        (%chrome/browser/preferences/translation.dtd)
     locale/browser/syncBrand.dtd                (%chrome/browser/syncBrand.dtd)
     locale/browser/syncSetup.properties         (%chrome/browser/syncSetup.properties)
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -1,13 +1,14 @@
 mozilla.pth:python/mach
 mozilla.pth:python/mozboot
 mozilla.pth:python/mozbuild
 mozilla.pth:python/mozlint
 mozilla.pth:python/mozversioncontrol
+mozilla.pth:python/l10n
 mozilla.pth:third_party/python/blessings
 mozilla.pth:third_party/python/compare-locales
 mozilla.pth:third_party/python/configobj
 mozilla.pth:third_party/python/cram
 mozilla.pth:third_party/python/dlmanager
 mozilla.pth:third_party/python/fluent
 mozilla.pth:third_party/python/futures
 mozilla.pth:third_party/python/hglib
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1415733.py
@@ -0,0 +1,249 @@
+# coding=utf8
+
+import fluent.syntax.ast as FTL
+from fluent.migrate import COPY, MESSAGE_REFERENCE, REPLACE, EXTERNAL_ARGUMENT
+
+
+def migrate(ctx):
+    """Bug 1415733 - Migrate the "Search" section of Preferences to the new Localization API, part {index}"""
+
+    ctx.maybe_add_localization(
+        'browser/branding/official/brand.dtd')
+    ctx.maybe_add_localization(
+        'browser/chrome/browser/preferences/search.dtd')
+    ctx.maybe_add_localization(
+        'browser/chrome/browser/preferences/preferences.dtd')
+    ctx.maybe_add_localization(
+        'browser/chrome/browser/engineManager.properties')
+
+    ctx.add_transforms(
+        'browser/branding/official/brand.ftl',
+        'browser/branding/official/locales/en-US/brand.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('brand-short-name'),
+                value=COPY(
+                    'browser/branding/official/brand.dtd',
+                    'brandShortName'
+                )
+            ),
+        ]
+    )
+
+    ctx.add_transforms(
+        'browser/browser/preferences/search.ftl',
+        'browser/locales/en-US/browser/preferences/search.ftl',
+        [
+            FTL.Message(
+                id=FTL.Identifier('pane-search-title'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/preferences.dtd',
+                    'paneSearch.title'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('search-bar-label'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'searchBar.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('search-bar-hidden'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'searchBar.hidden.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('search-bar-shown'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'searchBar.shown.label'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('default-search-engine'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'defaultSearchEngine.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('default-search-engine-cta'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'chooseYourDefaultSearchEngine2.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('provide-search-suggestions'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'provideSearchSuggestions.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'provideSearchSuggestions.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('show-url-bar-suggestions'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'showURLBarSuggestions2.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'showURLBarSuggestions2.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('url-bar-suggestions-permanent-pb'),
+                value=REPLACE(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'urlBarSuggestionsPermanentPB.label',
+                    {
+                        '&brandShortName;': MESSAGE_REFERENCE(
+                            'brand-short-name'
+                        )
+                    }
+                ),
+            ),
+            FTL.Message(
+                id=FTL.Identifier('one-click-search-engines'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'oneClickSearchEngines.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('one-click-search-engines-cta'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'chooseWhichOneToDisplay2.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('engine-name-column'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'engineNameColumn.label'
+                        )
+                    ),
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('engine-keyword-column'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'engineKeywordColumn.label'
+                        )
+                    ),
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('restore-default-se'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'restoreDefaultSearchEngines.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'restoreDefaultSearchEngines.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('remove-engine'),
+                attributes=[
+                    FTL.Attribute(
+                        FTL.Identifier('label'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'removeEngine.label'
+                        )
+                    ),
+                    FTL.Attribute(
+                        FTL.Identifier('accesskey'),
+                        COPY(
+                            'browser/chrome/browser/preferences/search.dtd',
+                            'removeEngine.accesskey'
+                        )
+                    )
+                ]
+            ),
+            FTL.Message(
+                id=FTL.Identifier('find-more-se'),
+                value=COPY(
+                    'browser/chrome/browser/preferences/search.dtd',
+                    'findMoreSearchEngines.label'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('duplicate-title'),
+                value=COPY(
+                    'browser/chrome/browser/engineManager.properties',
+                    'duplicateTitle'
+                )
+            ),
+            FTL.Message(
+                id=FTL.Identifier('duplicate-engine-msg'),
+                value=REPLACE(
+                    'browser/chrome/browser/engineManager.properties',
+                    'duplicateEngineMsg',
+                    {
+                        '%S': EXTERNAL_ARGUMENT(
+                            'name'
+                        )
+                    }
+                ),
+            ),
+            FTL.Message(
+                id=FTL.Identifier('duplicate-bookmark-msg'),
+                value=COPY(
+                    'browser/chrome/browser/engineManager.properties',
+                    'duplicateBookmarkMsg'
+                )
+            ),
+        ]
+    )