diff --git a/client/components/modals/collections/AddCreateModal.vue b/client/components/modals/collections/AddCreateModal.vue index 29c21624b..f42b47d79 100644 --- a/client/components/modals/collections/AddCreateModal.vue +++ b/client/components/modals/collections/AddCreateModal.vue @@ -172,12 +172,12 @@ export default { .$post(`/api/collections/${collection.id}/batch/add`, { books: this.selectedBookIds }) .then((updatedCollection) => { console.log(`Books added to collection`, updatedCollection) - this.$toast.success('Books added to collection') + this.$toast.success(this.$strings.ToastCollectionItemsAddSuccess) this.processing = false }) .catch((error) => { console.error('Failed to add books to collection', error) - this.$toast.error('Failed to add books to collection') + this.$toast.error(this.$strings.ToastCollectionItemsAddFailed) this.processing = false }) } else { @@ -187,12 +187,12 @@ export default { .$post(`/api/collections/${collection.id}/book`, { id: this.selectedLibraryItemId }) .then((updatedCollection) => { console.log(`Book added to collection`, updatedCollection) - this.$toast.success('Book added to collection') + this.$toast.success(this.$strings.ToastCollectionItemsAddSuccess) this.processing = false }) .catch((error) => { console.error('Failed to add book to collection', error) - this.$toast.error('Failed to add book to collection') + this.$toast.error(this.$strings.ToastCollectionItemsAddFailed) this.processing = false }) } @@ -221,7 +221,7 @@ export default { .catch((error) => { console.error('Failed to create collection', error) var errMsg = error.response ? error.response.data || '' : '' - this.$toast.error(`Failed to create collection: ${errMsg}`) + this.$toast.error(this.$strings.ToastCollectionCreateFailed + ': ' + errMsg) this.processing = false }) } diff --git a/client/strings/en-us.json b/client/strings/en-us.json index dc2b5ceeb..cb0a6ebb3 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -834,6 +834,8 @@ "ToastCachePurgeSuccess": "Cache purged successfully", "ToastChaptersHaveErrors": "Chapters have errors", "ToastChaptersMustHaveTitles": "Chapters must have titles", + "ToastCollectionItemsAddFailed": "Item(s) added to collection failed", + "ToastCollectionItemsAddSuccess": "Item(s) added to collection success", "ToastCollectionItemsRemoveFailed": "Failed to remove item(s) from collection", "ToastCollectionItemsRemoveSuccess": "Item(s) removed from collection", "ToastCollectionRemoveFailed": "Failed to remove collection",