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/login/login.component.ts | |
parent | 989e526abf0c0dd7958deb630df009608561bb67 (diff) | |
download | PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.gz PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.zst PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.zip |
Add i18n attributes
Diffstat (limited to 'client/src/app/login/login.component.ts')
-rw-r--r-- | client/src/app/login/login.component.ts | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 2514faf94..a14cb2eb7 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -7,6 +7,7 @@ import { NotificationsService } from 'angular2-notifications' | |||
7 | import { ModalDirective } from 'ngx-bootstrap/modal' | 7 | import { ModalDirective } from 'ngx-bootstrap/modal' |
8 | import { AuthService } from '../core' | 8 | import { AuthService } from '../core' |
9 | import { FormReactive } from '../shared' | 9 | import { FormReactive } from '../shared' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
10 | 11 | ||
11 | @Component({ | 12 | @Component({ |
12 | selector: 'my-login', | 13 | selector: 'my-login', |
@@ -35,12 +36,15 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
35 | } | 36 | } |
36 | forgotPasswordEmail = '' | 37 | forgotPasswordEmail = '' |
37 | 38 | ||
38 | constructor (private authService: AuthService, | 39 | constructor ( |
39 | private userService: UserService, | 40 | private authService: AuthService, |
40 | private serverService: ServerService, | 41 | private userService: UserService, |
41 | private redirectService: RedirectService, | 42 | private serverService: ServerService, |
42 | private notificationsService: NotificationsService, | 43 | private redirectService: RedirectService, |
43 | private formBuilder: FormBuilder) { | 44 | private notificationsService: NotificationsService, |
45 | private formBuilder: FormBuilder, | ||
46 | private i18n: I18n | ||
47 | ) { | ||
44 | super() | 48 | super() |
45 | } | 49 | } |
46 | 50 | ||
@@ -78,12 +82,15 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
78 | this.userService.askResetPassword(this.forgotPasswordEmail) | 82 | this.userService.askResetPassword(this.forgotPasswordEmail) |
79 | .subscribe( | 83 | .subscribe( |
80 | res => { | 84 | res => { |
81 | const message = `An email with the reset password instructions will be sent to ${this.forgotPasswordEmail}.` | 85 | const message = this.i18n( |
82 | this.notificationsService.success('Success', message) | 86 | 'An email with the reset password instructions will be sent to {{ email }}.', |
87 | { email: this.forgotPasswordEmail } | ||
88 | ) | ||
89 | this.notificationsService.success(this.i18n('Success'), message) | ||
83 | this.hideForgotPasswordModal() | 90 | this.hideForgotPasswordModal() |
84 | }, | 91 | }, |
85 | 92 | ||
86 | err => this.notificationsService.error('Error', err.message) | 93 | err => this.notificationsService.error(this.i18n('Error'), err.message) |
87 | ) | 94 | ) |
88 | } | 95 | } |
89 | 96 | ||