X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2Fsignup%2Fsignup.component.ts;h=4a49ead50d6aa9bec71ed4a018d779a9f9a35d53;hb=b1d40cff89f7cff565a98cdbcea9a624196a169a;hp=1f3e2e1461b352c667e75058f900f6f0b5151929;hpb=989e526abf0c0dd7958deb630df009608561bb67;p=github%2FChocobozzz%2FPeerTube.git 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' import { NotificationsService } from 'angular2-notifications' import { UserCreate } from '../../../../shared' import { FormReactive, USER_EMAIL, USER_PASSWORD, USER_USERNAME, UserService } from '../shared' +import { RedirectService } from '@app/core' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-signup', @@ -45,7 +47,9 @@ export class SignupComponent extends FormReactive implements OnInit { private router: Router, private notificationsService: NotificationsService, private userService: UserService, - private serverService: ServerService + private redirectService: RedirectService, + private serverService: ServerService, + private i18n: I18n ) { super() } @@ -78,8 +82,11 @@ export class SignupComponent extends FormReactive implements OnInit { this.userService.signup(userCreate).subscribe( () => { - this.notificationsService.success('Success', `Registration for ${userCreate.username} complete.`) - this.router.navigate([ '/videos/list' ]) + this.notificationsService.success( + this.i18n('Success'), + this.i18n('Registration for {{ username }} complete.', { username: userCreate.username}) + ) + this.redirectService.redirectToHomepage() }, err => this.error = err.message @@ -99,9 +106,9 @@ export class SignupComponent extends FormReactive implements OnInit { const normalSeconds = initialUserVideoQuotaBit / (1.5 * 1000 * 1000) const lines = [ - SignupComponent.getApproximateTime(fullHdSeconds) + ' of full HD videos', - SignupComponent.getApproximateTime(hdSeconds) + ' of HD videos', - SignupComponent.getApproximateTime(normalSeconds) + ' of average quality videos' + this.i18n('{{ seconds }} of full HD videos', { seconds: SignupComponent.getApproximateTime(fullHdSeconds) }), + this.i18n('{{ seconds }} of HD videos', { seconds: SignupComponent.getApproximateTime(hdSeconds) }), + this.i18n('{{ seconds }} of average quality videos', { seconds: SignupComponent.getApproximateTime(normalSeconds) }) ] this.quotaHelpIndication = lines.join('
')