mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-04 02:39:14 +02:00
feat:#60 added localization switch
This commit is contained in:
17
frontend/src/store/localeStore.ts
Normal file
17
frontend/src/store/localeStore.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { useLocalStorage } from "@vueuse/core"
|
||||
|
||||
const localeStore = defineStore("localeStore", {
|
||||
state: () => {
|
||||
return {
|
||||
locale: useLocalStorage('locale', "en"), //useLocalStorage takes in a key of 'count' and default value of 0
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
setLocale(locale: string) {
|
||||
this.locale = locale;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default localeStore;
|
Reference in New Issue
Block a user