mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 02:09:15 +02:00
feat:#60 added more localization
This commit is contained in:
@@ -3,6 +3,9 @@ import tokenStore from "../store/tokenStore.ts";
|
|||||||
import { useToast } from "primevue/usetoast";
|
import { useToast } from "primevue/usetoast";
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
const { t } = useI18n({ useScope: 'global' })
|
||||||
|
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
|
||||||
const domain = window.location.hostname;
|
const domain = window.location.hostname;
|
||||||
@@ -12,8 +15,8 @@ const getLink = () => "https://" + domain + "/api/feed?token=" + tokenStore().to
|
|||||||
const show = () => {
|
const show = () => {
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: "info",
|
severity: "info",
|
||||||
summary: "Info",
|
summary: t('calendarLink.copyToastSummary'),
|
||||||
detail: "Link copied to clipboard",
|
detail: t('calendarLink.copyToastNotification'),
|
||||||
life: 3000,
|
life: 3000,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -36,8 +39,8 @@ function copyToClipboard() {
|
|||||||
console.error("Could not copy text: ", err);
|
console.error("Could not copy text: ", err);
|
||||||
toast.add({
|
toast.add({
|
||||||
severity: "error",
|
severity: "error",
|
||||||
summary: "Error",
|
summary: t('calendarLink.copyToastError'),
|
||||||
detail: "Could not copy text",
|
detail: t('calendarLink.copyToastErrorDetail'),
|
||||||
life: 3000,
|
life: 3000,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -54,17 +57,17 @@ const forwardToMicrosoft = () => {
|
|||||||
|
|
||||||
const actions = [
|
const actions = [
|
||||||
{
|
{
|
||||||
label: "Copy to Clipboard",
|
label: t('calendarLink.copyToClipboard'),
|
||||||
icon: "pi pi-copy",
|
icon: "pi pi-copy",
|
||||||
command: copyToClipboard,
|
command: copyToClipboard,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "To Google Calendar",
|
label: t('calendarLink.toGoogleCalendar'),
|
||||||
icon: "pi pi-google",
|
icon: "pi pi-google",
|
||||||
command: forwardToGoogle,
|
command: forwardToGoogle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "To Microsoft Calendar",
|
label: t('calendarLink.toMicrosoftCalendar'),
|
||||||
icon: "pi pi-microsoft",
|
icon: "pi pi-microsoft",
|
||||||
command: forwardToMicrosoft,
|
command: forwardToMicrosoft,
|
||||||
},
|
},
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ComputedRef, Ref, ref } from "vue";
|
import { computed, ComputedRef, Ref, ref, watch } from "vue";
|
||||||
import {
|
import {
|
||||||
fetchCourse,
|
fetchCourse,
|
||||||
fetchModulesByCourseAndSemester,
|
fetchModulesByCourseAndSemester,
|
||||||
@@ -26,6 +26,11 @@ const selectedSemester: Ref<{ name: string; value: string }> = ref(
|
|||||||
semesters.value[0],
|
semesters.value[0],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//if semesters get changed, refresh the selected semester ref with a watcher
|
||||||
|
watch(semesters,(newValue: { name: string; value: string }[]) =>
|
||||||
|
(selectedSemester.value = newValue[selectedSemester.value.value === "ws" ? 0 : 1]),
|
||||||
|
);
|
||||||
|
|
||||||
courses().then(
|
courses().then(
|
||||||
(data) =>
|
(data) =>
|
||||||
(countries.value = data.map((course) => {
|
(countries.value = data.map((course) => {
|
||||||
|
@@ -1,18 +1,22 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Ref, ref } from "vue";
|
import { computed, Ref, ref } from "vue";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
const { t } = useI18n({ useScope: 'global' })
|
||||||
|
|
||||||
const helpVisible: Ref<boolean> = ref(false);
|
const helpVisible: Ref<boolean> = ref(false);
|
||||||
|
|
||||||
const placeholders = ref([
|
const placeholders = computed(() => [
|
||||||
{
|
{
|
||||||
placeholder: "%t",
|
placeholder: "%t",
|
||||||
description: "Event Type",
|
description: t('moduleTemplateDialog.eventTyp'),
|
||||||
examples: "V = Vorlesung, S = Seminar, P = Praktikum/Prüfung",
|
examples: "V = "+t('moduleTemplateDialog.lecture')+
|
||||||
|
", S = "+t('moduleTemplateDialog.seminar')+
|
||||||
|
", P = "+t('moduleTemplateDialog.exam'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
placeholder: "%p",
|
placeholder: "%p",
|
||||||
description: "Mandatory",
|
description: t('moduleTemplateDialog.mandatory'),
|
||||||
examples: "w = optional, p = mandatory",
|
examples: "w = "+t('moduleTemplateDialog.optional')+", p = "+t('moduleTemplateDialog.mandatory'),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
@@ -28,20 +32,18 @@ const placeholders = ref([
|
|||||||
aria-label="Help"
|
aria-label="Help"
|
||||||
@click="helpVisible = true"
|
@click="helpVisible = true"
|
||||||
/>
|
/>
|
||||||
<Dialog v-model:visible="helpVisible" header="Module configuration">
|
<Dialog v-model:visible="helpVisible" :header="$t('moduleTemplateDialog.moduleConfiguration')">
|
||||||
<p>
|
<p>
|
||||||
Here you can rename your modules to your liking. This will be the name of
|
{{ t('moduleTemplateDialog.explanationOne')}}
|
||||||
the event in your calendar.
|
|
||||||
</p>
|
</p>
|
||||||
<p>You can use the following placeholders in your module names:</p>
|
<p>{{ t('moduleTemplateDialog.tableDescription')}}</p>
|
||||||
<DataTable :value="placeholders">
|
<DataTable :value="placeholders">
|
||||||
<Column field="placeholder" header="Placeholder"></Column>
|
<Column field="placeholder" :header="$t('moduleTemplateDialog.placeholder')"></Column>
|
||||||
<Column field="description" header="Description"></Column>
|
<Column field="description" :header="$t('moduleTemplateDialog.description')"></Column>
|
||||||
<Column field="examples" header="Examples"></Column>
|
<Column field="examples" :header="$t('moduleTemplateDialog.examples')"></Column>
|
||||||
</DataTable>
|
</DataTable>
|
||||||
<p>
|
<p>
|
||||||
Additionally, you can toggle notifications for each module. If you do so,
|
{{ t('moduleTemplateDialog.explanationTwo')}}
|
||||||
you will be notified 15 minutes before the event starts.
|
|
||||||
</p>
|
</p>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -3,9 +3,12 @@ import moduleStore from "../store/moduleStore.ts";
|
|||||||
import { createIndividualFeed } from "../api/createFeed.ts";
|
import { createIndividualFeed } from "../api/createFeed.ts";
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
import tokenStore from "../store/tokenStore.ts";
|
import tokenStore from "../store/tokenStore.ts";
|
||||||
import { ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
import ModuleTemplateDialog from "./ModuleTemplateDialog.vue";
|
import ModuleTemplateDialog from "./ModuleTemplateDialog.vue";
|
||||||
import { onlyWhitespace } from "../helpers/strings.ts";
|
import { onlyWhitespace } from "../helpers/strings.ts";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
const { t } = useI18n({ useScope: 'global' })
|
||||||
|
|
||||||
|
|
||||||
const tableData = ref(
|
const tableData = ref(
|
||||||
moduleStore().modules.map((module) => {
|
moduleStore().modules.map((module) => {
|
||||||
@@ -16,10 +19,10 @@ const tableData = ref(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
const columns = ref([
|
const columns = computed(() => [
|
||||||
{ field: "Course", header: "Course" },
|
{ field: "Course", header: t('moduleInformation.course') },
|
||||||
{ field: "Module", header: "Module" },
|
{ field: "Module", header: t('moduleInformation.module') },
|
||||||
{ field: "Reminder", header: "Reminder" },
|
{ field: "Reminder", header: t('renameModules.reminder') },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
async function finalStep() {
|
async function finalStep() {
|
||||||
@@ -32,7 +35,7 @@ async function finalStep() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-column">
|
<div class="flex flex-column">
|
||||||
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
||||||
<h3>Configure your selected Modules to your liking.</h3>
|
<h3>{{$t('renameModules.subTitle')}}</h3>
|
||||||
<ModuleTemplateDialog />
|
<ModuleTemplateDialog />
|
||||||
</div>
|
</div>
|
||||||
<div class="card flex align-items-center justify-content-center m-2">
|
<div class="card flex align-items-center justify-content-center m-2">
|
||||||
@@ -44,7 +47,7 @@ async function finalStep() {
|
|||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex align-items-center justify-content-end">
|
<div class="flex align-items-center justify-content-end">
|
||||||
Enable all notifications:
|
{{$t('renameModules.enableAllNotifications')}}
|
||||||
<InputSwitch
|
<InputSwitch
|
||||||
class="mx-4"
|
class="mx-4"
|
||||||
:model-value="
|
:model-value="
|
||||||
@@ -99,10 +102,6 @@ async function finalStep() {
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="field === 'Reminder'">
|
<template v-else-if="field === 'Reminder'">
|
||||||
<!--<InputSwitch
|
|
||||||
v-model="data.Module.reminder"
|
|
||||||
class="align-self-center"
|
|
||||||
/>-->
|
|
||||||
<Button
|
<Button
|
||||||
:icon="data.Module.reminder ? 'pi pi-bell' : 'pi pi-times'"
|
:icon="data.Module.reminder ? 'pi pi-bell' : 'pi pi-times'"
|
||||||
:severity="data.Module.reminder ? 'warning' : 'secondary'"
|
:severity="data.Module.reminder ? 'warning' : 'secondary'"
|
||||||
@@ -121,7 +120,7 @@ async function finalStep() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
||||||
<Button @click="finalStep()">Next Step</Button>
|
<Button @click="finalStep()">{{$t('renameModules.nextStep')}}</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -25,15 +25,18 @@
|
|||||||
},
|
},
|
||||||
"moduleSelection":{
|
"moduleSelection":{
|
||||||
"nextStep": "Weiter",
|
"nextStep": "Weiter",
|
||||||
"selectAll": "Wähle alle aus",
|
"selectAll": "Alle anwählen",
|
||||||
"deselectAll": "Alle abwählen",
|
"deselectAll": "Alle abwählen",
|
||||||
|
"selected": "angewählt",
|
||||||
|
"unselected": "abgewählt",
|
||||||
"noModulesAvailable": "Keine Module verfügbar",
|
"noModulesAvailable": "Keine Module verfügbar",
|
||||||
"modules": "Module"
|
"modules": "Module"
|
||||||
},
|
},
|
||||||
"moduleInformation": {
|
"moduleInformation": {
|
||||||
"course": "Kurs",
|
"course": "Kurs",
|
||||||
"person": "Person",
|
"person": "Dozent",
|
||||||
"semester": "Semester"
|
"semester": "Semester",
|
||||||
|
"module": "Modul"
|
||||||
},
|
},
|
||||||
"editCalendarView": {
|
"editCalendarView": {
|
||||||
"error": "Fehler",
|
"error": "Fehler",
|
||||||
@@ -47,5 +50,35 @@
|
|||||||
"dropDownFooterItem": "Module",
|
"dropDownFooterItem": "Module",
|
||||||
"dropDownFooterSelected": "ausgewählt",
|
"dropDownFooterSelected": "ausgewählt",
|
||||||
"nextStep": "Weiter"
|
"nextStep": "Weiter"
|
||||||
|
},
|
||||||
|
"renameModules": {
|
||||||
|
"reminder": "Erinnerung",
|
||||||
|
"enableAllNotifications": "Alle Benachrichtigungen aktivieren",
|
||||||
|
"subTitle": "Konfigurieren Sie die ausgewählten Module nach Ihren Wünschen.",
|
||||||
|
"nextStep": "Weiter"
|
||||||
|
},
|
||||||
|
"moduleTemplateDialog":{
|
||||||
|
"explanationOne": "Hier können Module nach Wunsch umbenannt werden. Welche dann als Anzeigename im Kalender dargestellt werden.",
|
||||||
|
"explanationTwo": "Zusätzlich können Sie Benachrichtigungen für jedes Modul einschalten, damit für jeden Termin 15 Minuten vor Beginn einen Erinnerung geschalten wird.",
|
||||||
|
"tableDescription": "Sie können die folgenden Platzhalter in Ihren Modulnamen verwenden:",
|
||||||
|
"placeholder": "Platzhalter",
|
||||||
|
"description": "Beschreibung",
|
||||||
|
"examples": "Beispiele",
|
||||||
|
"moduleConfiguration": "Modulkonfiguration",
|
||||||
|
"mandatory": "Verpflichtend",
|
||||||
|
"optional": "Optional",
|
||||||
|
"lecture": "Vorlesung",
|
||||||
|
"seminar": "Seminar",
|
||||||
|
"exam": "Prüfung/Praktikum",
|
||||||
|
"eventTyp": "Ereignistyp"
|
||||||
|
},
|
||||||
|
"calendarLink": {
|
||||||
|
"copyToastNotification": "Link in Zwischenablage kopiert",
|
||||||
|
"copyToastSummary": "Information",
|
||||||
|
"copyToastError": "Fehler",
|
||||||
|
"copyToastErrorDetail": "Link konnte nicht in Zwischenablage kopiert werden",
|
||||||
|
"copyToClipboard": "Link kopieren",
|
||||||
|
"toGoogleCalendar": "Google Kalender",
|
||||||
|
"toMicrosoftCalendar": "Microsoft Kalender"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -34,8 +34,9 @@
|
|||||||
},
|
},
|
||||||
"moduleInformation": {
|
"moduleInformation": {
|
||||||
"course": "course",
|
"course": "course",
|
||||||
"person": "person",
|
"person": "lecturer",
|
||||||
"semester": "semester"
|
"semester": "semester",
|
||||||
|
"module": "module"
|
||||||
},
|
},
|
||||||
"editCalendarView": {
|
"editCalendarView": {
|
||||||
"error": "error",
|
"error": "error",
|
||||||
@@ -49,5 +50,35 @@
|
|||||||
"dropDownFooterItem": "modules",
|
"dropDownFooterItem": "modules",
|
||||||
"dropDownFooterSelected": "selected",
|
"dropDownFooterSelected": "selected",
|
||||||
"nextStep": "next step"
|
"nextStep": "next step"
|
||||||
|
},
|
||||||
|
"renameModules": {
|
||||||
|
"reminder": "reminder",
|
||||||
|
"enableAllNotifications": "enable all notifications",
|
||||||
|
"subTitle": "Configure your selected Modules to your liking.",
|
||||||
|
"nextStep": "next step"
|
||||||
|
},
|
||||||
|
"moduleTemplateDialog":{
|
||||||
|
"explanationOne": "Here you can rename your modules to your liking. This will be the name of the event in your calendar.",
|
||||||
|
"explanationTwo": "Additionally, you can toggle notifications for each module. If you do so, you will be notified 15 minutes before the event starts.",
|
||||||
|
"tableDescription": "You can use the following placeholders in your module names:",
|
||||||
|
"placeholder": "placeholder",
|
||||||
|
"description": "description",
|
||||||
|
"examples": "examples",
|
||||||
|
"moduleConfiguration": "module configuration",
|
||||||
|
"mandatory": "mandatory",
|
||||||
|
"optional": "optional",
|
||||||
|
"lecture": "lecture",
|
||||||
|
"seminar": "seminar",
|
||||||
|
"exam": "exam/internship project",
|
||||||
|
"eventTyp": "event type"
|
||||||
|
},
|
||||||
|
"calendarLink": {
|
||||||
|
"copyToastNotification": "Link copied to clipboard",
|
||||||
|
"copyToastSummary": "information",
|
||||||
|
"copyToastError": "error",
|
||||||
|
"copyToastErrorDetail": "could not copy link to clipboard",
|
||||||
|
"copyToClipboard": "copy to clipboard",
|
||||||
|
"toGoogleCalendar": "to Google Calendar",
|
||||||
|
"toMicrosoftCalendar": "to Microsoft Calendar"
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user