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 --- .../shared-forms/form-validators/login-validators.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-forms/form-validators/login-validators.service.ts') diff --git a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts index a5837357e..67ea11f20 100644 --- a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts @@ -1,6 +1,5 @@ -import { I18n } from '@ngx-translate/i18n-polyfill' -import { Validators } from '@angular/forms' import { Injectable } from '@angular/core' +import { Validators } from '@angular/forms' import { BuildFormValidator } from './form-validator.service' @Injectable() @@ -8,13 +7,13 @@ export class LoginValidatorsService { readonly LOGIN_USERNAME: BuildFormValidator readonly LOGIN_PASSWORD: BuildFormValidator - constructor (private i18n: I18n) { + constructor () { this.LOGIN_USERNAME = { VALIDATORS: [ Validators.required ], MESSAGES: { - 'required': this.i18n('Username is required.') + 'required': $localize`Username is required.` } } @@ -23,7 +22,7 @@ export class LoginValidatorsService { Validators.required ], MESSAGES: { - 'required': this.i18n('Password is required.') + 'required': $localize`Password is required.` } } } -- cgit v1.2.3