Also split ui locales by _
This commit is contained in:
parent
d04f3db22f
commit
7a71ae5f37
@ -123,9 +123,13 @@ async function loadRawLocales() {
|
|||||||
const langs = new Set<string>(["en"]);
|
const langs = new Set<string>(["en"]);
|
||||||
const ui = (browser.i18n || chrome.i18n).getUILanguage();
|
const ui = (browser.i18n || chrome.i18n).getUILanguage();
|
||||||
langs.add(ui);
|
langs.add(ui);
|
||||||
if (ui.includes("-")) {
|
|
||||||
// Try the base too
|
// Try the base too
|
||||||
langs.add(ui.split(/[_-]+/)[0]);
|
if (ui.includes("-")) {
|
||||||
|
langs.add(ui.split(/[-]+/)[0]);
|
||||||
|
}
|
||||||
|
else if (ui.includes("_")) {
|
||||||
|
langs.add(ui.split(/[_]+/)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetched = await Promise.all(Array.from(langs, fetchLanguage));
|
const fetched = await Promise.all(Array.from(langs, fetchLanguage));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user