🌐 Add Localization feature

This commit is contained in:
2022-08-21 16:57:06 +02:00
parent 710a07b04b
commit 59a2c0eacb
17 changed files with 301 additions and 123 deletions

View File

@ -9,6 +9,7 @@ export const classFilter = ref(localStorage.getItem("classFilter") || "none");
export const timetableGroups = ref(
JSON.parse(localStorage.getItem("timetableGroups") || "[]")
);
export const language = ref(localStorage.getItem("lang")) || "en";
watch(classFilter, (newValue) => {
localStorage.setItem("classFilter", newValue);
@ -18,6 +19,10 @@ watch(timetableGroups, (newValue) => {
localStorage.setItem("timetableGroups", JSON.stringify(newValue));
fetchData();
});
watch(language, (newValue) => {
localStorage.setItem("lang", newValue);
location.reload();
});
export const selectedDate = ref(new Date(new Date().setUTCHours(0, 0, 0, 0)));
export const selectedDay = computed(() => selectedDate.value.getDay() - 1);