mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
feat:#16 added translation for button and toast
This commit is contained in:
@@ -27,7 +27,8 @@
|
|||||||
"dropDownSelect": "Bitte wähle einen Raum aus",
|
"dropDownSelect": "Bitte wähle einen Raum aus",
|
||||||
"noRoomsAvailable": "Keine Räume verfügbar",
|
"noRoomsAvailable": "Keine Räume verfügbar",
|
||||||
"available": "verfügbar",
|
"available": "verfügbar",
|
||||||
"occupied": "belegt"
|
"occupied": "belegt",
|
||||||
|
"roomIcal": "iCal für "
|
||||||
},
|
},
|
||||||
"freeRooms": {
|
"freeRooms": {
|
||||||
"freeRooms": "Freie Räume",
|
"freeRooms": "Freie Räume",
|
||||||
|
@@ -27,7 +27,8 @@
|
|||||||
"dropDownSelect": "please select a room",
|
"dropDownSelect": "please select a room",
|
||||||
"noRoomsAvailable": "no rooms listed",
|
"noRoomsAvailable": "no rooms listed",
|
||||||
"available": "available",
|
"available": "available",
|
||||||
"occupied": "occupied"
|
"occupied": "occupied",
|
||||||
|
"roomIcal": "iCal for "
|
||||||
},
|
},
|
||||||
"freeRooms": {
|
"freeRooms": {
|
||||||
"freeRooms": "free rooms",
|
"freeRooms": "free rooms",
|
||||||
|
@@ -23,6 +23,28 @@ import DynamicPage from "@/view/DynamicPage.vue";
|
|||||||
import RoomOccupation from "@/components/RoomOccupation.vue";
|
import RoomOccupation from "@/components/RoomOccupation.vue";
|
||||||
import { computedAsync } from "@vueuse/core";
|
import { computedAsync } from "@vueuse/core";
|
||||||
import { router } from "@/main";
|
import { router } from "@/main";
|
||||||
|
import { useI18n } from "vue-i18n";
|
||||||
|
import { useToast } from "primevue/usetoast";
|
||||||
|
const { t } = useI18n({ useScope: "global" });
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
|
const show = () => {
|
||||||
|
toast.add({
|
||||||
|
severity: "info",
|
||||||
|
summary: t("calendarLink.copyToastSummary"),
|
||||||
|
detail: t("calendarLink.copyToastNotification"),
|
||||||
|
life: 3000,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const failedClipboard = () => {
|
||||||
|
toast.add({
|
||||||
|
severity: "error",
|
||||||
|
summary: t("calendarLink.copyToastError"),
|
||||||
|
detail: t("calendarLink.copyToastErrorDetail"),
|
||||||
|
life: 3000,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
type Room = {
|
type Room = {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -90,13 +112,13 @@ const getLink = (selectedRoom: string) =>
|
|||||||
|
|
||||||
const button = computed(() => {
|
const button = computed(() => {
|
||||||
return {
|
return {
|
||||||
label: "Copy iCal Link for" + selectedRoom.value.name,
|
label: t("roomFinderPage.roomIcal") + selectedRoom.value.name,
|
||||||
icon: "pi pi-calendar",
|
icon: "pi pi-clone",
|
||||||
disabled: selectedRoom.value.name === "",
|
disabled: selectedRoom.value.name === "",
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
// Copy iCal link to clipboard
|
// Copy iCal link to clipboard
|
||||||
// localhost/api/feed/room?id=selectedRoom.value.name
|
// localhost/api/feed/room?id=selectedRoom.value.name
|
||||||
navigator.clipboard.writeText(getLink(selectedRoom.value.name));
|
navigator.clipboard.writeText(getLink(selectedRoom.value.name)).then(show, () => failedClipboard())
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user