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.search = !this.search;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.$store.dispatch("initLang");
|
this.$store.dispatch("initLang", { currentVueComponent: this });
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
<v-date-picker
|
<v-date-picker
|
||||||
v-model="startDate"
|
v-model="startDate"
|
||||||
no-title
|
no-title
|
||||||
:locale="$i18n.locale"
|
|
||||||
@input="menu2 = false"
|
@input="menu2 = false"
|
||||||
></v-date-picker>
|
></v-date-picker>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
@ -59,7 +58,6 @@
|
||||||
<v-date-picker
|
<v-date-picker
|
||||||
v-model="endDate"
|
v-model="endDate"
|
||||||
no-title
|
no-title
|
||||||
:locale="$i18n.locale"
|
|
||||||
@input="menu2 = false"
|
@input="menu2 = false"
|
||||||
></v-date-picker>
|
></v-date-picker>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
|
@ -3,6 +3,12 @@ import Vuetify from "vuetify/lib";
|
||||||
|
|
||||||
Vue.use(Vuetify);
|
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({
|
const vuetify = new Vuetify({
|
||||||
theme: {
|
theme: {
|
||||||
dark: false,
|
dark: false,
|
||||||
|
@ -29,6 +35,12 @@ const vuetify = new Vuetify({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
lang: {
|
||||||
|
locales: {
|
||||||
|
fr, pl, sv, de
|
||||||
|
},
|
||||||
|
current: 'en',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default vuetify;
|
export default vuetify;
|
||||||
|
|
|
@ -46,8 +46,9 @@ const mutations = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
initLang({ getters }) {
|
initLang({ getters }, { currentVueComponent }) {
|
||||||
VueI18n.locale = getters.getActiveLang;
|
VueI18n.locale = getters.getActiveLang;
|
||||||
|
currentVueComponent.$vuetify.lang.current = getters.getActiveLang;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue