This commit is contained in:
Timothy J. Baek 2024-06-30 14:52:18 -07:00
parent d9a229b1ec
commit f77073410e
2 changed files with 7 additions and 9 deletions

View File

@ -99,7 +99,6 @@ from config import (
CHANGELOG,
FRONTEND_BUILD_DIR,
UPLOAD_DIR,
CACHE_DIR,
STATIC_DIR,
DEFAULT_LOCALE,

View File

@ -92,16 +92,15 @@
// Initialize i18n even if we didn't get a backend config,
// so `/error` can show something that's not `undefined`.
const languages = await getLanguages();
const browserLanguages = navigator.languages
? navigator.languages
: [navigator.language || navigator.userLanguage];
const lang = backendConfig.default_locale
? backendConfig.default_locale
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
initI18n();
if (!localStorage.locale) {
const languages = await getLanguages();
const browserLanguages = navigator.languages
? navigator.languages
: [navigator.language || navigator.userLanguage];
const lang = backendConfig.default_locale
? backendConfig.default_locale
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
$i18n.changeLanguage(lang);
}