aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/users/user-edit/user-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/+admin/users/user-edit/user-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/+admin/users/user-edit/user-password.component.ts')
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts
index 33c7de31f..25f13495a 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-password.component.ts
@@ -1,7 +1,6 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { Notifier, UserService } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms' 3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserUpdate } from '@shared/models' 4import { UserUpdate } from '@shared/models'
6 5
7@Component({ 6@Component({
@@ -20,9 +19,8 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
20 protected formValidatorService: FormValidatorService, 19 protected formValidatorService: FormValidatorService,
21 private userValidatorsService: UserValidatorsService, 20 private userValidatorsService: UserValidatorsService,
22 private notifier: Notifier, 21 private notifier: Notifier,
23 private userService: UserService, 22 private userService: UserService
24 private i18n: I18n 23 ) {
25 ) {
26 super() 24 super()
27 } 25 }
28 26
@@ -39,9 +37,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
39 37
40 this.userService.updateUser(this.userId, userUpdate).subscribe( 38 this.userService.updateUser(this.userId, userUpdate).subscribe(
41 () => { 39 () => {
42 this.notifier.success( 40 this.notifier.success($localize`Password changed for user ${this.username}.`)
43 this.i18n('Password changed for user {{username}}.', { username: this.username })
44 )
45 }, 41 },
46 42
47 err => this.error = err.message 43 err => this.error = err.message
@@ -53,6 +49,6 @@ export class UserPasswordComponent extends FormReactive implements OnInit {
53 } 49 }
54 50
55 getFormButtonTitle () { 51 getFormButtonTitle () {
56 return this.i18n('Update user password') 52 return $localize`Update user password`
57 } 53 }
58} 54}