mirror of
https://github.com/open-webui/open-webui
synced 2024-11-24 13:07:25 +00:00
refac
This commit is contained in:
parent
d9a229b1ec
commit
f77073410e
@ -99,7 +99,6 @@ from config import (
|
||||
CHANGELOG,
|
||||
FRONTEND_BUILD_DIR,
|
||||
UPLOAD_DIR,
|
||||
|
||||
CACHE_DIR,
|
||||
STATIC_DIR,
|
||||
DEFAULT_LOCALE,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user