🚸 🐛 Fix HMR issues & change lang without reload

- Fix HMR issues due to circular import of "language" and "i18n"
- Move i18n to seperate file
- Dynamically update language instead of doing a full page reload
This commit is contained in:
2023-06-05 19:11:15 +02:00
parent d1910a7877
commit 7928e4941f
4 changed files with 26 additions and 18 deletions

View File

@ -5,9 +5,9 @@ import {
classFilter,
possibleTimetableGroups,
timetableGroups,
language,
theme,
} from "../store";
import { language } from "../i18n";
// eslint-disable-next-line no-undef
const gitHash = GITVERSION;
@ -20,7 +20,11 @@ const gitHash = GITVERSION;
<p>{{ $t("settings.text.filtering") }}</p>
<select v-model="classFilter">
<option value="none">{{ $t("timetable.setup.prompt") }}</option>
<option v-for="option in classList" :value="option" :key="option">
<option
v-for="option in classList.length > 0 ? classList : [classFilter]"
:value="option"
:key="option"
>
{{ option }}
</option>
<option value="other">{{ $t("settings.other") }}</option>