diff options
Diffstat (limited to 'client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index 80af668f9..1a88aa82e 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | |||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core' | |||
2 | import { FormBuilder, FormGroup } from '@angular/forms' | 2 | import { FormBuilder, FormGroup } from '@angular/forms' |
3 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { FormReactive, USER_PASSWORD, UserService } from '../../../shared' | 4 | import { FormReactive, USER_PASSWORD, UserService } from '../../../shared' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | 6 | ||
6 | @Component({ | 7 | @Component({ |
7 | selector: 'my-account-change-password', | 8 | selector: 'my-account-change-password', |
@@ -24,7 +25,8 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
24 | constructor ( | 25 | constructor ( |
25 | private formBuilder: FormBuilder, | 26 | private formBuilder: FormBuilder, |
26 | private notificationsService: NotificationsService, | 27 | private notificationsService: NotificationsService, |
27 | private userService: UserService | 28 | private userService: UserService, |
29 | private i18n: I18n | ||
28 | ) { | 30 | ) { |
29 | super() | 31 | super() |
30 | } | 32 | } |
@@ -49,12 +51,12 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
49 | this.error = null | 51 | this.error = null |
50 | 52 | ||
51 | if (newPassword !== newConfirmedPassword) { | 53 | if (newPassword !== newConfirmedPassword) { |
52 | this.error = 'The new password and the confirmed password do not correspond.' | 54 | this.error = this.i18n('The new password and the confirmed password do not correspond.') |
53 | return | 55 | return |
54 | } | 56 | } |
55 | 57 | ||
56 | this.userService.changePassword(newPassword).subscribe( | 58 | this.userService.changePassword(newPassword).subscribe( |
57 | () => this.notificationsService.success('Success', 'Password updated.'), | 59 | () => this.notificationsService.success(this.i18n('Success'), this.i18n('Password updated.')), |
58 | 60 | ||
59 | err => this.error = err.message | 61 | err => this.error = err.message |
60 | ) | 62 | ) |