]>
Commit | Line | Data |
---|---|---|
40e87e9e C |
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 | } |