"include/vscode:/vscode.git/clone" did not exist on "66fd771255cc6f5e93fd955adc31ee989e6ad2de"
Commit f7707341 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac

parent d9a229b1
...@@ -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,
......
...@@ -92,16 +92,15 @@ ...@@ -92,16 +92,15 @@
// 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`.
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(); initI18n();
if (!localStorage.locale) { 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); $i18n.changeLanguage(lang);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment