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 --- .../form-validators/video-block-validators.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts') diff --git a/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts index ddf0ab5eb..bce1880dc 100644 --- a/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts @@ -1,18 +1,17 @@ -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() export class VideoBlockValidatorsService { readonly VIDEO_BLOCK_REASON: BuildFormValidator - constructor (private i18n: I18n) { + constructor () { this.VIDEO_BLOCK_REASON = { VALIDATORS: [ Validators.minLength(2), Validators.maxLength(300) ], MESSAGES: { - 'minlength': this.i18n('Block reason must be at least 2 characters long.'), - 'maxlength': this.i18n('Block reason cannot be more than 300 characters long.') + 'minlength': $localize`Block reason must be at least 2 characters long.`, + 'maxlength': $localize`Block reason cannot be more than 300 characters long.` } } } -- cgit v1.2.3