feat:#60 added localization switch

This commit is contained in:
masterelmar
2023-11-15 12:46:56 +01:00
parent 3f1a592468
commit 00399c32d9
11 changed files with 204 additions and 98 deletions

View File

@@ -1,11 +1,14 @@
<script lang="ts" setup>
import { Ref, ref } from "vue";
import { computed, ComputedRef, Ref, ref } from "vue";
import {
fetchCourse,
fetchModulesByCourseAndSemester,
} from "../api/fetchCourse";
import ModuleSelection from "./ModuleSelection.vue";
import { Module } from "../model/module.ts";
import { useI18n } from "vue-i18n";
const { t } = useI18n({ useScope: 'global' })
const courses = async () => {
return await fetchCourse();
@@ -13,9 +16,9 @@ const courses = async () => {
const selectedCourse: Ref<{ name: string }> = ref({ name: "" });
const countries: Ref<{ name: string }[]> = ref([]);
const semesters: Ref<{ name: string; value: string }[]> = ref([
{ name: "Wintersemester", value: "ws" },
{ name: "Sommersemester", value: "ss" },
const semesters: ComputedRef<{ name: string; value: string }[]> = computed(() =>[
{ name: t('courseSelection.winterSemester'), value: "ws" },
{ name: t('courseSelection.summerSemester'), value: "ss" },
]);
const selectedSemester: Ref<{ name: string; value: string }> = ref(
@@ -53,7 +56,7 @@ async function getModules() {
<div
class="flex align-items-center justify-content-center h-4rem border-round m-2"
>
<h5 class="text-2xl">Please select a course</h5>
<h5 class="text-2xl">{{ $t('courseSelection.selectCourse') }}</h5>
</div>
<div
class="flex align-items-center justify-content-center border-round m-2"