From 39d682383c2d3bee69182f6ede9e979b6ab86b01 Mon Sep 17 00:00:00 2001 From: callumalpass Date: Mon, 6 Oct 2025 17:35:08 +1100 Subject: [PATCH] feat: add i18n support for Bases Calendar features - Add new i18n keys for Bases Calendar view (buttons, errors) - Add i18n keys for Property Event Card - Add comprehensive i18n keys for Advanced Calendar view including: - Filter toggles - View options (timeblocks, time entries, scheduled/due dates) - Buttons and notices - Timeblock operations (create, move, resize) - Time entry management - Context menu items - Update all user-facing strings in calendar-view.ts, PropertyEventCard.ts, and AdvancedCalendarView.ts to use i18n translations - Run i18n:sync to update manifest and state files --- i18n.manifest.json | 51 +++++ i18n.state.json | 306 ++++++++++++++++++++++++++++++ src/bases/calendar-view.ts | 20 +- src/i18n/resources/en.ts | 73 +++++++ src/ui/PropertyEventCard.ts | 2 +- src/views/AdvancedCalendarView.ts | 114 +++++++---- 6 files changed, 515 insertions(+), 51 deletions(-) diff --git a/i18n.manifest.json b/i18n.manifest.json index 6cc60e15..0f083043 100644 --- a/i18n.manifest.json +++ b/i18n.manifest.json @@ -60,6 +60,56 @@ "views.notes.empty.noNotesFound": "9e2f5f8952ae7fb4bf2669ff4c73cee07e32ce53", "views.miniCalendar.title": "a3cc5b7724a714d5620c6e9ef5f851c143022178", "views.advancedCalendar.title": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", + "views.advancedCalendar.filters.showFilters": "b1ad23eb8650c000bf826d5bfa41ddd8709e9096", + "views.advancedCalendar.filters.hideFilters": "4b97b05ba50bb5e22999f7465be01a16fb5c5dfc", + "views.advancedCalendar.viewOptions.calendarSubscriptions": "9b99ca62a8c206aeef3199afeb8c2d6ea70c3c3a", + "views.advancedCalendar.viewOptions.timeEntries": "2367ebf083af8b709878dfb6b2603726d99f1860", + "views.advancedCalendar.viewOptions.timeblocks": "2bbaa0ba121390600edaf00a9d6ddd701149646a", + "views.advancedCalendar.viewOptions.scheduledDates": "649cafef92532ca059c39cd54b95b865bc808505", + "views.advancedCalendar.viewOptions.dueDates": "1e24cb73d2f5fd9a48411ccaeb58088c38d0e677", + "views.advancedCalendar.viewOptions.allDaySlot": "e8ef14f3ed7f630bde84272df46b8a9c21817a4a", + "views.advancedCalendar.viewOptions.scheduledTasks": "417b1aedac957bc15982e560e5edb0e77e595174", + "views.advancedCalendar.viewOptions.recurringTasks": "55fca782e4e70a77c4ea8e0cde12fa8e34a66fd5", + "views.advancedCalendar.buttons.refresh": "56e3badc4e6c5cc95e0ea5a9a878b9bd09f319d4", + "views.advancedCalendar.buttons.refreshHint": "8782c944728c04072190e694667351c7e66a3453", + "views.advancedCalendar.notices.icsServiceNotAvailable": "23e97cd33f97a443133685a5e2a46690ae9c98b2", + "views.advancedCalendar.notices.calendarRefreshedAll": "86a603b25bbf73b2583b74aed13b76ee62ff49e2", + "views.advancedCalendar.notices.refreshFailed": "592a19ff0403951ace3cff938ed7d5205a9fd7f6", + "views.advancedCalendar.notices.timeblockSpecificTime": "59875e6bb4c37d603251eef5c4ef092e2f866a40", + "views.advancedCalendar.notices.timeblockMoved": "a5018dd2670d617d7bcf30c6ecda28507ca01ef5", + "views.advancedCalendar.notices.timeblockUpdated": "c6a22117ac857d272eb4d8352f9b0056d5180af4", + "views.advancedCalendar.notices.timeblockMoveFailed": "52440e4e251894bd845692b5fc3fba88b0087e0e", + "views.advancedCalendar.notices.timeblockResized": "4a72e2295f6022af16a6a7db96f8a3dfd68ba435", + "views.advancedCalendar.notices.timeblockResizeFailed": "4f59f13365a384e5e61748ffb8f176300e3f94a4", + "views.advancedCalendar.notices.taskScheduled": "3c3d491d54f4aa7dac1ac6b3047775211fb6d4ed", + "views.advancedCalendar.notices.scheduleTaskFailed": "73ddf3c08fb02842751fc7f43da61c25ee20fbe6", + "views.advancedCalendar.notices.endTimeAfterStart": "468339327f19d1060b77fff4957224707e821025", + "views.advancedCalendar.notices.timeEntryNotFound": "9f67e05e6524702ffddaa0f901aef7530233de75", + "views.advancedCalendar.notices.timeEntryDeleted": "914de749024db319c11a41942dd0ef811daf7a1e", + "views.advancedCalendar.notices.deleteTimeEntryFailed": "0b94f0d5614d275e95d3d6c6758e5eef650ca7eb", + "views.advancedCalendar.timeEntry.estimatedSuffix": "781012cf77ddb2bda8f753acb966b20ceb58401b", + "views.advancedCalendar.timeEntry.trackedSuffix": "4c54cc4d8b2e8d1062d92fad1ad9389fbe33c1ae", + "views.advancedCalendar.timeEntry.recurringPrefix": "c3bd7a97068e03157188fdabd053274e5a615ae0", + "views.advancedCalendar.timeEntry.completedPrefix": "9eb7ebd9c53ce14af025a3731610e1217244b380", + "views.advancedCalendar.timeEntry.createdPrefix": "e09271eeb7ec2f4aadefc9b4ea851f1e7a1c6a45", + "views.advancedCalendar.timeEntry.modifiedPrefix": "74cc96092fb742901ea283cf5ad84222d5797570", + "views.advancedCalendar.timeEntry.duePrefix": "29f9b627bf05896ea5c9c2271e2007691998e942", + "views.advancedCalendar.timeEntry.scheduledPrefix": "9a2c5f2ac079858ab1b707a5660739e0c3d39f01", + "views.advancedCalendar.contextMenus.openTask": "a1f1752a56b277c54c186afbdf4829b4b8109bf0", + "views.advancedCalendar.contextMenus.deleteTimeEntry": "a8a028ddc7caeff05f6193ed5b5a51a34b963fe0", + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": "c3ee9c29bbc9347f89084e07518ce64c17037ecf", + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": "fbefc6e49effaf889eb5c56ae48d2f2a1dc0355f", + "views.advancedCalendar.contextMenus.deleteButton": "f6fdbe48dc54dd86f63097a03bd24094dedd713a", + "views.advancedCalendar.contextMenus.cancelButton": "77dfd2135f4db726c47299bb55be26f7f4525a46", + "views.basesCalendar.title": "adc89f488953710c9133a9451e24713baabe9e88", + "views.basesCalendar.today": "24345a14377fd821d3932f4e82f6431640955b0b", + "views.basesCalendar.buttonText.month": "c63ae6dd4fc9f9dda66970e827d13f7c73fe841c", + "views.basesCalendar.buttonText.week": "e2415cb7f63df0c9de23362326ad3c37a9adfc96", + "views.basesCalendar.buttonText.day": "50c9e8d5fc98727b4bbc93cf5d64a68db647f04f", + "views.basesCalendar.buttonText.year": "23eb4d3f4155395a74e9d534f97ff4c1908f5aac", + "views.basesCalendar.buttonText.list": "d160e0986aca4714714a16f29ec605af90be704d", + "views.basesCalendar.buttonText.customDays": "aa73278ad78de284702c875cbe2d73ccb8f9c5d3", + "views.basesCalendar.errors.failedToInitialize": "72aed61f75cf862170b7a47f054f2ded50802aa7", "views.kanban.title": "3895546730917a6946acbef9a935ec44eb167ab7", "views.kanban.newTask": "17b2b838c5ce22c961a36736534a5029d6ba0087", "views.kanban.addCard": "a9621e58ec55a753b0d6bf9964ffeff4a4d8c16f", @@ -1224,6 +1274,7 @@ "ui.taskCard.loadingDependencies": "4b16fcf7520697bad098e32f62e9fe7ab4eee6fc", "ui.taskCard.blockingEmpty": "db8425e2473e42953533ea984a9819baa5a182ce", "ui.taskCard.blockingLoadError": "bf2839903d40700843ee6d42ee363cd98f74dfd5", + "ui.propertyEventCard.unknownFile": "b05d96bfbcef633c0d11626390d994c13bbf58d0", "ui.filterHeading.allViewName": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "ui.filterBar.saveView": "b4190583ca27890ac981f949f297fa935992a361", "ui.filterBar.saveViewNamePlaceholder": "588b34d448e6ec695ed48b5b6672835b1298ccae", diff --git a/i18n.state.json b/i18n.state.json index 6a3dbd1f..2493b30e 100644 --- a/i18n.state.json +++ b/i18n.state.json @@ -244,6 +244,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "b8eb78590eb52506601d9696b34b0bed27cbf750" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "3895546730917a6946acbef9a935ec44eb167ab7" @@ -4855,6 +4905,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "416c673a44b218e4deb751ab9547a91e2e17e654" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "4c7a986ffe2b7139e9c48df8ceb8e8e42ac24726" @@ -5794,6 +5845,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "eda863fa6d3616dbf53f79ee0f88d06e86ba6b6f" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "3895546730917a6946acbef9a935ec44eb167ab7" @@ -10405,6 +10506,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "ea75bda9950289522646f60a118631b8664049fb" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "a4114a83f4c6b03e326fda4a57471ca7c2d9fa96" @@ -11344,6 +11446,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "8241e64013516f3a26c53fccba0692b43df60338" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "89fa631aa01334f0cdbbfe97fb7b9df273091976" @@ -15889,6 +16041,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "65c097fd6dc78b3b367c7d8d216bf4a826221389" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "c5f641e4d1cc19bfedbfdf37bb7c1e13a471deb9" @@ -16828,6 +16981,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "769596d42919bbbf7e80b480bccc8dec736cb35c" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "aac432e010c04301f12f69c499d0dab775dccaea" @@ -21292,6 +21495,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "e11fa97001148e02b45549c6225f928c272a8a2f" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "c15ccc4dc7402834fbb2a008be5ab901ff3114ed" @@ -22231,6 +22435,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "841de01ceebc15f8de562f8ba5798e295753568f" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "66309b671dfd51f036ed30a4c5c4bf369bb35286" @@ -26743,6 +26997,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "7345eb158c9296fc17f6f07f6604cad6509fd3b1" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "fd08da7a630b6bbedbbb1a333d65423cbfdb2428" @@ -27682,6 +27937,56 @@ "source": "c7c0400a48b0a60163285b5a39460bd17d8f40f9", "translation": "d30e47d9102fbca9610686d941a97b7796ee2275" }, + "views.advancedCalendar.filters.showFilters": null, + "views.advancedCalendar.filters.hideFilters": null, + "views.advancedCalendar.viewOptions.calendarSubscriptions": null, + "views.advancedCalendar.viewOptions.timeEntries": null, + "views.advancedCalendar.viewOptions.timeblocks": null, + "views.advancedCalendar.viewOptions.scheduledDates": null, + "views.advancedCalendar.viewOptions.dueDates": null, + "views.advancedCalendar.viewOptions.allDaySlot": null, + "views.advancedCalendar.viewOptions.scheduledTasks": null, + "views.advancedCalendar.viewOptions.recurringTasks": null, + "views.advancedCalendar.buttons.refresh": null, + "views.advancedCalendar.buttons.refreshHint": null, + "views.advancedCalendar.notices.icsServiceNotAvailable": null, + "views.advancedCalendar.notices.calendarRefreshedAll": null, + "views.advancedCalendar.notices.refreshFailed": null, + "views.advancedCalendar.notices.timeblockSpecificTime": null, + "views.advancedCalendar.notices.timeblockMoved": null, + "views.advancedCalendar.notices.timeblockUpdated": null, + "views.advancedCalendar.notices.timeblockMoveFailed": null, + "views.advancedCalendar.notices.timeblockResized": null, + "views.advancedCalendar.notices.timeblockResizeFailed": null, + "views.advancedCalendar.notices.taskScheduled": null, + "views.advancedCalendar.notices.scheduleTaskFailed": null, + "views.advancedCalendar.notices.endTimeAfterStart": null, + "views.advancedCalendar.notices.timeEntryNotFound": null, + "views.advancedCalendar.notices.timeEntryDeleted": null, + "views.advancedCalendar.notices.deleteTimeEntryFailed": null, + "views.advancedCalendar.timeEntry.estimatedSuffix": null, + "views.advancedCalendar.timeEntry.trackedSuffix": null, + "views.advancedCalendar.timeEntry.recurringPrefix": null, + "views.advancedCalendar.timeEntry.completedPrefix": null, + "views.advancedCalendar.timeEntry.createdPrefix": null, + "views.advancedCalendar.timeEntry.modifiedPrefix": null, + "views.advancedCalendar.timeEntry.duePrefix": null, + "views.advancedCalendar.timeEntry.scheduledPrefix": null, + "views.advancedCalendar.contextMenus.openTask": null, + "views.advancedCalendar.contextMenus.deleteTimeEntry": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryTitle": null, + "views.advancedCalendar.contextMenus.deleteTimeEntryConfirm": null, + "views.advancedCalendar.contextMenus.deleteButton": null, + "views.advancedCalendar.contextMenus.cancelButton": null, + "views.basesCalendar.title": null, + "views.basesCalendar.today": null, + "views.basesCalendar.buttonText.month": null, + "views.basesCalendar.buttonText.week": null, + "views.basesCalendar.buttonText.day": null, + "views.basesCalendar.buttonText.year": null, + "views.basesCalendar.buttonText.list": null, + "views.basesCalendar.buttonText.customDays": null, + "views.basesCalendar.errors.failedToInitialize": null, "views.kanban.title": { "source": "3895546730917a6946acbef9a935ec44eb167ab7", "translation": "9dc1a19f2c82a4eb6d2adaba70db67268335ee34" @@ -32137,6 +32442,7 @@ "source": "bf2839903d40700843ee6d42ee363cd98f74dfd5", "translation": "463f189a0eae0a29eda0fa362b5ae36f65de1d00" }, + "ui.propertyEventCard.unknownFile": null, "ui.filterHeading.allViewName": { "source": "6a72085653e4c5be8c7640c868ef787cbcf063d1", "translation": "778fc8f99453571cd4d37d39955a1383c8224500" diff --git a/src/bases/calendar-view.ts b/src/bases/calendar-view.ts index 846786ae..3c93d0b9 100644 --- a/src/bases/calendar-view.ts +++ b/src/bases/calendar-view.ts @@ -963,18 +963,18 @@ export function buildTasknotesCalendarViewFactory(plugin: TaskNotesPlugin) { right: "multiMonthYear,dayGridMonth,timeGridWeek,timeGridCustom,timeGridDay,listWeek", }, buttonText: { - today: "Today", - month: "M", - week: "W", - day: "D", - year: "Y", - list: "L", + today: plugin.i18n.translate("views.basesCalendar.today"), + month: plugin.i18n.translate("views.basesCalendar.buttonText.month"), + week: plugin.i18n.translate("views.basesCalendar.buttonText.week"), + day: plugin.i18n.translate("views.basesCalendar.buttonText.day"), + year: plugin.i18n.translate("views.basesCalendar.buttonText.year"), + list: plugin.i18n.translate("views.basesCalendar.buttonText.list"), }, views: { timeGridCustom: { type: 'timeGrid', duration: { days: customDayCount }, - buttonText: `${customDayCount}D`, + buttonText: plugin.i18n.translate("views.basesCalendar.buttonText.customDays", { count: customDayCount.toString() }), }, }, height: "100%", @@ -1098,10 +1098,12 @@ export function buildTasknotesCalendarViewFactory(plugin: TaskNotesPlugin) { console.error("[TaskNotes][Bases][Calendar] Error initializing calendar:", error); // Show error message in the container if (calendarEl) { + const errorMessage = plugin.i18n.translate("views.basesCalendar.errors.failedToInitialize"); + const errorDetails = error instanceof Error ? error.message : String(error); calendarEl.innerHTML = `
-
Failed to initialize calendar
-
${error instanceof Error ? error.message : String(error)}
+
${errorMessage}
+
${errorDetails}
`; } diff --git a/src/i18n/resources/en.ts b/src/i18n/resources/en.ts index df04003e..d48a32e5 100644 --- a/src/i18n/resources/en.ts +++ b/src/i18n/resources/en.ts @@ -90,6 +90,76 @@ export const en: TranslationTree = { }, advancedCalendar: { title: "Advanced Calendar", + filters: { + showFilters: "Show filters", + hideFilters: "Hide filters", + }, + viewOptions: { + calendarSubscriptions: "Calendar subscriptions", + timeEntries: "Time entries", + timeblocks: "Timeblocks", + scheduledDates: "Scheduled dates", + dueDates: "Due dates", + allDaySlot: "All-day slot", + scheduledTasks: "Scheduled tasks", + recurringTasks: "Recurring tasks", + }, + buttons: { + refresh: "Refresh", + refreshHint: "Refresh Calendar Subscriptions", + }, + notices: { + icsServiceNotAvailable: "ICS subscription service not available", + calendarRefreshedAll: "All calendar subscriptions refreshed successfully", + refreshFailed: "Failed to refresh some calendar subscriptions", + timeblockSpecificTime: + "Timeblocks must have specific times. Please select a time range in week or day view.", + timeblockMoved: 'Moved timeblock "{title}" to {date}', + timeblockUpdated: 'Updated timeblock "{title}" time', + timeblockMoveFailed: "Failed to move timeblock: {message}", + timeblockResized: 'Updated timeblock "{title}" duration', + timeblockResizeFailed: "Failed to resize timeblock: {message}", + taskScheduled: 'Task "{title}" scheduled for {date}', + scheduleTaskFailed: "Failed to schedule task", + endTimeAfterStart: "End time must be after start time", + timeEntryNotFound: "Time entry not found", + timeEntryDeleted: "Time entry deleted", + deleteTimeEntryFailed: "Failed to delete time entry", + }, + timeEntry: { + estimatedSuffix: "estimated", + trackedSuffix: "tracked", + recurringPrefix: "Recurring: ", + completedPrefix: "Completed: ", + createdPrefix: "Created: ", + modifiedPrefix: "Modified: ", + duePrefix: "Due: ", + scheduledPrefix: "Scheduled: ", + }, + contextMenus: { + openTask: "Open task", + deleteTimeEntry: "Delete time entry", + deleteTimeEntryTitle: "Delete Time Entry", + deleteTimeEntryConfirm: + "Are you sure you want to delete this time entry{duration}? This action cannot be undone.", + deleteButton: "Delete", + cancelButton: "Cancel", + }, + }, + basesCalendar: { + title: "Bases Calendar", + today: "Today", + buttonText: { + month: "M", + week: "W", + day: "D", + year: "Y", + list: "L", + customDays: "{count}D", + }, + errors: { + failedToInitialize: "Failed to initialize calendar", + }, }, kanban: { title: "Kanban", @@ -2068,6 +2138,9 @@ export const en: TranslationTree = { blockingEmpty: "No dependent tasks", blockingLoadError: "Failed to load dependencies", }, + propertyEventCard: { + unknownFile: "Unknown file", + }, filterHeading: { allViewName: "All", }, diff --git a/src/ui/PropertyEventCard.ts b/src/ui/PropertyEventCard.ts index 7fe14f60..d04f2726 100644 --- a/src/ui/PropertyEventCard.ts +++ b/src/ui/PropertyEventCard.ts @@ -26,7 +26,7 @@ export function createPropertyEventCard( const file = entry.file; if (!file) { - card.textContent = "Unknown file"; + card.textContent = plugin.i18n.translate("ui.propertyEventCard.unknownFile"); return card; } diff --git a/src/views/AdvancedCalendarView.ts b/src/views/AdvancedCalendarView.ts index a5a78cb4..0c7ab59d 100644 --- a/src/views/AdvancedCalendarView.ts +++ b/src/views/AdvancedCalendarView.ts @@ -260,12 +260,16 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Create mobile collapse toggle (only visible on mobile) const mobileToggle = header.createDiv({ cls: "advanced-calendar-view__mobile-toggle" }); const toggleBtn = mobileToggle.createEl("button", { - text: this.headerCollapsed ? "Show filters" : "Hide filters", + text: this.headerCollapsed + ? this.plugin.i18n.translate("views.advancedCalendar.filters.showFilters") + : this.plugin.i18n.translate("views.advancedCalendar.filters.hideFilters"), cls: "advanced-calendar-view__collapse-btn", }); toggleBtn.addEventListener("click", () => { this.headerCollapsed = !this.headerCollapsed; - toggleBtn.textContent = this.headerCollapsed ? "Show filters" : "Hide filters"; + toggleBtn.textContent = this.headerCollapsed + ? this.plugin.i18n.translate("views.advancedCalendar.filters.showFilters") + : this.plugin.i18n.translate("views.advancedCalendar.filters.hideFilters"); this.saveViewPreferences(); this.updateHeaderVisibility(); }); @@ -367,7 +371,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { const options = [ { id: "icsEvents", - label: "Calendar subscriptions", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.calendarSubscriptions"), value: this.showICSEvents, onChange: (value: boolean) => { this.showICSEvents = value; @@ -377,7 +381,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { }, { id: "timeEntries", - label: "Time entries", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.timeEntries"), value: this.showTimeEntries, onChange: (value: boolean) => { this.showTimeEntries = value; @@ -387,7 +391,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { }, { id: "timeblocks", - label: "Timeblocks", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.timeblocks"), value: this.showTimeblocks, onChange: (value: boolean) => { this.showTimeblocks = value; @@ -397,7 +401,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { }, { id: "scheduled", - label: "Scheduled dates", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.scheduledDates"), value: this.showScheduled, onChange: (value: boolean) => { this.showScheduled = value; @@ -407,7 +411,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { }, { id: "due", - label: "Due dates", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.dueDates"), value: this.showDue, onChange: (value: boolean) => { this.showDue = value; @@ -417,7 +421,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { }, { id: "allDaySlot", - label: "All-day slot", + label: this.plugin.i18n.translate("views.advancedCalendar.viewOptions.allDaySlot"), value: this.showAllDaySlot, onChange: (value: boolean) => { this.showAllDaySlot = value; @@ -525,8 +529,8 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { private getCustomButtons() { const customButtons = { refreshICS: { - text: "Refresh", - hint: "Refresh Calendar Subscriptions", + text: this.plugin.i18n.translate("views.advancedCalendar.buttons.refresh"), + hint: this.plugin.i18n.translate("views.advancedCalendar.buttons.refreshHint"), click: () => { this.handleRefreshClick(); }, @@ -562,18 +566,18 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { private async handleRefreshClick() { if (!this.plugin.icsSubscriptionService) { - new Notice("ICS subscription service not available"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.icsServiceNotAvailable")); return; } try { await this.plugin.icsSubscriptionService.refreshAllSubscriptions(); - new Notice("All calendar subscriptions refreshed successfully"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.calendarRefreshedAll")); // Force calendar to re-render with updated ICS events this.refreshEvents(); } catch (error) { console.error("Error refreshing subscriptions:", error); - new Notice("Failed to refresh some calendar subscriptions"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.refreshFailed")); } } @@ -1223,9 +1227,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { private handleTimeblockCreation(start: Date, end: Date, allDay: boolean) { // Don't create timeblocks for all-day selections if (allDay) { - new Notice( - "Timeblocks must have specific times. Please select a time range in week or day view." - ); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockSpecificTime")); return; } @@ -1439,13 +1441,26 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Show success message if (originalDate !== newDate) { - new Notice(`Moved timeblock "${timeblock.title}" to ${newDate}`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockMoved", { + title: timeblock.title, + date: newDate, + }) + ); } else { - new Notice(`Updated timeblock "${timeblock.title}" time`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockUpdated", { + title: timeblock.title, + }) + ); } } catch (error) { console.error("Error moving timeblock:", error); - new Notice(`Failed to move timeblock: ${error.message}`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockMoveFailed", { + message: error.message, + }) + ); dropInfo.revert(); } } @@ -1512,7 +1527,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { const endMinutes = endHour * 60 + endMin; if (endMinutes <= startMinutes) { - new Notice("End time must be after start time"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.endTimeAfterStart")); resizeInfo.revert(); return; } @@ -1530,10 +1545,18 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Refresh calendar this.refreshEvents(); - new Notice(`Updated timeblock "${timeblock.title}" duration`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockResized", { + title: timeblock.title, + }) + ); } catch (error) { console.error("Error resizing timeblock:", error); - new Notice(`Failed to resize timeblock: ${error.message}`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.timeblockResizeFailed", { + message: error.message, + }) + ); resizeInfo.revert(); } } @@ -1594,7 +1617,12 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { : timeFormat === "12" ? "MMM d, yyyy h:mm a" : "MMM d, yyyy HH:mm"; - new Notice(`Task "${task.title}" scheduled for ${format(dropDate, dateFormat)}`); + new Notice( + this.plugin.i18n.translate("views.advancedCalendar.notices.taskScheduled", { + title: task.title, + date: format(dropDate, dateFormat), + }) + ); // Remove any event that FullCalendar might have created from the drop if (dropInfo.draggedEl) { @@ -1607,7 +1635,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Task drag-drop completed - ViewPerformanceService handles update } catch (error) { console.error("Error handling external drop:", error); - new Notice("Failed to schedule task"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.scheduleTaskFailed")); // Remove any event that might have been created on error if (dropInfo.draggedEl) { @@ -2157,24 +2185,24 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { this.renderTagsProperty(element, value); break; case "timeEstimate": - element.textContent = `${this.plugin.formatTime(value)} estimated`; + element.textContent = `${this.plugin.formatTime(value)} ${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.estimatedSuffix")}`; break; case "totalTrackedTime": if (value > 0) { - element.textContent = `${this.plugin.formatTime(value)} tracked`; + element.textContent = `${this.plugin.formatTime(value)} ${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.trackedSuffix")}`; } break; case "recurrence": - element.textContent = `Recurring: ${this.getRecurrenceDisplayText(value)}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.recurringPrefix")}${this.getRecurrenceDisplayText(value)}`; break; case "completedDate": - element.textContent = `Completed: ${this.formatDateForDisplay(value)}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.completedPrefix")}${this.formatDateForDisplay(value)}`; break; case "file.ctime": - element.textContent = `Created: ${this.formatDateForDisplay(value)}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.createdPrefix")}${this.formatDateForDisplay(value)}`; break; case "file.mtime": - element.textContent = `Modified: ${this.formatDateForDisplay(value)}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.modifiedPrefix")}${this.formatDateForDisplay(value)}`; break; default: // Handle user properties and generic values @@ -2202,7 +2230,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { showTime: true, userTimeFormat, }); - element.textContent = `Due: ${display}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.duePrefix")}${display}`; element.classList.add("fc-list-task-date", "fc-list-task-date--due"); // Add click handler for date editing (like TaskCard) @@ -2223,7 +2251,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { showTime: true, userTimeFormat, }); - element.textContent = `Scheduled: ${display}`; + element.textContent = `${this.plugin.i18n.translate("views.advancedCalendar.timeEntry.scheduledPrefix")}${display}`; element.classList.add("fc-list-task-date", "fc-list-task-date--scheduled"); } @@ -2530,7 +2558,7 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Show task details option menu.addItem((item) => item - .setTitle("Open task") + .setTitle(this.plugin.i18n.translate("views.advancedCalendar.contextMenus.openTask")) .setIcon("edit") .onClick(() => { const editModal = new TaskEditModal(this.app, this.plugin, { task: taskInfo }); @@ -2543,13 +2571,13 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Delete time entry option menu.addItem((item) => item - .setTitle("Delete time entry") + .setTitle(this.plugin.i18n.translate("views.advancedCalendar.contextMenus.deleteTimeEntry")) .setIcon("trash") .onClick(async () => { try { const timeEntry = taskInfo.timeEntries?.[timeEntryIndex]; if (!timeEntry) { - new Notice("Time entry not found"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.timeEntryNotFound")); return; } @@ -2573,9 +2601,13 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { // Show confirmation const confirmed = await new Promise((resolve) => { const confirmModal = new Modal(this.app); - confirmModal.setTitle("Delete Time Entry"); + confirmModal.setTitle( + this.plugin.i18n.translate("views.advancedCalendar.contextMenus.deleteTimeEntryTitle") + ); confirmModal.setContent( - `Are you sure you want to delete this time entry${durationText}? This action cannot be undone.` + this.plugin.i18n.translate("views.advancedCalendar.contextMenus.deleteTimeEntryConfirm", { + duration: durationText, + }) ); const buttonContainer = confirmModal.contentEl.createDiv({ @@ -2587,10 +2619,10 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { buttonContainer.style.marginTop = "20px"; const cancelBtn = buttonContainer.createEl("button", { - text: "Cancel", + text: this.plugin.i18n.translate("views.advancedCalendar.contextMenus.cancelButton"), }); const deleteBtn = buttonContainer.createEl("button", { - text: "Delete", + text: this.plugin.i18n.translate("views.advancedCalendar.contextMenus.deleteButton"), cls: "mod-warning", }); @@ -2609,11 +2641,11 @@ export class AdvancedCalendarView extends ItemView implements OptimizedView { if (confirmed) { await this.plugin.taskService.deleteTimeEntry(taskInfo, timeEntryIndex); - new Notice("Time entry deleted"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.timeEntryDeleted")); } } catch (error) { console.error("Error deleting time entry:", error); - new Notice("Failed to delete time entry"); + new Notice(this.plugin.i18n.translate("views.advancedCalendar.notices.deleteTimeEntryFailed")); } }) );