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/signup/signup.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/signup/signup.component.ts')
-rw-r--r-- | client/src/app/signup/signup.component.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/client/src/app/signup/signup.component.ts b/client/src/app/signup/signup.component.ts index 1f3e2e146..4a49ead50 100644 --- a/client/src/app/signup/signup.component.ts +++ b/client/src/app/signup/signup.component.ts | |||
@@ -6,6 +6,8 @@ import { ServerService } from '@app/core/server' | |||
6 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
7 | import { UserCreate } from '../../../../shared' | 7 | import { UserCreate } from '../../../../shared' |
8 | import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' | 8 | import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' |
9 | import { RedirectService } from '@app/core' | ||
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | 11 | ||
10 | @Component({ | 12 | @Component({ |
11 | selector: 'my-signup', | 13 | selector: 'my-signup', |
@@ -45,7 +47,9 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
45 | private router: Router, | 47 | private router: Router, |
46 | private notificationsService: NotificationsService, | 48 | private notificationsService: NotificationsService, |
47 | private userService: UserService, | 49 | private userService: UserService, |
48 | private serverService: ServerService | 50 | private redirectService: RedirectService, |
51 | private serverService: ServerService, | ||
52 | private i18n: I18n | ||
49 | ) { | 53 | ) { |
50 | super() | 54 | super() |
51 | } | 55 | } |
@@ -78,8 +82,11 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
78 | 82 | ||
79 | this.userService.signup(userCreate).subscribe( | 83 | this.userService.signup(userCreate).subscribe( |
80 | () => { | 84 | () => { |
81 | this.notificationsService.success('Success', `Registration for ${userCreate.username} complete.`) | 85 | this.notificationsService.success( |
82 | this.router.navigate([ '/videos/list' ]) | 86 | this.i18n('Success'), |
87 | this.i18n('Registration for {{ username }} complete.', { username: userCreate.username}) | ||
88 | ) | ||
89 | this.redirectService.redirectToHomepage() | ||
83 | }, | 90 | }, |
84 | 91 | ||
85 | err => this.error = err.message | 92 | err => this.error = err.message |
@@ -99,9 +106,9 @@ export class SignupComponent extends FormReactive implements OnInit { | |||
99 | const normalSeconds = initialUserVideoQuotaBit / (1.5 * 1000 * 1000) | 106 | const normalSeconds = initialUserVideoQuotaBit / (1.5 * 1000 * 1000) |
100 | 107 | ||
101 | const lines = [ | 108 | const lines = [ |
102 | SignupComponent.getApproximateTime(fullHdSeconds) + ' of full HD videos', | 109 | this.i18n('{{ seconds }} of full HD videos', { seconds: SignupComponent.getApproximateTime(fullHdSeconds) }), |
103 | SignupComponent.getApproximateTime(hdSeconds) + ' of HD videos', | 110 | this.i18n('{{ seconds }} of HD videos', { seconds: SignupComponent.getApproximateTime(hdSeconds) }), |
104 | SignupComponent.getApproximateTime(normalSeconds) + ' of average quality videos' | 111 | this.i18n('{{ seconds }} of average quality videos', { seconds: SignupComponent.getApproximateTime(normalSeconds) }) |
105 | ] | 112 | ] |
106 | 113 | ||
107 | this.quotaHelpIndication = lines.join('<br />') | 114 | this.quotaHelpIndication = lines.join('<br />') |