commit 358aee2900917eb945eb2f4d9b350ba40dd6447f Author: Alex Catarineu acat@torproject.org Date: Wed Sep 25 23:23:30 2019 +0200
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. --- browser/branding/alpha/locales/en-US/tor-browser-brand.ftl | 12 ------------ browser/branding/nightly/locales/en-US/tor-browser-brand.ftl | 12 ------------ .../branding/official/locales/en-US/tor-browser-brand.ftl | 12 ------------ intl/l10n/L10nRegistry.jsm | 7 +++++-- 4 files changed, 5 insertions(+), 38 deletions(-)
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 dbb5de3f1cf0..000000000000 --- 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 dbb5de3f1cf0..000000000000 --- 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 dbb5de3f1cf0..000000000000 --- 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 69bdcdbf38e6..0d080fd6d1be 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
tor-commits@lists.torproject.org