forked from matrix/element-web
s/tabs/spaces/
This commit is contained in:
parent
3f3f230a77
commit
a6b11968a4
|
@ -282,14 +282,14 @@ async function loadApp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!configJson.languages) {
|
if (!configJson.languages) {
|
||||||
let languages;
|
let languages;
|
||||||
try {
|
try {
|
||||||
languages = await languageHandler.getAllLanguageKeysFromJson();
|
languages = await languageHandler.getAllLanguageKeysFromJson();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("couldn't load languages from languages.json: error = "+e);
|
console.log("couldn't load languages from languages.json: error = "+e);
|
||||||
languages = ['en'];
|
languages = ['en'];
|
||||||
}
|
}
|
||||||
configJson.languages = languages;
|
configJson.languages = languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser')) {
|
if (window.localStorage && window.localStorage.getItem('mx_accepts_unsupported_browser')) {
|
||||||
|
@ -339,16 +339,16 @@ async function loadApp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadLanguage(callback) {
|
function loadLanguage(callback) {
|
||||||
const _localSettings = getLocalSettings();
|
const _localSettings = getLocalSettings();
|
||||||
var languages = [];
|
var languages = [];
|
||||||
if (!_localSettings.hasOwnProperty('language')) {
|
if (!_localSettings.hasOwnProperty('language')) {
|
||||||
languages = languageHandler.getNormalizedLanguageKeys(languageHandler.getLanguageFromBrowser());
|
languages = languageHandler.getNormalizedLanguageKeys(languageHandler.getLanguageFromBrowser());
|
||||||
}else {
|
}else {
|
||||||
languages = languageHandler.getNormalizedLanguageKeys(_localSettings.language);
|
languages = languageHandler.getNormalizedLanguageKeys(_localSettings.language);
|
||||||
}
|
}
|
||||||
languageHandler.setLanguage(languages, counterpart);
|
languageHandler.setLanguage(languages, counterpart);
|
||||||
setLocalSetting('language', languages[0]);
|
setLocalSetting('language', languages[0]);
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadLanguage(loadApp);
|
loadLanguage(loadApp);
|
||||||
|
|
Loading…
Reference in New Issue