mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-04 01:15:19 -05:00
Migration redesign (#119)
* migration redesign init * new color picker * changelog * added UI language selection * fix layout issue on recipe editor * remove git as dependency * added UI editor for original URL * CI/CD Tests * test: fixed migration routes Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
44
frontend/src/store/modules/language.js
Normal file
44
frontend/src/store/modules/language.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import VueI18n from "../../i18n";
|
||||
|
||||
const state = {
|
||||
lang: "en",
|
||||
allLangs: [
|
||||
{
|
||||
name: "English",
|
||||
value: "en",
|
||||
},
|
||||
{
|
||||
name: "Dutch",
|
||||
value: "da",
|
||||
},
|
||||
{
|
||||
name: "French",
|
||||
value: "fr",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
setLang(state, payload) {
|
||||
VueI18n.locale = payload;
|
||||
state.lang = payload;
|
||||
},
|
||||
};
|
||||
|
||||
const actions = {
|
||||
initLang({ getters }) {
|
||||
VueI18n.locale = getters.getActiveLang;
|
||||
},
|
||||
};
|
||||
|
||||
const getters = {
|
||||
getActiveLang: (state) => state.lang,
|
||||
getAllLangs: (state) => state.allLangs,
|
||||
};
|
||||
|
||||
export default {
|
||||
state,
|
||||
mutations,
|
||||
actions,
|
||||
getters,
|
||||
};
|
||||
Reference in New Issue
Block a user