Bug 1936528 - Rename generated update.locale as default.locale, always include it r=nalexander,geckoview-reviewers,browser-installer-reviewers,valentin,ohall
Differential Revision: https://phabricator.services.mozilla.com/D232605
This commit is contained in:
@@ -51,7 +51,7 @@ res/table-remove-column.gif
|
||||
res/table-remove-row.gif
|
||||
|
||||
res/multilocale.txt
|
||||
update.locale
|
||||
default.locale
|
||||
|
||||
# Bug 1451016 - Nightly-only PaymentRequest & Form Autofill code sharing.
|
||||
browser/features/formautofill@mozilla.org/chrome/content/editAddress.xhtml
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
#ifdef HAVE_MAKENSISU
|
||||
@BINPATH@/uninstall/helper.exe
|
||||
#endif
|
||||
@RESPATH@/default.locale
|
||||
#ifdef MOZ_UPDATER
|
||||
@RESPATH@/update.locale
|
||||
@RESPATH@/updater.ini
|
||||
#endif
|
||||
#if defined(MOZ_UPDATE_AGENT)
|
||||
|
||||
@@ -22,7 +22,7 @@ Data Sources
|
||||
|
||||
There are three primary sources that become available during the bootstrap.
|
||||
|
||||
1) Packaged locale lists stored in files :js:`update.locale` and :js:`multilocale.txt`.
|
||||
1) Packaged locale lists stored in files :js:`default.locale` and :js:`multilocale.txt`.
|
||||
|
||||
2) User preferences read from the profile.
|
||||
|
||||
@@ -60,7 +60,7 @@ are being read, so the data is being fetched using packaged preferences.
|
||||
|
||||
In case of Desktop Firefox the :js:`intl.locale.requested` pref will be not set,
|
||||
which means Gecko will use the default locale which is retrieved from
|
||||
:js:`update.locale` file (also packaged).
|
||||
:js:`default.locale` file (also packaged).
|
||||
|
||||
This means that the initial result of language negotiation is between packaged
|
||||
locales as available and the default requested locale.
|
||||
|
||||
@@ -408,10 +408,10 @@ LocaleService::GetDefaultLocale(nsACString& aRetVal) {
|
||||
// time), so we cache the result the first time we're called.
|
||||
if (mDefaultLocale.IsEmpty()) {
|
||||
nsAutoCString locale;
|
||||
// Try to get the package locale from update.locale in omnijar. If the
|
||||
// update.locale file is not found, item.len will remain 0 and we'll
|
||||
// Try to get the package locale from default.locale in omnijar. If the
|
||||
// default.locale file is not found, item.len will remain 0 and we'll
|
||||
// just use our hard-coded default below.
|
||||
GetGREFileContents("update.locale", &locale);
|
||||
GetGREFileContents("default.locale", &locale);
|
||||
locale.Trim(" \t\n\r");
|
||||
#ifdef MOZ_UPDATER
|
||||
// This should never be empty.
|
||||
@@ -421,7 +421,7 @@ LocaleService::GetDefaultLocale(nsACString& aRetVal) {
|
||||
mDefaultLocale.Assign(locale);
|
||||
}
|
||||
|
||||
// Hard-coded fallback to allow us to survive even if update.locale was
|
||||
// Hard-coded fallback to allow us to survive even if default.locale was
|
||||
// missing/broken in some way.
|
||||
if (mDefaultLocale.IsEmpty()) {
|
||||
GetLastFallbackLocale(mDefaultLocale);
|
||||
|
||||
@@ -14,7 +14,7 @@ res/table-remove-column.gif
|
||||
res/table-remove-row.gif
|
||||
|
||||
res/multilocale.txt
|
||||
update.locale
|
||||
default.locale
|
||||
|
||||
#ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
|
||||
defaults/pref/arm64-v8a/geckoview-prefs.js
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
[@AB_CD@]
|
||||
@BINPATH@/@PREF_DIR@/mobile-l10n.js
|
||||
@BINPATH@/update.locale
|
||||
@BINPATH@/default.locale
|
||||
#ifdef MOZ_UPDATER
|
||||
@BINPATH@/updater.ini
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
update.locale
|
||||
README.txt
|
||||
components/dom_webspeech.xpt
|
||||
|
||||
@@ -14,7 +14,7 @@ res/table-remove-column.gif
|
||||
res/table-remove-row.gif
|
||||
|
||||
res/multilocale.txt
|
||||
update.locale
|
||||
default.locale
|
||||
|
||||
components/httpd.sys.mjs
|
||||
chrome/remote/content/server/httpd.sys.mjs
|
||||
|
||||
@@ -1068,13 +1068,6 @@ static void RecordZeroLengthEvent(bool aIsSync, const nsCString& aSpec,
|
||||
return;
|
||||
}
|
||||
|
||||
// See bug 1695560. "update.locale" with
|
||||
// NS_ERROR_FILE_NOT_FOUND is filtered out.
|
||||
if (fileName.EqualsLiteral("omni.ja!/update.locale") &&
|
||||
aStatus == NS_ERROR_FILE_NOT_FOUND) {
|
||||
return;
|
||||
}
|
||||
|
||||
glean::zero_byte_load::LoadOthersExtra extra = {
|
||||
.cancelReason = Some(aCanceledReason),
|
||||
.cancelled = Some(aCanceled),
|
||||
|
||||
@@ -66,7 +66,6 @@ exclude = [
|
||||
"toolkit/components/featuregates",
|
||||
"toolkit/content/tests/chrome/file_about_networking_wsh.py",
|
||||
"toolkit/library/build/dependentlibs.py",
|
||||
"toolkit/locales/generate_update_locale.py",
|
||||
"toolkit/mozapps",
|
||||
"toolkit/moz.configure",
|
||||
"toolkit/nss.configure",
|
||||
|
||||
@@ -471,7 +471,7 @@ ARCHIVE_FILES = {
|
||||
"*.toml",
|
||||
"localization/**",
|
||||
"modules/**",
|
||||
"update.locale",
|
||||
"default.locale",
|
||||
"greprefs.js",
|
||||
],
|
||||
"dest": "bin",
|
||||
|
||||
@@ -349,6 +349,6 @@ class OmniJarSubFormatter(PiecemealFormatter):
|
||||
"dictionaries",
|
||||
"hyphenation",
|
||||
"localization",
|
||||
"update.locale",
|
||||
"default.locale",
|
||||
"contentaccessible",
|
||||
]
|
||||
|
||||
@@ -431,7 +431,7 @@ class TestFormatters(TestErrors, unittest.TestCase):
|
||||
self.assertTrue(is_resource(base, "modules/foo.jsm"))
|
||||
self.assertTrue(is_resource(base, "greprefs.js"))
|
||||
self.assertTrue(is_resource(base, "hyphenation/foo"))
|
||||
self.assertTrue(is_resource(base, "update.locale"))
|
||||
self.assertTrue(is_resource(base, "default.locale"))
|
||||
self.assertFalse(is_resource(base, "foo"))
|
||||
self.assertFalse(is_resource(base, "foo/bar/greprefs.js"))
|
||||
self.assertTrue(is_resource(base, "defaults/messenger/foo.dat"))
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# 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/.
|
||||
|
||||
# Generate update.locale, which simply contains the name of the current locale.
|
||||
# Generate default.locale, which simply contains the name of the current locale.
|
||||
|
||||
|
||||
def main(output, locale=None):
|
||||
assert locale is not None
|
||||
# update.locale is a trivial file but let's be unicode aware anyway.
|
||||
# default.locale is a trivial file but let's be unicode aware anyway.
|
||||
print(locale, file=output)
|
||||
@@ -20,10 +20,10 @@ FINAL_TARGET_FILES.res += [
|
||||
"!multilocale.txt",
|
||||
]
|
||||
|
||||
LOCALIZED_GENERATED_FILES += ["update.locale"]
|
||||
update_locale = LOCALIZED_GENERATED_FILES["update.locale"]
|
||||
update_locale.script = "generate_update_locale.py"
|
||||
LOCALIZED_FILES += ["!update.locale"]
|
||||
LOCALIZED_GENERATED_FILES += ["default.locale"]
|
||||
default_locale = LOCALIZED_GENERATED_FILES["default.locale"]
|
||||
default_locale.script = "generate_default_locale.py"
|
||||
LOCALIZED_FILES += ["!default.locale"]
|
||||
|
||||
LOCALIZED_GENERATED_FILES += ["locale.ini"]
|
||||
LOCALIZED_GENERATED_FILES["locale.ini"].script = "generate_locale_ini.py"
|
||||
|
||||
@@ -19,7 +19,7 @@ const PER_INSTALLATION_PREFS_PLATFORMS = ["win"];
|
||||
// located in the update directory which makes it a common setting across all
|
||||
// application profiles and allows the Background Update Agent to read it.
|
||||
const FILE_UPDATE_CONFIG_JSON = "update-config.json";
|
||||
const FILE_UPDATE_LOCALE = "update.locale";
|
||||
const FILE_DEFAULT_LOCALE = "default.locale";
|
||||
const PREF_APP_DISTRIBUTION = "distribution.id";
|
||||
const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
|
||||
|
||||
@@ -116,8 +116,8 @@ export var UpdateUtils = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the locale from the update.locale file for replacing %LOCALE% in the
|
||||
* update url. The update.locale file can be located in the application
|
||||
* Gets the locale from the default.locale file for replacing %LOCALE% in the
|
||||
* update url. The default.locale file can be located in the application
|
||||
* directory or the GRE directory with preference given to it being located in
|
||||
* the application directory.
|
||||
*/
|
||||
@@ -127,7 +127,7 @@ export var UpdateUtils = {
|
||||
}
|
||||
|
||||
for (let res of ["app", "gre"]) {
|
||||
const url = "resource://" + res + "/" + FILE_UPDATE_LOCALE;
|
||||
const url = `resource://${res}/${FILE_DEFAULT_LOCALE}`;
|
||||
let data;
|
||||
try {
|
||||
data = await fetch(url);
|
||||
@@ -139,12 +139,10 @@ export var UpdateUtils = {
|
||||
return (this._locale = locale.trim());
|
||||
}
|
||||
}
|
||||
if (AppConstants.MOZ_UPDATER) {
|
||||
console.error(
|
||||
FILE_UPDATE_LOCALE,
|
||||
" file doesn't exist in either the application or GRE directories"
|
||||
);
|
||||
}
|
||||
console.error(
|
||||
FILE_DEFAULT_LOCALE,
|
||||
" file doesn't exist in either the application or GRE directories"
|
||||
);
|
||||
|
||||
return (this._locale = null);
|
||||
},
|
||||
|
||||
@@ -271,6 +271,7 @@ add_task(async function test_build_target() {
|
||||
|
||||
// url constructed with %LOCALE%
|
||||
// Bug 488936 added the update.locale file that stores the update locale
|
||||
// Bug 1936528 renamed it as default.locale
|
||||
add_task(async function test_locale() {
|
||||
// The code that gets the locale accesses the profile which is only available
|
||||
// after calling do_get_profile in xpcshell tests. This prevents an error from
|
||||
|
||||
@@ -21,7 +21,7 @@ NON_CHROME = set(
|
||||
"defaults/profile",
|
||||
"defaults/pref*/*-l10n.js",
|
||||
"locale.ini",
|
||||
"update.locale",
|
||||
"default.locale",
|
||||
"updater.ini",
|
||||
"extensions/langpack-*@*",
|
||||
"distribution/extensions/langpack-*@*",
|
||||
|
||||
Reference in New Issue
Block a user