diff --git a/client/components/modals/AccountModal.vue b/client/components/modals/AccountModal.vue index b22ff245b..93c505da2 100644 --- a/client/components/modals/AccountModal.vue +++ b/client/components/modals/AccountModal.vue @@ -111,7 +111,7 @@
- Unlink OpenID + {{ $strings.ButtonUnlinkOpenId }} {{ $strings.ButtonChangeRootPassword }}
{{ $strings.ButtonSubmit }} @@ -212,19 +212,19 @@ export default { }, unlinkOpenID() { const payload = { - message: 'Are you sure you want to unlink this user from OpenID?', + message: this.$strings.MessageConfirmUnlinkOpenId, callback: (confirmed) => { if (confirmed) { this.unlinkingFromOpenID = true this.$axios .$patch(`/api/users/${this.account.id}/openid-unlink`) .then(() => { - this.$toast.success('User unlinked from OpenID') + this.$toast.success(this.$strings.ToastUnlinkOpenIdSuccess) this.show = false }) .catch((error) => { console.error('Failed to unlink user from OpenID', error) - this.$toast.error('Failed to unlink user from OpenID') + this.$toast.error(this.$strings.ToastUnlinkOpenIdFailed) }) .finally(() => { this.unlinkingFromOpenID = false @@ -265,15 +265,15 @@ export default { }, submitForm() { if (!this.newUser.username) { - this.$toast.error('Enter a username') + this.$toast.error(this.$strings.ToastNewUserUsernameError) return } if (!this.newUser.permissions.accessAllLibraries && !this.newUser.librariesAccessible.length) { - this.$toast.error('Must select at least one library') + this.$toast.error(this.$strings.ToastNewUserLibraryError) return } if (!this.newUser.permissions.accessAllTags && !this.newUser.itemTagsSelected.length) { - this.$toast.error('Must select at least one tag') + this.$toast.error(this.$strings.ToastNewUserTagError) return } @@ -313,12 +313,12 @@ export default { this.processing = false console.error('Failed to update account', error) var errMsg = error.response ? error.response.data || '' : '' - this.$toast.error(errMsg || 'Failed to update account') + this.$toast.error(errMsg || this.$strings.ToastFailedToUpdateAccount) }) }, submitCreateAccount() { if (!this.newUser.password) { - this.$toast.error('Must have a password, only root user can have an empty password') + this.$toast.error(this.$strings.ToastNewUserPasswordError) return } @@ -330,8 +330,9 @@ export default { 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)) } else { - this.$toast.success('New account created') + this.$toast.success(this.$strings.ToastNewUserCreatedSuccess) this.show = false } }) diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 15d9c2077..19a688d7e 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -94,6 +94,7 @@ "ButtonStats": "Stats", "ButtonSubmit": "Submit", "ButtonTest": "Test", + "ButtonUnlinkOpedId": "Unlink OpenID", "ButtonUpload": "Upload", "ButtonUploadBackup": "Upload Backup", "ButtonUploadCover": "Upload Cover", @@ -673,6 +674,7 @@ "MessageConfirmRenameTagMergeNote": "Note: This tag already exists so they will be merged.", "MessageConfirmRenameTagWarning": "Warning! A similar tag with a different casing already exists \"{0}\".", "MessageConfirmSendEbookToDevice": "Are you sure you want to send {0} ebook \"{1}\" to device \"{2}\"?", + "MessageConfirmUnlinkOpenId": "Are you sure you want to unlink this user from OpenID?", "MessageDownloadingEpisode": "Downloading episode", "MessageDragFilesIntoTrackOrder": "Drag files into correct track order", "MessageEmbedFailed": "Embed Failed!", @@ -833,6 +835,7 @@ "ToastEpisodeDownloadQueueClearFailed": "Failed to clear queue", "ToastEpisodeDownloadQueueClearSuccess": "Episode download queue cleared", "ToastFailedToLoadData": "Failed to load data", + "ToastFailedToUpdateAccount": "Failed to update account", "ToastItemCoverUpdateFailed": "Failed to update item cover", "ToastItemCoverUpdateSuccess": "Item cover updated", "ToastItemDeletedFailed": "Failed to delete item", @@ -852,6 +855,12 @@ "ToastLibraryScanStarted": "Library scan started", "ToastLibraryUpdateFailed": "Failed to update library", "ToastLibraryUpdateSuccess": "Library \"{0}\" updated", + "ToastNewUserCreatedFailed": "Failed to create account: \"{0}\"", + "ToastNewUserCreatedSuccess": "New account created", + "ToastNewUserLibraryError": "Must select at least one library", + "ToastNewUserPasswordError": "Must have a password, only root user can have an empty password", + "ToastNewUserTagError": "Must select at least one tag", + "ToastNewUserUsernameError": "Enter a username", "ToastPlaylistCreateFailed": "Failed to create playlist", "ToastPlaylistCreateSuccess": "Playlist created", "ToastPlaylistRemoveFailed": "Failed to remove playlist", @@ -882,6 +891,8 @@ "ToastSortingPrefixesEmptyError": "Must have at least 1 sorting prefix", "ToastSortingPrefixesUpdateFailed": "Failed to update sorting prefixes", "ToastSortingPrefixesUpdateSuccess": "Sorting prefixes updated ({0} items)", + "ToastUnlinkOpenIdFailed": "Failed to unlink user from OpenID", + "ToastUnlinkOpenIdSuccess": "User unlinked from OpenID", "ToastUserDeleteFailed": "Failed to delete user", "ToastUserDeleteSuccess": "User deleted" }