diff --git a/assets/js/i18n/index.js b/assets/js/i18n/index.js index 84b6c7aff..841c850c4 100644 --- a/assets/js/i18n/index.js +++ b/assets/js/i18n/index.js @@ -6,6 +6,8 @@ import it from "./it"; Vue.use(VueI18n); +const PREFERRED_LOCALE_KEY = "preferred_locale"; + function getBrowserLocale() { const navigatorLocale = navigator.languages !== undefined ? navigator.languages[0] : navigator.language; @@ -17,7 +19,7 @@ function getBrowserLocale() { } export default new VueI18n({ - locale: getBrowserLocale(), + locale: window.localStorage[PREFERRED_LOCALE_KEY] || getBrowserLocale(), fallbackLocale: "en", messages: { de, en, it }, }); diff --git a/dist/index.html b/dist/index.html index e8b48cba8..bdb1aa68d 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,5 +1,5 @@ -