diff --git a/src/i18n/i18n.js b/src/i18n/i18n.js index 61e1fb9be..05612ad34 100644 --- a/src/i18n/i18n.js +++ b/src/i18n/i18n.js @@ -7,11 +7,12 @@ import date from './date' import VueCookie from 'vue-cookie' Vue.use(VueI18n) - -const cookieLang = VueCookie.get('django_language') || 'en' -const defaultLang = cookieLang.slice(0, 2) +const cookieLang = VueCookie.get('django_language') +const browserLang = navigator.systemLanguage || navigator.language +let lang = cookieLang || browserLang || 'zh' +lang = lang.slice(0, 2) const i18n = new VueI18n({ - locale: defaultLang, + locale: lang, fallbackLocale: 'en', silentFallbackWarn: true, silentTranslationWarn: true,