diff --git a/client/components/modals/authors/EditModal.vue b/client/components/modals/authors/EditModal.vue index 174b28d44..787382001 100644 --- a/client/components/modals/authors/EditModal.vue +++ b/client/components/modals/authors/EditModal.vue @@ -116,12 +116,12 @@ export default { this.$axios .$delete(`/api/authors/${this.authorId}`) .then(() => { - this.$toast.success('Author removed') + this.$toast.success(this.$strings.ToastAuthorRemoveSuccess) this.show = false }) .catch((error) => { console.error('Failed to remove author', error) - this.$toast.error('Failed to remove author') + this.$toast.error(this.$strings.ToastAuthorRemoveFailed) }) .finally(() => { this.processing = false @@ -182,7 +182,7 @@ export default { }, submitUploadCover() { if (!this.imageUrl?.startsWith('http:') && !this.imageUrl?.startsWith('https:')) { - this.$toast.error('Invalid image url') + this.$toast.error(this.$strings.ToastInvalidImageUrl) return } @@ -194,14 +194,14 @@ export default { .$post(`/api/authors/${this.authorId}/image`, updatePayload) .then((data) => { this.imageUrl = '' - this.$toast.success('Author image updated') + this.$toast.success(this.$strings.ToastAuthorUpdateSuccess) this.authorCopy.updatedAt = data.author.updatedAt this.authorCopy.imagePath = data.author.imagePath }) .catch((error) => { console.error('Failed', error) - this.$toast.error(error.response.data || 'Failed to remove author image') + this.$toast.error(error.response.data || this.$strings.ToastAuthorImageRemoveFailed) }) .finally(() => { this.processing = false @@ -209,7 +209,7 @@ export default { }, async searchAuthor() { if (!this.authorCopy.name && !this.authorCopy.asin) { - this.$toast.error('Must enter an author name') + this.$toast.error(this.$strings.ToastNameRequired) return } this.processing = true @@ -228,17 +228,19 @@ export default { return null }) if (!response) { - this.$toast.error('Author not found') + this.$toast.error(this.$strings.ToastAuthorSearchNotFound) } else if (response.updated) { if (response.author.imagePath) { this.$toast.success(this.$strings.ToastAuthorUpdateSuccess) - } else this.$toast.success(this.$strings.ToastAuthorUpdateSuccessNoImageFound) + } else { + this.$toast.success(this.$strings.ToastAuthorUpdateSuccessNoImageFound) + } this.authorCopy = { ...response.author } } else { - this.$toast.info('No updates were made for Author') + this.$toast.info(this.$strings.ToastAuthorNoUpdatesNeeded) } this.processing = false } diff --git a/client/components/modals/collections/EditModal.vue b/client/components/modals/collections/EditModal.vue index e5b3e305e..f7b1f8beb 100644 --- a/client/components/modals/collections/EditModal.vue +++ b/client/components/modals/collections/EditModal.vue @@ -115,7 +115,7 @@ export default { return } if (!this.newCollectionName) { - return this.$toast.error('Collection must have a name') + return this.$toast.error(this.$strings.ToastNameRequired) } this.processing = true diff --git a/client/components/modals/item/tabs/Match.vue b/client/components/modals/item/tabs/Match.vue index d11beac0c..133f1f75d 100644 --- a/client/components/modals/item/tabs/Match.vue +++ b/client/components/modals/item/tabs/Match.vue @@ -397,7 +397,7 @@ export default { }, submitSearch() { if (!this.searchTitle) { - this.$toast.warning('Search title is required') + this.$toast.warning(this.$strings.ToastTitleRequired) return } this.persistProvider() diff --git a/client/components/modals/libraries/EditModal.vue b/client/components/modals/libraries/EditModal.vue index 27e3ec6de..ea2dfacc3 100644 --- a/client/components/modals/libraries/EditModal.vue +++ b/client/components/modals/libraries/EditModal.vue @@ -156,7 +156,7 @@ export default { }, validate() { if (!this.libraryCopy.name) { - this.$toast.error('Library must have a name') + this.$toast.error(this.$strings.ToastNameRequired) return false } if (!this.libraryCopy.folders.length) { @@ -264,4 +264,4 @@ export default { .tab.tab-selected { height: 41px; } - \ No newline at end of file + diff --git a/client/components/modals/playlists/EditModal.vue b/client/components/modals/playlists/EditModal.vue index 9130c5b85..fd45fd66e 100644 --- a/client/components/modals/playlists/EditModal.vue +++ b/client/components/modals/playlists/EditModal.vue @@ -95,7 +95,7 @@ export default { return } if (!this.newPlaylistName) { - return this.$toast.error('Playlist must have a name') + return this.$toast.error(this.$strings.ToastNameRequired) } this.processing = true diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 809e9fe7c..320ca8e25 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -809,7 +809,11 @@ "ToastApiCallFailed": "API call failed", "ToastAuthorImageRemoveFailed": "Failed to remove image", "ToastAuthorImageRemoveSuccess": "Author image removed", - "ToastAuthorNotFound": "Author {0} not found", + "ToastAuthorNoUpdatesNeeded": "No updates needed for author", + "ToastAuthorNotFound": "Author \"{0}\" not found", + "ToastAuthorRemoveFailed": "Failed to remove author", + "ToastAuthorRemoveSuccess": "Author removed", + "ToastAuthorSearchNotFound": "Author not found", "ToastAuthorUpdateFailed": "Failed to update author", "ToastAuthorUpdateMerged": "Author merged", "ToastAuthorUpdateSuccess": "Author updated", @@ -857,6 +861,7 @@ "ToastFailedToUpdateAccount": "Failed to update account", "ToastFailedToUpdateUser": "Failed to update user", "ToastFfprobeFailed": "FFprobe failed", + "ToastInvalidImageUrl": "Invalid image URL", "ToastItemCoverUpdateFailed": "Failed to update item cover", "ToastItemCoverUpdateSuccess": "Item cover updated", "ToastItemDeletedFailed": "Failed to delete item", @@ -879,6 +884,7 @@ "ToastLibraryUpdateFailed": "Failed to update library", "ToastLibraryUpdateSuccess": "Library \"{0}\" updated", "ToastNameEmailRequired": "Name and email are required", + "ToastNameRequired": "Name is required", "ToastNewUserCreatedFailed": "Failed to create account: \"{0}\"", "ToastNewUserCreatedSuccess": "New account created", "ToastNewUserLibraryError": "Must select at least one library",