Make password reset logic translatable

This commit is contained in:
Johannes Zellner
2021-09-09 22:31:00 +02:00
parent 04eb179899
commit f8d0438c06
3 changed files with 8 additions and 3 deletions

View File

@@ -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",

View File

@@ -363,7 +363,7 @@
</tr>
<tr>
<td colspan="2" class="text-right">
<a href="" ng-click="sendPasswordReset()">I forgot my password</a>
<a href="" ng-click="sendPasswordReset()">{{ 'profile.passwordResetAction' | tr }}</a>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>

View File

@@ -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');
});
};