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,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);
} }
......
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