15 localization with translation strings

This commit is contained in:
survellow
2023-11-30 17:32:57 +01:00
parent 1f41abff8b
commit 70a86bc5ca
4 changed files with 66 additions and 20 deletions

View File

@ -1,9 +1,11 @@
<script lang="ts" setup>
import { Ref, computed, ref } from "vue";
import moduleStore from "../store/moduleStore";
import { useI18n } from "vue-i18n";
const dialogVisible: Ref<boolean> = ref(false);
const mobilePage = ref(true);
const { t } = useI18n({ useScope: "global" });
const store = moduleStore();
const tableData = computed(() =>
@ -19,9 +21,9 @@ const previewOn: Ref<boolean> = computed(() => {
return moduleStore().modules.size > 0;
});
const columns = ref([
{ field: "Course", header: "Course" },
{ field: "Module", header: "Module" },
const columns = computed(() => [
{ field: "Course", header: t("calendarPreview.course") },
{ field: "Module", header: t("calendarPreview.module") },
]);
const updateMobile = () => {
@ -40,7 +42,7 @@ window.addEventListener("resize", updateMobile);
:visible="dialogVisible && previewOn"
:maximizable="!mobilePage"
:draggable="false"
header="Kalendervorschau"
:header="$t('calendarPreview.preview-long')"
class="w-full lg:w-30rem lg:h-auto m-0 lg:m-2"
position="bottomright"
@update:visible="dialogVisible = $event"
@ -71,7 +73,7 @@ window.addEventListener("resize", updateMobile);
<template #button>
<Button
icon="pi pi-calendar"
label="Preview"
:label="$t('calendarPreview.preview')"
class="p-button-rounded p-button-primary"
@click="dialogVisible = true"
/>