From 93a0d471da4f9875fd2e49a66f508198510b4fb1 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Wed, 28 Aug 2024 20:09:57 -0700 Subject: [PATCH] Replace: toasts in BookShelfToolbar --- client/components/app/BookShelfToolbar.vue | 10 +++++----- client/strings/en-us.json | 5 +++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index 00b0d4a94..ff337428f 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -473,11 +473,11 @@ export default { this.$axios .$get(`/api/me/series/${this.seriesId}/readd-to-continue-listening`) .then(() => { - this.$toast.success('Series re-added to continue listening') + this.$toast.success(this.$strings.ToastItemUpdateSuccess) }) .catch((error) => { console.error('Failed to re-add series to continue listening', error) - this.$toast.error('Failed to re-add series to continue listening') + this.$toast.error(this.$strings.ToastItemUpdateFailed) }) .finally(() => { this.processingSeries = false @@ -504,7 +504,7 @@ export default { }) if (!response) { console.error(`Author ${author.name} not found`) - this.$toast.error(`Author ${author.name} not found`) + this.$toast.error(this.$getString('ToastAuthorNotFound', [author.name])) } else if (response.updated) { if (response.author.imagePath) console.log(`Author ${response.author.name} was updated`) else console.log(`Author ${response.author.name} was updated (no image found)`) @@ -522,13 +522,13 @@ export default { this.$axios .$delete(`/api/libraries/${this.currentLibraryId}/issues`) .then(() => { - this.$toast.success('Removed library items with issues') + this.$toast.success(this.$strings.ToastRemoveItemsWithIssuesSuccess) this.$router.push(`/library/${this.currentLibraryId}/bookshelf`) this.$store.dispatch('libraries/fetch', this.currentLibraryId) }) .catch((error) => { console.error('Failed to remove library items with issues', error) - this.$toast.error('Failed to remove library items with issues') + this.$toast.error(this.$strings.ToastRemoveItemsWithIssuesFailed) }) .finally(() => { this.processingIssues = false diff --git a/client/strings/en-us.json b/client/strings/en-us.json index cb0a6ebb3..8cc9f6980 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -809,6 +809,7 @@ "ToastApiCallFailed": "API call failed", "ToastAuthorImageRemoveFailed": "Failed to remove image", "ToastAuthorImageRemoveSuccess": "Author image removed", + "ToastAuthorNotFound": "Author {0} not found", "ToastAuthorUpdateFailed": "Failed to update author", "ToastAuthorUpdateMerged": "Author merged", "ToastAuthorUpdateSuccess": "Author updated", @@ -862,6 +863,8 @@ "ToastItemMarkedAsFinishedSuccess": "Item marked as Finished", "ToastItemMarkedAsNotFinishedFailed": "Failed to mark as Not Finished", "ToastItemMarkedAsNotFinishedSuccess": "Item marked as Not Finished", + "ToastItemUpdateFailed": "Failed to update item", + "ToastItemUpdateSuccess": "Item updated", "ToastLibraryCreateFailed": "Failed to create library", "ToastLibraryCreateSuccess": "Library \"{0}\" created", "ToastLibraryDeleteFailed": "Failed to delete library", @@ -890,6 +893,8 @@ "ToastProgressReset": "Your progress was reset", "ToastRSSFeedCloseFailed": "Failed to close RSS feed", "ToastRSSFeedCloseSuccess": "RSS feed closed", + "ToastRemoveItemsWithIssuesFailed": "Failed to remove library items with issues", + "ToastRemoveItemsWithIssuesSuccess": "Removed library items with issues", "ToastRemoveItemFromCollectionFailed": "Failed to remove item from collection", "ToastRemoveItemFromCollectionSuccess": "Item removed from collection", "ToastRescanFailed": "Re-Scan Failed for \"{0}\"",