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 --- .../my-account-change-password.component.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'client/src/app/+my-account/my-account-settings/my-account-change-password') diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index 6a16f8a2c..91fe4ec72 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts @@ -2,7 +2,6 @@ import { filter } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' import { AuthService, Notifier, UserService } from '@app/core' import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' -import { I18n } from '@ngx-translate/i18n-polyfill' import { User } from '@shared/models' @Component({ @@ -19,9 +18,8 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On private userValidatorsService: UserValidatorsService, private notifier: Notifier, private authService: AuthService, - private userService: UserService, - private i18n: I18n - ) { + private userService: UserService + ) { super() } @@ -47,7 +45,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On this.userService.changePassword(currentPassword, newPassword).subscribe( () => { - this.notifier.success(this.i18n('Password updated.')) + this.notifier.success($localize`Password updated.`) this.form.reset() this.error = null @@ -55,7 +53,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On err => { if (err.status === 401) { - this.error = this.i18n('You current password is invalid.') + this.error = $localize`You current password is invalid.` return } -- cgit v1.2.3