Bug 1411707 - Convert findbar.dtd to findbar.ftl;r=flod
This will be used when we migrate away from XBL and to a Custom Element
in the following changesets.
MozReview-Commit-ID: 7ScSAAwbgVf
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -721,16 +721,18 @@ BrowserGlue.prototype = {
toolbar_field_text: "rgb(249, 249, 250)",
author: vendorShortName,
});
Normandy.init();
// Initialize the default l10n resource sources for L10nRegistry.
let locales = Services.locale.getPackagedLocales();
+ const greSource = new FileSource("toolkit", locales, "resource://gre/localization/{locale}/");
+ L10nRegistry.registerSource(greSource);
const appSource = new FileSource("app", locales, "resource://app/localization/{locale}/");
L10nRegistry.registerSource(appSource);
Services.obs.notifyObservers(null, "browser-ui-startup-complete");
},
_checkForOldBuildUpdates() {
// check for update if our build is old
new file mode 100644
--- /dev/null
+++ b/python/l10n/fluent_migrations/bug_1411707_findbar.py
@@ -0,0 +1,42 @@
+# 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
+
+
+def migrate(ctx):
+ """Bug 1411707 - Migrate the findbar XBL binding to a Custom Element, part {index}."""
+
+ ctx.add_transforms(
+ 'toolkit/toolkit/main-window/findbar.ftl',
+ 'toolkit/toolkit/main-window/findbar.ftl',
+ transforms_from(
+"""
+findbar-next =
+ .tooltiptext = { COPY(from_path, "next.tooltip") }
+findbar-previous =
+ .tooltiptext = { COPY(from_path, "previous.tooltip") }
+
+findbar-find-button-close =
+ .tooltiptext = { COPY(from_path, "findCloseButton.tooltip") }
+
+findbar-highlight-all =
+ .label = { COPY(from_path, "highlightAll.label") }
+ .accesskey = { COPY(from_path, "highlightAll.accesskey") }
+ .tooltiptext = { COPY(from_path, "highlightAll.tooltiptext") }
+
+findbar-case-sensitive =
+ .label = { COPY(from_path, "caseSensitive.label") }
+ .accesskey = { COPY(from_path, "caseSensitive.accesskey") }
+ .tooltiptext = { COPY(from_path, "caseSensitive.tooltiptext") }
+
+findbar-entire-word =
+ .label = { COPY(from_path, "entireWord.label") }
+ .accesskey = { COPY(from_path, "entireWord.accesskey") }
+ .tooltiptext = { COPY(from_path, "entireWord.tooltiptext") }
+""", from_path="toolkit/chrome/global/findbar.dtd")
+ )
new file mode 100644
--- /dev/null
+++ b/toolkit/locales/en-US/toolkit/main-window/findbar.ftl
@@ -0,0 +1,24 @@
+### This file contains the entities needed to use the Find Bar.
+
+findbar-next =
+ .tooltiptext = Find the next occurrence of the phrase
+findbar-previous =
+ .tooltiptext = Find the previous occurrence of the phrase
+
+findbar-find-button-close =
+ .tooltiptext = Close find bar
+
+findbar-highlight-all =
+ .label = Highlight All
+ .accesskey = l
+ .tooltiptext = Highlight all occurrences of the phrase
+
+findbar-case-sensitive =
+ .label = Match Case
+ .accesskey = C
+ .tooltiptext = Search with case sensitivity
+
+findbar-entire-word =
+ .label = Whole Words
+ .accesskey = W
+ .tooltiptext = Search whole words only
\ No newline at end of file
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -1,13 +1,15 @@
#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:
+ toolkit (%toolkit/**/*.ftl)
@AB_CD@.jar:
% locale global @AB_CD@ %locale/@AB_CD@/global/
locale/@AB_CD@/global/aboutAbout.dtd (%chrome/global/aboutAbout.dtd)
locale/@AB_CD@/global/aboutReader.properties (%chrome/global/aboutReader.properties)
locale/@AB_CD@/global/aboutRights.dtd (%chrome/global/aboutRights.dtd)
locale/@AB_CD@/global/aboutNetworking.dtd (%chrome/global/aboutNetworking.dtd)
#ifndef ANDROID