mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
Use embedded Vuetify locales
This commit is contained in:
parent
47cb0a64e5
commit
be88fdbbc4
4 changed files with 15 additions and 4 deletions
|
@ -70,7 +70,7 @@ export default {
|
|||
this.search = !this.search;
|
||||
}
|
||||
});
|
||||
this.$store.dispatch("initLang");
|
||||
this.$store.dispatch("initLang", { currentVueComponent: this });
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
<v-date-picker
|
||||
v-model="startDate"
|
||||
no-title
|
||||
:locale="$i18n.locale"
|
||||
@input="menu2 = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
|
@ -59,7 +58,6 @@
|
|||
<v-date-picker
|
||||
v-model="endDate"
|
||||
no-title
|
||||
:locale="$i18n.locale"
|
||||
@input="menu2 = false"
|
||||
></v-date-picker>
|
||||
</v-menu>
|
||||
|
|
|
@ -3,6 +3,12 @@ import Vuetify from "vuetify/lib";
|
|||
|
||||
Vue.use(Vuetify);
|
||||
|
||||
|
||||
import fr from 'vuetify/es5/locale/fr';
|
||||
import pl from 'vuetify/es5/locale/pl';
|
||||
import sv from 'vuetify/es5/locale/sv';
|
||||
import de from 'vuetify/es5/locale/de';
|
||||
|
||||
const vuetify = new Vuetify({
|
||||
theme: {
|
||||
dark: false,
|
||||
|
@ -29,6 +35,12 @@ const vuetify = new Vuetify({
|
|||
},
|
||||
},
|
||||
},
|
||||
lang: {
|
||||
locales: {
|
||||
fr, pl, sv, de
|
||||
},
|
||||
current: 'en',
|
||||
},
|
||||
});
|
||||
|
||||
export default vuetify;
|
||||
|
|
|
@ -46,8 +46,9 @@ const mutations = {
|
|||
};
|
||||
|
||||
const actions = {
|
||||
initLang({ getters }) {
|
||||
initLang({ getters }, { currentVueComponent }) {
|
||||
VueI18n.locale = getters.getActiveLang;
|
||||
currentVueComponent.$vuetify.lang.current = getters.getActiveLang;
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue