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/login-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/login-validators.service.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/login-validators.service.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/login-validators.service.ts b/client/src/app/shared/forms/form-validators/login-validators.service.ts new file mode 100644 index 000000000..9d68f830c --- /dev/null +++ b/client/src/app/shared/forms/form-validators/login-validators.service.ts | |||
@@ -0,0 +1,30 @@ | |||
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 LoginValidatorsService { | ||
8 | readonly LOGIN_USERNAME: BuildFormValidator | ||
9 | readonly LOGIN_PASSWORD: BuildFormValidator | ||
10 | |||
11 | constructor (private i18n: I18n) { | ||
12 | this.LOGIN_USERNAME = { | ||
13 | VALIDATORS: [ | ||
14 | Validators.required | ||
15 | ], | ||
16 | MESSAGES: { | ||
17 | 'required': this.i18n('Username is required.') | ||
18 | } | ||
19 | } | ||
20 | |||
21 | this.LOGIN_PASSWORD = { | ||
22 | VALIDATORS: [ | ||
23 | Validators.required | ||
24 | ], | ||
25 | MESSAGES: { | ||
26 | 'required': this.i18n('Password is required.') | ||
27 | } | ||
28 | } | ||
29 | } | ||
30 | } | ||