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 --- client/src/app/+reset-password/reset-password.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/+reset-password/reset-password.component.ts') diff --git a/client/src/app/+reset-password/reset-password.component.ts b/client/src/app/+reset-password/reset-password.component.ts index 8d50e9839..16e4f4090 100644 --- a/client/src/app/+reset-password/reset-password.component.ts +++ b/client/src/app/+reset-password/reset-password.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { Notifier, UserService } from '@app/core' import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms' -import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-login', @@ -21,9 +20,8 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { private userService: UserService, private notifier: Notifier, private router: Router, - private route: ActivatedRoute, - private i18n: I18n - ) { + private route: ActivatedRoute + ) { super() } @@ -37,7 +35,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { this.verificationString = this.route.snapshot.queryParams['verificationString'] 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.`) this.router.navigate([ '/' ]) } } @@ -46,7 +44,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit { this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) .subscribe( () => { - this.notifier.success(this.i18n('Your password has been successfully reset!')) + this.notifier.success($localize`Your password has been successfully reset!`) this.router.navigate([ '/login' ]) }, -- cgit v1.2.3