aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+reset-password/reset-password.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-12 10:40:04 +0200
committerChocobozzz <me@florianbigard.com>2020-08-14 10:28:30 +0200
commit66357162f8e1227495f09bd4f68446aad7071c6d (patch)
tree7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/+reset-password/reset-password.component.ts
parent8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff)
downloadPeerTube-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/+reset-password/reset-password.component.ts')
-rw-r--r--client/src/app/+reset-password/reset-password.component.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+reset-password/reset-password.component.ts b/client/src/app/+reset-password/reset-password.component.ts
index 8d50e9839..16e4f4090 100644
--- a/client/src/app/+reset-password/reset-password.component.ts
+++ b/client/src/app/+reset-password/reset-password.component.ts
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { Notifier, UserService } from '@app/core' 3import { Notifier, UserService } from '@app/core'
4import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms' 4import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms'
5import { I18n } from '@ngx-translate/i18n-polyfill'
6 5
7@Component({ 6@Component({
8 selector: 'my-login', 7 selector: 'my-login',
@@ -21,9 +20,8 @@ export class ResetPasswordComponent extends FormReactive implements OnInit {
21 private userService: UserService, 20 private userService: UserService,
22 private notifier: Notifier, 21 private notifier: Notifier,
23 private router: Router, 22 private router: Router,
24 private route: ActivatedRoute, 23 private route: ActivatedRoute
25 private i18n: I18n 24 ) {
26 ) {
27 super() 25 super()
28 } 26 }
29 27
@@ -37,7 +35,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit {
37 this.verificationString = this.route.snapshot.queryParams['verificationString'] 35 this.verificationString = this.route.snapshot.queryParams['verificationString']
38 36
39 if (!this.userId || !this.verificationString) { 37 if (!this.userId || !this.verificationString) {
40 this.notifier.error(this.i18n('Unable to find user id or verification string.')) 38 this.notifier.error($localize`Unable to find user id or verification string.`)
41 this.router.navigate([ '/' ]) 39 this.router.navigate([ '/' ])
42 } 40 }
43 } 41 }
@@ -46,7 +44,7 @@ export class ResetPasswordComponent extends FormReactive implements OnInit {
46 this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password) 44 this.userService.resetPassword(this.userId, this.verificationString, this.form.value.password)
47 .subscribe( 45 .subscribe(
48 () => { 46 () => {
49 this.notifier.success(this.i18n('Your password has been successfully reset!')) 47 this.notifier.success($localize`Your password has been successfully reset!`)
50 this.router.navigate([ '/login' ]) 48 this.router.navigate([ '/login' ])
51 }, 49 },
52 50