diff options
Diffstat (limited to 'client/src/app/shared/forms/form-validators/video-captions-validators.service.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/video-captions-validators.service.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts b/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts new file mode 100644 index 000000000..d1b4667bb --- /dev/null +++ b/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts | |||
@@ -0,0 +1,27 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { Injectable } from '@angular/core' | ||
4 | import { BuildFormValidator } from '@app/shared' | ||
5 | |||
6 | @Injectable() | ||
7 | export class VideoCaptionsValidatorsService { | ||
8 | readonly VIDEO_CAPTION_LANGUAGE: BuildFormValidator | ||
9 | readonly VIDEO_CAPTION_FILE: BuildFormValidator | ||
10 | |||
11 | constructor (private i18n: I18n) { | ||
12 | |||
13 | this.VIDEO_CAPTION_LANGUAGE = { | ||
14 | VALIDATORS: [ Validators.required ], | ||
15 | MESSAGES: { | ||
16 | 'required': this.i18n('Video caption language is required.') | ||
17 | } | ||
18 | } | ||
19 | |||
20 | this.VIDEO_CAPTION_FILE = { | ||
21 | VALIDATORS: [ Validators.required ], | ||
22 | MESSAGES: { | ||
23 | 'required': this.i18n('Video caption file is required.') | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | } | ||