From f8d0438c06538d61a283287d575c75a06fce3d4c Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 9 Sep 2021 22:31:00 +0200 Subject: [PATCH] Make password reset logic translatable --- src/translation/en.json | 7 ++++++- src/views/profile.html | 2 +- src/views/profile.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/translation/en.json b/src/translation/en.json index 3eefdfd1b..5915a99f0 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -390,7 +390,12 @@ }, "changePasswordAction": "Change Password", "disable2FAAction": "Disable 2FA", - "enable2FAAction": "Enable 2FA" + "enable2FAAction": "Enable 2FA", + "passwordResetAction": "I forgot my password", + "passwordResetNotification": { + "title": "Password reset successful", + "body": "Email sent to {{ email }}" + } }, "backups": { "title": "Backups", diff --git a/src/views/profile.html b/src/views/profile.html index 1845c6d98..62a5b01ac 100644 --- a/src/views/profile.html +++ b/src/views/profile.html @@ -363,7 +363,7 @@ - I forgot my password + {{ 'profile.passwordResetAction' | tr }}   diff --git a/src/views/profile.js b/src/views/profile.js index c6cde679c..7a131759a 100644 --- a/src/views/profile.js +++ b/src/views/profile.js @@ -21,7 +21,7 @@ angular.module('Application').controller('ProfileController', ['$scope', '$trans Client.sendPasswordReset(function (error) { if (error) return console.error('Failed to reset password:', error); - Client.notify('Password reset successful', 'Email sent to ' + $scope.user.fallbackEmail, false, 'success'); + Client.notify($translate.instant('profile.passwordResetNotification.title'), $translate.instant('profile.passwordResetNotification.body', { email: $scope.user.fallbackEmail}), false, 'success'); }); };