diff --git a/client/components/modals/AccountModal.vue b/client/components/modals/AccountModal.vue index 93c505da2..df1f7cbf2 100644 --- a/client/components/modals/AccountModal.vue +++ b/client/components/modals/AccountModal.vue @@ -329,8 +329,7 @@ export default { .then((data) => { this.processing = false if (data.error) { - this.$toast.error(`Failed to create account: ${data.error}`) - this.$toast.error(this.$strings.ToastNewUserCreatedFailed.replace('{0}', data.error)) + this.$toast.error(this.$strings.ToastNewUserCreatedFailed + ': ' + data.error) } else { this.$toast.success(this.$strings.ToastNewUserCreatedSuccess) this.show = false diff --git a/client/components/modals/emails/EReaderDeviceModal.vue b/client/components/modals/emails/EReaderDeviceModal.vue index 70b295ae6..962c05dc0 100644 --- a/client/components/modals/emails/EReaderDeviceModal.vue +++ b/client/components/modals/emails/EReaderDeviceModal.vue @@ -125,12 +125,12 @@ export default { this.$refs.ereaderEmailInput.blur() if (!this.newDevice.name?.trim() || !this.newDevice.email?.trim()) { - this.$toast.error('Name and email required') + this.$toast.error(this.$strings.ToastNameEmailRequired) return } if (this.newDevice.availabilityOption === 'specificUsers' && !this.newDevice.users.length) { - this.$toast.error('Must select at least one user') + this.$toast.error(this.$strings.ToastSelectAtLeastOneUser) return } if (this.newDevice.availabilityOption !== 'specificUsers') { @@ -142,14 +142,14 @@ export default { if (!this.ereaderDevice) { if (this.existingDevices.some((d) => d.name === this.newDevice.name)) { - this.$toast.error('Ereader device with that name already exists') + this.$toast.error(this.$strings.ToastDeviceNameAlreadyExists) return } this.submitCreate() } else { if (this.ereaderDevice.name !== this.newDevice.name && this.existingDevices.some((d) => d.name === this.newDevice.name)) { - this.$toast.error('Ereader device with that name already exists') + this.$toast.error(this.$strings.ToastDeviceNameAlreadyExists) return } @@ -174,12 +174,12 @@ export default { .$post(`/api/emails/ereader-devices`, payload) .then((data) => { this.$emit('update', data.ereaderDevices) - this.$toast.success('Device updated') + this.$toast.success(this.$strings.ToastDeviceUpdateSuccess) this.show = false }) .catch((error) => { console.error('Failed to update device', error) - this.$toast.error('Failed to update device') + this.$toast.error(this.$strings.ToastDeviceUpdateFailed) }) .finally(() => { this.processing = false @@ -201,12 +201,12 @@ export default { .$post('/api/emails/ereader-devices', payload) .then((data) => { this.$emit('update', data.ereaderDevices || []) - this.$toast.success('Device added') + this.$toast.success(this.$strings.ToastDeviceAddSuccess) this.show = false }) .catch((error) => { console.error('Failed to add device', error) - this.$toast.error('Failed to add device') + this.$toast.error(this.$strings.ToastDeviceAddFailed) }) .finally(() => { this.processing = false diff --git a/client/strings/en-us.json b/client/strings/en-us.json index f3f18700b..809e9fe7c 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -845,6 +845,11 @@ "ToastCollectionUpdateSuccess": "Collection updated", "ToastDeleteFileFailed": "Failed to delete file", "ToastDeleteFileSuccess": "File deleted", + "ToastDeviceAddFailed": "Failed to add device", + "ToastDeviceAddSuccess": "Device added", + "ToastDeviceNameAlreadyExists": "Ereader device with that name already exists", + "ToastDeviceUpdateFailed": "Failed to update device", + "ToastDeviceUpdateSuccess": "Device updated", "ToastEpisodeDownloadQueueClearFailed": "Failed to clear queue", "ToastEpisodeDownloadQueueClearSuccess": "Episode download queue cleared", "ToastErrorCannotShare": "Cannot share natively on this device", @@ -873,6 +878,7 @@ "ToastLibraryScanStarted": "Library scan started", "ToastLibraryUpdateFailed": "Failed to update library", "ToastLibraryUpdateSuccess": "Library \"{0}\" updated", + "ToastNameEmailRequired": "Name and email are required", "ToastNewUserCreatedFailed": "Failed to create account: \"{0}\"", "ToastNewUserCreatedSuccess": "New account created", "ToastNewUserLibraryError": "Must select at least one library", @@ -902,6 +908,7 @@ "ToastRescanUpToDate": "Re-Scan complete item was up to date", "ToastRescanUpdated": "Re-Scan complete item was updated", "ToastScanFailed": "Failed to scan library item", + "ToastSelectAtLeastOneUser": "Select at least one user", "ToastSendEbookToDeviceFailed": "Failed to send ebook to device", "ToastSendEbookToDeviceSuccess": "Ebook sent to device \"{0}\"", "ToastSeriesUpdateFailed": "Series update failed",