aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/signup/signup.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/signup/signup.component.ts')
-rw-r--r--client/src/app/signup/signup.component.ts19
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'
6import { NotificationsService } from 'angular2-notifications' 6import { NotificationsService } from 'angular2-notifications'
7import { UserCreate } from '../../../../shared' 7import { UserCreate } from '../../../../shared'
8import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' 8import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared'
9import { RedirectService } from '@app/core'
10import { 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 />')