diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts index 96a35a48f..3628f0b60 100644 --- a/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | 1 | import { Injectable } from '@angular/core' |
2 | import { Validators } from '@angular/forms' | 2 | import { Validators } from '@angular/forms' |
3 | import { BuildFormValidator } from './form-validator.service' | 3 | import { BuildFormValidator } from './form-validator.service' |
4 | import { Injectable } from '@angular/core' | ||
5 | 4 | ||
6 | @Injectable() | 5 | @Injectable() |
7 | export class InstanceValidatorsService { | 6 | export class InstanceValidatorsService { |
@@ -10,13 +9,13 @@ export class InstanceValidatorsService { | |||
10 | readonly SUBJECT: BuildFormValidator | 9 | readonly SUBJECT: BuildFormValidator |
11 | readonly BODY: BuildFormValidator | 10 | readonly BODY: BuildFormValidator |
12 | 11 | ||
13 | constructor (private i18n: I18n) { | 12 | constructor () { |
14 | 13 | ||
15 | this.FROM_EMAIL = { | 14 | this.FROM_EMAIL = { |
16 | VALIDATORS: [ Validators.required, Validators.email ], | 15 | VALIDATORS: [ Validators.required, Validators.email ], |
17 | MESSAGES: { | 16 | MESSAGES: { |
18 | 'required': this.i18n('Email is required.'), | 17 | 'required': $localize`Email is required.`, |
19 | 'email': this.i18n('Email must be valid.') | 18 | 'email': $localize`Email must be valid.` |
20 | } | 19 | } |
21 | } | 20 | } |
22 | 21 | ||
@@ -27,9 +26,9 @@ export class InstanceValidatorsService { | |||
27 | Validators.maxLength(120) | 26 | Validators.maxLength(120) |
28 | ], | 27 | ], |
29 | MESSAGES: { | 28 | MESSAGES: { |
30 | 'required': this.i18n('Your name is required.'), | 29 | 'required': $localize`Your name is required.`, |
31 | 'minlength': this.i18n('Your name must be at least 1 character long.'), | 30 | 'minlength': $localize`Your name must be at least 1 character long.`, |
32 | 'maxlength': this.i18n('Your name cannot be more than 120 characters long.') | 31 | 'maxlength': $localize`Your name cannot be more than 120 characters long.` |
33 | } | 32 | } |
34 | } | 33 | } |
35 | 34 | ||
@@ -40,9 +39,9 @@ export class InstanceValidatorsService { | |||
40 | Validators.maxLength(120) | 39 | Validators.maxLength(120) |
41 | ], | 40 | ], |
42 | MESSAGES: { | 41 | MESSAGES: { |
43 | 'required': this.i18n('A subject is required.'), | 42 | 'required': $localize`A subject is required.`, |
44 | 'minlength': this.i18n('The subject must be at least 1 character long.'), | 43 | 'minlength': $localize`The subject must be at least 1 character long.`, |
45 | 'maxlength': this.i18n('The subject cannot be more than 120 characters long.') | 44 | 'maxlength': $localize`The subject cannot be more than 120 characters long.` |
46 | } | 45 | } |
47 | } | 46 | } |
48 | 47 | ||
@@ -53,9 +52,9 @@ export class InstanceValidatorsService { | |||
53 | Validators.maxLength(5000) | 52 | Validators.maxLength(5000) |
54 | ], | 53 | ], |
55 | MESSAGES: { | 54 | MESSAGES: { |
56 | 'required': this.i18n('A message is required.'), | 55 | 'required': $localize`A message is required.`, |
57 | 'minlength': this.i18n('The message must be at least 3 characters long.'), | 56 | 'minlength': $localize`The message must be at least 3 characters long.`, |
58 | 'maxlength': this.i18n('The message cannot be more than 5000 characters long.') | 57 | 'maxlength': $localize`The message cannot be more than 5000 characters long.` |
59 | } | 58 | } |
60 | } | 59 | } |
61 | } | 60 | } |