feat:#60 added more localization

This commit is contained in:
masterElmar
2023-11-16 11:57:33 +01:00
parent 7e261438d5
commit f6b3ffe854
6 changed files with 113 additions and 40 deletions

View File

@@ -3,6 +3,9 @@ import tokenStore from "../store/tokenStore.ts";
import { useToast } from "primevue/usetoast";
import { onMounted } from "vue";
import router from "../router";
import { useI18n } from "vue-i18n";
const { t } = useI18n({ useScope: 'global' })
const toast = useToast();
const domain = window.location.hostname;
@@ -12,8 +15,8 @@ const getLink = () => "https://" + domain + "/api/feed?token=" + tokenStore().to
const show = () => {
toast.add({
severity: "info",
summary: "Info",
detail: "Link copied to clipboard",
summary: t('calendarLink.copyToastSummary'),
detail: t('calendarLink.copyToastNotification'),
life: 3000,
});
};
@@ -36,8 +39,8 @@ function copyToClipboard() {
console.error("Could not copy text: ", err);
toast.add({
severity: "error",
summary: "Error",
detail: "Could not copy text",
summary: t('calendarLink.copyToastError'),
detail: t('calendarLink.copyToastErrorDetail'),
life: 3000,
});
},
@@ -54,17 +57,17 @@ const forwardToMicrosoft = () => {
const actions = [
{
label: "Copy to Clipboard",
label: t('calendarLink.copyToClipboard'),
icon: "pi pi-copy",
command: copyToClipboard,
},
{
label: "To Google Calendar",
label: t('calendarLink.toGoogleCalendar'),
icon: "pi pi-google",
command: forwardToGoogle,
},
{
label: "To Microsoft Calendar",
label: t('calendarLink.toMicrosoftCalendar'),
icon: "pi pi-microsoft",
command: forwardToMicrosoft,
},