diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts index ab9c43625..3b45a40fd 100644 --- a/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
2 | import { AbstractControl, FormControl, Validators } from '@angular/forms' | ||
3 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
4 | import { BuildFormValidator } from './form-validator.service' | 2 | import { AbstractControl, Validators } from '@angular/forms' |
5 | import { VideoPlaylistPrivacy } from '@shared/models' | 3 | import { VideoPlaylistPrivacy } from '@shared/models' |
4 | import { BuildFormValidator } from './form-validator.service' | ||
6 | 5 | ||
7 | @Injectable() | 6 | @Injectable() |
8 | export class VideoPlaylistValidatorsService { | 7 | export class VideoPlaylistValidatorsService { |
@@ -11,7 +10,7 @@ export class VideoPlaylistValidatorsService { | |||
11 | readonly VIDEO_PLAYLIST_DESCRIPTION: BuildFormValidator | 10 | readonly VIDEO_PLAYLIST_DESCRIPTION: BuildFormValidator |
12 | readonly VIDEO_PLAYLIST_CHANNEL_ID: BuildFormValidator | 11 | readonly VIDEO_PLAYLIST_CHANNEL_ID: BuildFormValidator |
13 | 12 | ||
14 | constructor (private i18n: I18n) { | 13 | constructor () { |
15 | this.VIDEO_PLAYLIST_DISPLAY_NAME = { | 14 | this.VIDEO_PLAYLIST_DISPLAY_NAME = { |
16 | VALIDATORS: [ | 15 | VALIDATORS: [ |
17 | Validators.required, | 16 | Validators.required, |
@@ -19,9 +18,9 @@ export class VideoPlaylistValidatorsService { | |||
19 | Validators.maxLength(120) | 18 | Validators.maxLength(120) |
20 | ], | 19 | ], |
21 | MESSAGES: { | 20 | MESSAGES: { |
22 | 'required': this.i18n('Display name is required.'), | 21 | 'required': $localize`Display name is required.`, |
23 | 'minlength': this.i18n('Display name must be at least 1 character long.'), | 22 | 'minlength': $localize`Display name must be at least 1 character long.`, |
24 | 'maxlength': this.i18n('Display name cannot be more than 120 characters long.') | 23 | 'maxlength': $localize`Display name cannot be more than 120 characters long.` |
25 | } | 24 | } |
26 | } | 25 | } |
27 | 26 | ||
@@ -30,7 +29,7 @@ export class VideoPlaylistValidatorsService { | |||
30 | Validators.required | 29 | Validators.required |
31 | ], | 30 | ], |
32 | MESSAGES: { | 31 | MESSAGES: { |
33 | 'required': this.i18n('Privacy is required.') | 32 | 'required': $localize`Privacy is required.` |
34 | } | 33 | } |
35 | } | 34 | } |
36 | 35 | ||
@@ -40,15 +39,15 @@ export class VideoPlaylistValidatorsService { | |||
40 | Validators.maxLength(1000) | 39 | Validators.maxLength(1000) |
41 | ], | 40 | ], |
42 | MESSAGES: { | 41 | MESSAGES: { |
43 | 'minlength': i18n('Description must be at least 3 characters long.'), | 42 | 'minlength': $localize`Description must be at least 3 characters long.`, |
44 | 'maxlength': i18n('Description cannot be more than 1000 characters long.') | 43 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` |
45 | } | 44 | } |
46 | } | 45 | } |
47 | 46 | ||
48 | this.VIDEO_PLAYLIST_CHANNEL_ID = { | 47 | this.VIDEO_PLAYLIST_CHANNEL_ID = { |
49 | VALIDATORS: [ ], | 48 | VALIDATORS: [ ], |
50 | MESSAGES: { | 49 | MESSAGES: { |
51 | 'required': this.i18n('The channel is required when the playlist is public.') | 50 | 'required': $localize`The channel is required when the playlist is public.` |
52 | } | 51 | } |
53 | } | 52 | } |
54 | } | 53 | } |