diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/shared/shared-forms/form-validators/login-validators.service.ts | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip |
Migrate to $localize
* Remove i18n polyfill to translate things in components
* Reduce bundle sizes
* Improve runtime perf
* Reduce a lot the time to make a full client build
* Reduce client build complexity
* We don't need a service to translate things anymore (so we will be able to translate title pages etc)
Unfortunately we may loose some translations in the migration process.
I'll put a message on weblate to notify translators
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators/login-validators.service.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/form-validators/login-validators.service.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts index a5837357e..67ea11f20 100644 --- a/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts +++ b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { Validators } from '@angular/forms' | ||
4 | import { BuildFormValidator } from './form-validator.service' | 3 | import { BuildFormValidator } from './form-validator.service' |
5 | 4 | ||
6 | @Injectable() | 5 | @Injectable() |
@@ -8,13 +7,13 @@ export class LoginValidatorsService { | |||
8 | readonly LOGIN_USERNAME: BuildFormValidator | 7 | readonly LOGIN_USERNAME: BuildFormValidator |
9 | readonly LOGIN_PASSWORD: BuildFormValidator | 8 | readonly LOGIN_PASSWORD: BuildFormValidator |
10 | 9 | ||
11 | constructor (private i18n: I18n) { | 10 | constructor () { |
12 | this.LOGIN_USERNAME = { | 11 | this.LOGIN_USERNAME = { |
13 | VALIDATORS: [ | 12 | VALIDATORS: [ |
14 | Validators.required | 13 | Validators.required |
15 | ], | 14 | ], |
16 | MESSAGES: { | 15 | MESSAGES: { |
17 | 'required': this.i18n('Username is required.') | 16 | 'required': $localize`Username is required.` |
18 | } | 17 | } |
19 | } | 18 | } |
20 | 19 | ||
@@ -23,7 +22,7 @@ export class LoginValidatorsService { | |||
23 | Validators.required | 22 | Validators.required |
24 | ], | 23 | ], |
25 | MESSAGES: { | 24 | MESSAGES: { |
26 | 'required': this.i18n('Password is required.') | 25 | 'required': $localize`Password is required.` |
27 | } | 26 | } |
28 | } | 27 | } |
29 | } | 28 | } |