diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:01:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-05 15:02:27 +0200 |
commit | e309822b93d9b69f30cbe830ef3d09dfdb2c13b2 (patch) | |
tree | 41dbc3b3108ced7fdba4062974e568695c30e486 /client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts | |
parent | d4d5853e65e584ca51c718f8df590b987f981047 (diff) | |
download | PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.gz PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.tar.zst PeerTube-e309822b93d9b69f30cbe830ef3d09dfdb2c13b2.zip |
Add form validator translations
Diffstat (limited to 'client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts b/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts new file mode 100644 index 000000000..774e6a488 --- /dev/null +++ b/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts | |||
@@ -0,0 +1,20 @@ | |||
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 VideoAbuseValidatorsService { | ||
8 | readonly VIDEO_ABUSE_REASON: BuildFormValidator | ||
9 | |||
10 | constructor (private i18n: I18n) { | ||
11 | this.VIDEO_ABUSE_REASON = { | ||
12 | VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(300) ], | ||
13 | MESSAGES: { | ||
14 | 'required': this.i18n('Report reason is required.'), | ||
15 | 'minlength': this.i18n('Report reason must be at least 2 characters long.'), | ||
16 | 'maxlength': this.i18n('Report reason cannot be more than 300 characters long.') | ||
17 | } | ||
18 | } | ||
19 | } | ||
20 | } | ||