mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-24 07:15:24 -07:00
Make vuetify locales match with new VueI18n standard
This commit is contained in:
parent
c23ad6706c
commit
419b58e656
2 changed files with 19 additions and 7 deletions
|
@ -3,11 +3,16 @@ import Vuetify from "vuetify/lib";
|
||||||
|
|
||||||
Vue.use(Vuetify);
|
Vue.use(Vuetify);
|
||||||
|
|
||||||
|
// language IDs should match those from VueI18n with _ instead of -
|
||||||
|
import de_DE from 'vuetify/es5/locale/de';
|
||||||
|
import en_US from 'vuetify/es5/locale/en';
|
||||||
|
import fr_FR from 'vuetify/es5/locale/fr';
|
||||||
|
import pl_PL from 'vuetify/es5/locale/pl';
|
||||||
|
import pt_PT from 'vuetify/es5/locale/pt';
|
||||||
|
import sv_SE from 'vuetify/es5/locale/sv';
|
||||||
|
import zh_CN from 'vuetify/es5/locale/zh-Hans';
|
||||||
|
import zh_TW from 'vuetify/es5/locale/zh-Hant';
|
||||||
|
|
||||||
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: {
|
||||||
|
@ -37,9 +42,16 @@ const vuetify = new Vuetify({
|
||||||
},
|
},
|
||||||
lang: {
|
lang: {
|
||||||
locales: {
|
locales: {
|
||||||
fr, pl, sv, de
|
de_DE,
|
||||||
|
en_US,
|
||||||
|
fr_FR,
|
||||||
|
pl_PL,
|
||||||
|
pt_PT,
|
||||||
|
sv_SE,
|
||||||
|
zh_CN,
|
||||||
|
zh_TW
|
||||||
},
|
},
|
||||||
current: 'en',
|
current: 'en_US',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ const mutations = {
|
||||||
const actions = {
|
const actions = {
|
||||||
initLang({ getters }, { currentVueComponent }) {
|
initLang({ getters }, { currentVueComponent }) {
|
||||||
VueI18n.locale = getters.getActiveLang;
|
VueI18n.locale = getters.getActiveLang;
|
||||||
currentVueComponent.$vuetify.lang.current = getters.getActiveLang;
|
currentVueComponent.$vuetify.lang.current = getters.getActiveLang.replace('-', '_');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue