Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
f7707341
Commit
f7707341
authored
Jun 30, 2024
by
Timothy J. Baek
Browse files
refac
parent
d9a229b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
backend/main.py
backend/main.py
+0
-1
src/routes/+layout.svelte
src/routes/+layout.svelte
+7
-8
No files found.
backend/main.py
View file @
f7707341
...
@@ -99,7 +99,6 @@ from config import (
...
@@ -99,7 +99,6 @@ from config import (
CHANGELOG
,
CHANGELOG
,
FRONTEND_BUILD_DIR
,
FRONTEND_BUILD_DIR
,
UPLOAD_DIR
,
UPLOAD_DIR
,
CACHE_DIR
,
CACHE_DIR
,
STATIC_DIR
,
STATIC_DIR
,
DEFAULT_LOCALE
,
DEFAULT_LOCALE
,
...
...
src/routes/+layout.svelte
View file @
f7707341
...
@@ -92,6 +92,8 @@
...
@@ -92,6 +92,8 @@
// Initialize i18n even if we didn't get a backend config,
// Initialize i18n even if we didn't get a backend config,
// so `/error` can show something that's not `undefined`.
// so `/error` can show something that's not `undefined`.
initI18n();
if (!localStorage.locale) {
const languages = await getLanguages();
const languages = await getLanguages();
const browserLanguages = navigator.languages
const browserLanguages = navigator.languages
? navigator.languages
? navigator.languages
...
@@ -99,9 +101,6 @@
...
@@ -99,9 +101,6 @@
const lang = backendConfig.default_locale
const lang = backendConfig.default_locale
? backendConfig.default_locale
? backendConfig.default_locale
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
: bestMatchingLanguage(languages, browserLanguages, 'en-US');
initI18n();
if (!localStorage.locale) {
$i18n.changeLanguage(lang);
$i18n.changeLanguage(lang);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment