Merge pull request #19481 from Snuffleupagus/GenericL10n-fetch-bundles-parallel
[GenericL10n] Fetch the language bundles in parallel to reduce load time
This commit is contained in:
commit
6ad56135c9
@ -89,8 +89,14 @@ class GenericL10n extends L10n {
|
|||||||
}
|
}
|
||||||
langs.push(defaultLang);
|
langs.push(defaultLang);
|
||||||
}
|
}
|
||||||
for (const lang of langs) {
|
// Trigger fetching of bundles in parallel, to reduce overall load time.
|
||||||
const bundle = await this.#createBundle(lang, baseURL, paths);
|
const bundles = langs.map(lang => [
|
||||||
|
lang,
|
||||||
|
this.#createBundle(lang, baseURL, paths),
|
||||||
|
]);
|
||||||
|
|
||||||
|
for (const [lang, bundlePromise] of bundles) {
|
||||||
|
const bundle = await bundlePromise;
|
||||||
if (bundle) {
|
if (bundle) {
|
||||||
yield bundle;
|
yield bundle;
|
||||||
} else if (lang === "en-us") {
|
} else if (lang === "en-us") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user