mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-08 21:16:28 -05:00
Fix date picker not properly localized (#330)
* Fix language in date picker Vuetify allows custom-named locales, but the date-picker really only works with BCP 47 language tag * Save lang at proper time + Update Vuetify lang on the fly
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import VueI18n from "../../i18n";
|
||||
|
||||
const state = {
|
||||
lang: "en",
|
||||
lang: "en-US",
|
||||
allLangs: [
|
||||
{
|
||||
name: "English",
|
||||
@@ -52,7 +52,12 @@ const mutations = {
|
||||
const actions = {
|
||||
initLang({ getters }, { currentVueComponent }) {
|
||||
VueI18n.locale = getters.getActiveLang;
|
||||
currentVueComponent.$vuetify.lang.current = getters.getActiveLang.replace('-', '_');
|
||||
currentVueComponent.$vuetify.lang.current = getters.getActiveLang;
|
||||
},
|
||||
setLang({ commit }, { language, currentVueComponent }) {
|
||||
VueI18n.locale = language;
|
||||
currentVueComponent.$vuetify.lang.current = language;
|
||||
commit('setLang', language);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user