From 8be68fa92717473f1bd5758ac35bcf9c56dc5ac1 Mon Sep 17 00:00:00 2001 From: Henrik Askjer <henrik.askjer@uib.no> Date: Fri, 26 Nov 2021 09:41:17 +0100 Subject: [PATCH] wip --- src/i18n.js | 2 +- src/main.js | 5 +++-- vue.config.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/i18n.js b/src/i18n.js index 7e0a0abf..a40dc7d5 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -19,6 +19,6 @@ function loadLocaleMessages () { export default new VueI18n({ - fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', + fallbackLocale: 'nob', messages: loadLocaleMessages() }) diff --git a/src/main.js b/src/main.js index 8bc28e33..d8a10d42 100644 --- a/src/main.js +++ b/src/main.js @@ -32,10 +32,11 @@ const store = new Vuex.Store({ state.showSearchToolbar = localStorage.getItem('showSearchToolbar') || false state.showHGNO = localStorage.getItem('showHGNO') || false state.showInflectionNo = localStorage.getItem('showInflectionNo') || false - state.currentLocale = localStorage.getItem('currentLocale') || {text:"nob", value: "nob"} + state.currentLocale = localStorage.getItem('currentLocale') || {text:"norsk (bokmål)", value: "nob"} }, - changeLocale(state, locale) { + changeLocale(state, locale, i18n) { state.currentLocale = locale + i18n.locale = locale localStorage.setItem("currentLocale", locale); }, toggle(state, setting) { diff --git a/vue.config.js b/vue.config.js index e06c46e7..c730a957 100644 --- a/vue.config.js +++ b/vue.config.js @@ -11,7 +11,7 @@ module.exports = { pluginOptions: { i18n: { - fallbackLocale: 'en', + fallbackLocale: 'nob', localeDir: 'locales', enableInSFC: true, includeLocales: false, -- GitLab