From afee3f41ebf80b58cbb7ca010b89b3eed3d76d4d Mon Sep 17 00:00:00 2001 From: Alex Catarineu Date: Wed, 25 Sep 2019 23:23:30 +0200 Subject: [PATCH] Bug 28196: preparations for using torbutton tor-browser-brand.ftl A small change to Fluent FileSource class is required so that we can register a new source without its supported locales being counted as available locales for the browser. --- .../alpha/locales/en-US/tor-browser-brand.ftl | 12 ------------ .../nightly/locales/en-US/tor-browser-brand.ftl | 12 ------------ .../official/locales/en-US/tor-browser-brand.ftl | 12 ------------ intl/l10n/L10nRegistry.jsm | 7 +++++-- 4 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 browser/branding/alpha/locales/en-US/tor-browser-brand.ftl delete mode 100644 browser/branding/nightly/locales/en-US/tor-browser-brand.ftl delete mode 100644 browser/branding/official/locales/en-US/tor-browser-brand.ftl diff --git a/browser/branding/alpha/locales/en-US/tor-browser-brand.ftl b/browser/branding/alpha/locales/en-US/tor-browser-brand.ftl deleted file mode 100644 index dbb5de3f1cf0e..0000000000000 --- a/browser/branding/alpha/locales/en-US/tor-browser-brand.ftl +++ /dev/null @@ -1,12 +0,0 @@ -# For Tor Browser, we use a new file (different than the brand.ftl file -# that is used by Firefox) to avoid picking up the -brand-short-name values -# that Mozilla includes in the Firefox language packs. - --brand-shorter-name = Tor Browser --brand-short-name = Tor Browser --brand-full-name = Tor Browser -# This brand name can be used in messages where the product name needs to -# remain unchanged across different versions (Nightly, Beta, etc.). --brand-product-name = Tor Browser --vendor-short-name = Tor Project -trademarkInfo = Firefox and the Firefox logos are trademarks of the Mozilla Foundation. diff --git a/browser/branding/nightly/locales/en-US/tor-browser-brand.ftl b/browser/branding/nightly/locales/en-US/tor-browser-brand.ftl deleted file mode 100644 index dbb5de3f1cf0e..0000000000000 --- a/browser/branding/nightly/locales/en-US/tor-browser-brand.ftl +++ /dev/null @@ -1,12 +0,0 @@ -# For Tor Browser, we use a new file (different than the brand.ftl file -# that is used by Firefox) to avoid picking up the -brand-short-name values -# that Mozilla includes in the Firefox language packs. - --brand-shorter-name = Tor Browser --brand-short-name = Tor Browser --brand-full-name = Tor Browser -# This brand name can be used in messages where the product name needs to -# remain unchanged across different versions (Nightly, Beta, etc.). --brand-product-name = Tor Browser --vendor-short-name = Tor Project -trademarkInfo = Firefox and the Firefox logos are trademarks of the Mozilla Foundation. diff --git a/browser/branding/official/locales/en-US/tor-browser-brand.ftl b/browser/branding/official/locales/en-US/tor-browser-brand.ftl deleted file mode 100644 index dbb5de3f1cf0e..0000000000000 --- a/browser/branding/official/locales/en-US/tor-browser-brand.ftl +++ /dev/null @@ -1,12 +0,0 @@ -# For Tor Browser, we use a new file (different than the brand.ftl file -# that is used by Firefox) to avoid picking up the -brand-short-name values -# that Mozilla includes in the Firefox language packs. - --brand-shorter-name = Tor Browser --brand-short-name = Tor Browser --brand-full-name = Tor Browser -# This brand name can be used in messages where the product name needs to -# remain unchanged across different versions (Nightly, Beta, etc.). --brand-product-name = Tor Browser --vendor-short-name = Tor Project -trademarkInfo = Firefox and the Firefox logos are trademarks of the Mozilla Foundation. diff --git a/intl/l10n/L10nRegistry.jsm b/intl/l10n/L10nRegistry.jsm index 69bdcdbf38e60..0d080fd6d1beb 100644 --- a/intl/l10n/L10nRegistry.jsm +++ b/intl/l10n/L10nRegistry.jsm @@ -266,7 +266,9 @@ class L10nRegistryService { for (const source of this.sources.values()) { for (const locale of source.locales) { - locales.add(locale); + if (!source.skipForAvailableLocales) { + locales.add(locale); + } } } return Array.from(locales); @@ -574,10 +576,11 @@ class FileSource { * * @returns {FileSource} */ - constructor(name, locales, prePath) { + constructor(name, locales, prePath, skipForAvailableLocales = false) { this.name = name; this.locales = locales; this.prePath = prePath; + this.skipForAvailableLocales = skipForAvailableLocales; this.indexed = false; // The cache object stores information about the resources available -- GitLab