diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-04 16:21:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 08:43:01 +0200 |
commit | b1d40cff89f7cff565a98cdbcea9a624196a169a (patch) | |
tree | d24746c1cc69f50471a9eba0dfb1c1bae06a1870 /client/src/app/reset-password | |
parent | 989e526abf0c0dd7958deb630df009608561bb67 (diff) | |
download | PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.gz PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.zst PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.zip |
Add i18n attributes
Diffstat (limited to 'client/src/app/reset-password')
-rw-r--r-- | client/src/app/reset-password/reset-password.component.html | 12 | ||||
-rw-r--r-- | client/src/app/reset-password/reset-password.component.ts | 8 |
2 files changed, 11 insertions, 9 deletions
diff --git a/client/src/app/reset-password/reset-password.component.html b/client/src/app/reset-password/reset-password.component.html index 9cf623c64..20e62d0b7 100644 --- a/client/src/app/reset-password/reset-password.component.html +++ b/client/src/app/reset-password/reset-password.component.html | |||
@@ -1,13 +1,13 @@ | |||
1 | <div class="margin-content"> | 1 | <div class="margin-content"> |
2 | <div class="title-page title-page-single"> | 2 | <div i18n class="title-page title-page-single"> |
3 | Reset my password | 3 | Reset my password |
4 | </div> | 4 | </div> |
5 | 5 | ||
6 | <form role="form" (ngSubmit)="resetPassword()" [formGroup]="form"> | 6 | <form role="form" (ngSubmit)="resetPassword()" [formGroup]="form"> |
7 | <div class="form-group"> | 7 | <div class="form-group"> |
8 | <label for="password">Password</label> | 8 | <label i18n for="password">Password</label> |
9 | <input | 9 | <input |
10 | type="password" name="password" id="password" placeholder="Password" required | 10 | type="password" name="password" id="password" i18n-placeholder placeholder="Password" required |
11 | formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" | 11 | formControlName="password" [ngClass]="{ 'input-error': formErrors['password'] }" |
12 | > | 12 | > |
13 | <div *ngIf="formErrors.password" class="form-error"> | 13 | <div *ngIf="formErrors.password" class="form-error"> |
@@ -16,9 +16,9 @@ | |||
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <div class="form-group"> | 18 | <div class="form-group"> |
19 | <label for="password-confirm">Confirm password</label> | 19 | <label i18n for="password-confirm">Confirm password</label> |
20 | <input | 20 | <input |
21 | type="password" name="password-confirm" id="password-confirm" placeholder="Confirmed password" required | 21 | type="password" name="password-confirm" id="password-confirm" i18n-placeholder placeholder="Confirmed password" required |
22 | formControlName="password-confirm" [ngClass]="{ 'input-error': formErrors['password-confirm'] }" | 22 | formControlName="password-confirm" [ngClass]="{ 'input-error': formErrors['password-confirm'] }" |
23 | > | 23 | > |
24 | <div *ngIf="formErrors['password-confirm']" class="form-error"> | 24 | <div *ngIf="formErrors['password-confirm']" class="form-error"> |
@@ -26,6 +26,6 @@ | |||
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | 28 | ||
29 | <input type="submit" value="Reset my password" [disabled]="!form.valid && isConfirmedPasswordValid()"> | 29 | <input type="submit" i18n-value value="Reset my password" [disabled]="!form.valid && isConfirmedPasswordValid()"> |
30 | </form> | 30 | </form> |
31 | </div> | 31 | </div> |
diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts index 408374779..c8bd368c1 100644 --- a/client/src/app/reset-password/reset-password.component.ts +++ b/client/src/app/reset-password/reset-password.component.ts | |||
@@ -5,6 +5,7 @@ import { USER_PASSWORD, UserService } from '@app/shared' | |||
5 | import { NotificationsService } from 'angular2-notifications' | 5 | import { NotificationsService } from 'angular2-notifications' |
6 | import { AuthService } from '../core' | 6 | import { AuthService } from '../core' |
7 | import { FormReactive } from '../shared' | 7 | import { FormReactive } from '../shared' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
10 | selector: 'my-login', | 11 | selector: 'my-login', |
@@ -34,7 +35,8 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
34 | private notificationsService: NotificationsService, | 35 | private notificationsService: NotificationsService, |
35 | private formBuilder: FormBuilder, | 36 | private formBuilder: FormBuilder, |
36 | private router: Router, | 37 | private router: Router, |
37 | private route: ActivatedRoute | 38 | private route: ActivatedRoute, |
39 | private i18n: I18n | ||
38 | ) { | 40 | ) { |
39 | super() | 41 | super() |
40 | } | 42 | } |
@@ -55,7 +57,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
55 | this.verificationString = this.route.snapshot.queryParams['verificationString'] | 57 | this.verificationString = this.route.snapshot.queryParams['verificationString'] |
56 | 58 | ||
57 | if (!this.userId || !this.verificationString) { | 59 | if (!this.userId || !this.verificationString) { |
58 | this.notificationsService.error('Error', 'Unable to find user id or verification string.') | 60 | this.notificationsService.error(this.i18n('Error'), this.i18n('Unable to find user id or verification string.')) |
59 | this.router.navigate([ '/' ]) | 61 | this.router.navigate([ '/' ]) |
60 | } | 62 | } |
61 | } | 63 | } |
@@ -64,7 +66,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { | |||
64 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) | 66 | this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) |
65 | .subscribe( | 67 | .subscribe( |
66 | () => { | 68 | () => { |
67 | this.notificationsService.success('Success', 'Your password has been successfully reset!') | 69 | this.notificationsService.success(this.i18n('Success'), this.i18n('Your password has been successfully reset!')) |
68 | this.router.navigate([ '/login' ]) | 70 | this.router.navigate([ '/login' ]) |
69 | }, | 71 | }, |
70 | 72 | ||