From b1d40cff89f7cff565a98cdbcea9a624196a169a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Jun 2018 16:21:17 +0200 Subject: Add i18n attributes --- client/src/app/signup/signup.component.html | 22 +++++++++++----------- client/src/app/signup/signup.component.ts | 19 +++++++++++++------ 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'client/src/app/signup') diff --git a/client/src/app/signup/signup.component.html b/client/src/app/signup/signup.component.html index 5f48786e5..2fe9a4281 100644 --- a/client/src/app/signup/signup.component.html +++ b/client/src/app/signup/signup.component.html @@ -1,11 +1,11 @@
-
+
Create an account
- Initial video quota: + Initial video quota: {{ initialUserVideoQuota | bytes: 0 }} @@ -13,18 +13,18 @@ - + Unlimited - +
{{ error }}
- +
@@ -33,9 +33,9 @@
- +
@@ -44,9 +44,9 @@
- +
@@ -54,7 +54,7 @@
- +
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('
') -- cgit v1.2.3