Merge pull request #10551 from vector-im/t3chguy/i18n_config_default
Load config.json before loading language so default can apply
This commit is contained in:
commit
3b908f4a33
|
@ -195,11 +195,6 @@ async function loadApp() {
|
||||||
|
|
||||||
await loadOlm();
|
await loadOlm();
|
||||||
|
|
||||||
await loadLanguage();
|
|
||||||
|
|
||||||
const fragparts = parseQsFromFragment(window.location);
|
|
||||||
const params = parseQs(window.location);
|
|
||||||
|
|
||||||
// set the platform for react sdk
|
// set the platform for react sdk
|
||||||
if (window.ipcRenderer) {
|
if (window.ipcRenderer) {
|
||||||
console.log("Using Electron platform");
|
console.log("Using Electron platform");
|
||||||
|
@ -239,6 +234,12 @@ async function loadApp() {
|
||||||
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
|
// granular settings are loaded correctly and to avoid duplicating the override logic for the theme.
|
||||||
SdkConfig.put(configJson);
|
SdkConfig.put(configJson);
|
||||||
|
|
||||||
|
// Load language after loading config.json so that settingsDefaults.language can be applied
|
||||||
|
await loadLanguage();
|
||||||
|
|
||||||
|
const fragparts = parseQsFromFragment(window.location);
|
||||||
|
const params = parseQs(window.location);
|
||||||
|
|
||||||
// don't try to redirect to the native apps if we're
|
// don't try to redirect to the native apps if we're
|
||||||
// verifying a 3pid (but after we've loaded the config)
|
// verifying a 3pid (but after we've loaded the config)
|
||||||
// or if the user is following a deep link
|
// or if the user is following a deep link
|
||||||
|
@ -430,6 +431,7 @@ function loadOlm() {
|
||||||
|
|
||||||
async function loadLanguage() {
|
async function loadLanguage() {
|
||||||
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
|
const prefLang = SettingsStore.getValue("language", null, /*excludeDefault=*/true);
|
||||||
|
console.log("DEBUG", prefLang);
|
||||||
let langs = [];
|
let langs = [];
|
||||||
|
|
||||||
if (!prefLang) {
|
if (!prefLang) {
|
||||||
|
@ -439,6 +441,7 @@ async function loadLanguage() {
|
||||||
} else {
|
} else {
|
||||||
langs = [prefLang];
|
langs = [prefLang];
|
||||||
}
|
}
|
||||||
|
console.log("DEBUG1", langs);
|
||||||
try {
|
try {
|
||||||
await languageHandler.setLanguage(langs);
|
await languageHandler.setLanguage(langs);
|
||||||
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
|
document.documentElement.setAttribute("lang", languageHandler.getCurrentLanguage());
|
||||||
|
|
Loading…
Reference in New Issue