diff --git a/client/pages/account.vue b/client/pages/account.vue index 86be607c6..0e8a11162 100644 --- a/client/pages/account.vue +++ b/client/pages/account.vue @@ -117,10 +117,10 @@ export default { }, submitChangePassword() { if (this.newPassword !== this.confirmPassword) { - return this.$toast.error('New password and confirm password do not match') + return this.$toast.error(this.$strings.ToastUserPasswordMismatch) } if (this.password === this.newPassword) { - return this.$toast.error('Password and New Password cannot be the same') + return this.$toast.error(this.$strings.ToastUserPasswordMustChange) } this.changingPassword = true this.$axios @@ -130,7 +130,7 @@ export default { }) .then((res) => { if (res.success) { - this.$toast.success('Password Changed Successfully') + this.$toast.success(this.$strings.ToastUserPasswordChangeSuccess) this.resetForm() } else { this.$toast.error(res.error || 'Unknown Error') @@ -139,7 +139,7 @@ export default { }) .catch((error) => { console.error(error) - this.$toast.error('Api call failed') + this.$toast.error(this.$strings.ToastApiCallFailed) this.changingPassword = false }) } @@ -148,4 +148,4 @@ export default { this.selectedLanguage = this.$languageCodes.current } } - \ No newline at end of file + diff --git a/client/pages/login.vue b/client/pages/login.vue index d12600c99..a853def45 100644 --- a/client/pages/login.vue +++ b/client/pages/login.vue @@ -132,11 +132,11 @@ export default { methods: { async submitServerSetup() { if (!this.newRoot.username || !this.newRoot.username.trim()) { - this.$toast.error('Must enter a root username') + this.$toast.error(this.$strings.ToastUserRootRequireName) return } if (this.newRoot.password !== this.confirmPassword) { - this.$toast.error('Password mismatch') + this.$toast.error(this.$strings.ToastUserPasswordMismatch) return } if (!this.newRoot.password) { diff --git a/client/strings/en-us.json b/client/strings/en-us.json index f872ef156..2296680f9 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -806,6 +806,7 @@ "StatsYearInReview": "YEAR IN REVIEW", "ToastAccountUpdateFailed": "Failed to update account", "ToastAccountUpdateSuccess": "Account updated", + "ToastApiCallFailed": "API call failed", "ToastAuthorImageRemoveFailed": "Failed to remove image", "ToastAuthorImageRemoveSuccess": "Author image removed", "ToastAuthorUpdateFailed": "Failed to update author", @@ -909,5 +910,9 @@ "ToastUnlinkOpenIdFailed": "Failed to unlink user from OpenID", "ToastUnlinkOpenIdSuccess": "User unlinked from OpenID", "ToastUserDeleteFailed": "Failed to delete user", - "ToastUserDeleteSuccess": "User deleted" + "ToastUserDeleteSuccess": "User deleted", + "ToastUserPasswordChangeSuccess": "Password changed successfully", + "ToastUserPasswordMismatch": "Passwords do not match", + "ToastUserPasswordMustChange": "New password cannot match old password", + "ToastUserRootRequireName": "Must enter a root username" }