From 66357162f8e1227495f09bd4f68446aad7071c6d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 12 Aug 2020 10:40:04 +0200 Subject: Migrate to $localize * Remove i18n polyfill to translate things in components * Reduce bundle sizes * Improve runtime perf * Reduce a lot the time to make a full client build * Reduce client build complexity * We don't need a service to translate things anymore (so we will be able to translate title pages etc) Unfortunately we may loose some translations in the migration process. I'll put a message on weblate to notify translators --- .../verify-account-ask-send-email.component.ts | 12 +++--------- .../verify-account-email/verify-account-email.component.ts | 8 +++----- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'client/src/app/+signup/+verify-account') diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts index 51910471b..b26581d2b 100644 --- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core' import { Notifier, RedirectService, ServerService, UserService } from '@app/core' import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' -import { I18n } from '@ngx-translate/i18n-polyfill' import { ServerConfig } from '@shared/models' @Component({ @@ -19,9 +18,8 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements private userService: UserService, private serverService: ServerService, private notifier: Notifier, - private redirectService: RedirectService, - private i18n: I18n - ) { + private redirectService: RedirectService + ) { super() } @@ -44,11 +42,7 @@ export class VerifyAccountAskSendEmailComponent extends FormReactive implements this.userService.askSendVerifyEmail(email) .subscribe( () => { - const message = this.i18n( - 'An email with verification link will be sent to {{email}}.', - { email } - ) - this.notifier.success(message) + this.notifier.success($localize`An email with verification link will be sent to ${email}.`) this.redirectService.redirectToHomepage() }, diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts index 586f4e231..acc688ab3 100644 --- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts +++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { AuthService, Notifier, UserService } from '@app/core' -import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-verify-account-email', @@ -20,9 +19,8 @@ export class VerifyAccountEmailComponent implements OnInit { private userService: UserService, private authService: AuthService, private notifier: Notifier, - private route: ActivatedRoute, - private i18n: I18n - ) { + private route: ActivatedRoute + ) { } ngOnInit () { @@ -32,7 +30,7 @@ export class VerifyAccountEmailComponent implements OnInit { this.isPendingEmail = queryParams['isPendingEmail'] === 'true' if (!this.userId || !this.verificationString) { - this.notifier.error(this.i18n('Unable to find user id or verification string.')) + this.notifier.error($localize`Unable to find user id or verification string.`) } else { this.verifyEmail() } -- cgit v1.2.3