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/+my-account/my-account-settings/my-account-change-password | |
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/+my-account/my-account-settings/my-account-change-password')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts index 6a16f8a2c..91fe4ec72 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts | |||
@@ -2,7 +2,6 @@ import { filter } from 'rxjs/operators' | |||
2 | import { Component, OnInit } from '@angular/core' | 2 | import { Component, OnInit } from '@angular/core' |
3 | import { AuthService, Notifier, UserService } from '@app/core' | 3 | import { AuthService, Notifier, UserService } from '@app/core' |
4 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' | 4 | import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
6 | import { User } from '@shared/models' | 5 | import { User } from '@shared/models' |
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
@@ -19,9 +18,8 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
19 | private userValidatorsService: UserValidatorsService, | 18 | private userValidatorsService: UserValidatorsService, |
20 | private notifier: Notifier, | 19 | private notifier: Notifier, |
21 | private authService: AuthService, | 20 | private authService: AuthService, |
22 | private userService: UserService, | 21 | private userService: UserService |
23 | private i18n: I18n | 22 | ) { |
24 | ) { | ||
25 | super() | 23 | super() |
26 | } | 24 | } |
27 | 25 | ||
@@ -47,7 +45,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
47 | 45 | ||
48 | this.userService.changePassword(currentPassword, newPassword).subscribe( | 46 | this.userService.changePassword(currentPassword, newPassword).subscribe( |
49 | () => { | 47 | () => { |
50 | this.notifier.success(this.i18n('Password updated.')) | 48 | this.notifier.success($localize`Password updated.`) |
51 | 49 | ||
52 | this.form.reset() | 50 | this.form.reset() |
53 | this.error = null | 51 | this.error = null |
@@ -55,7 +53,7 @@ export class MyAccountChangePasswordComponent extends FormReactive implements On | |||
55 | 53 | ||
56 | err => { | 54 | err => { |
57 | if (err.status === 401) { | 55 | if (err.status === 401) { |
58 | this.error = this.i18n('You current password is invalid.') | 56 | this.error = $localize`You current password is invalid.` |
59 | return | 57 | return |
60 | } | 58 | } |
61 | 59 | ||