aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.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/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.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/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts')
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts16
1 files changed, 7 insertions, 9 deletions
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
index ae6ac5387..387e9e7cd 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
@@ -1,6 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core' 2import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4 3
5@Component({ 4@Component({
6 selector: 'my-account-danger-zone', 5 selector: 'my-account-danger-zone',
@@ -15,23 +14,22 @@ export class MyAccountDangerZoneComponent {
15 private notifier: Notifier, 14 private notifier: Notifier,
16 private userService: UserService, 15 private userService: UserService,
17 private confirmService: ConfirmService, 16 private confirmService: ConfirmService,
18 private redirectService: RedirectService, 17 private redirectService: RedirectService
19 private i18n: I18n 18 ) { }
20 ) { }
21 19
22 async deleteMe () { 20 async deleteMe () {
23 const res = await this.confirmService.confirmWithInput( 21 const res = await this.confirmService.confirmWithInput(
24 this.i18n('Are you sure you want to delete your account? This will delete all your data, including channels, videos and comments. Content cached by other servers and other third-parties might make longer to be deleted.'), 22 $localize`Are you sure you want to delete your account? This will delete all your data, including channels, videos and comments. Content cached by other servers and other third-parties might make longer to be deleted.`,
25 this.i18n('Type your username to confirm'), 23 $localize`Type your username to confirm`,
26 this.user.username, 24 this.user.username,
27 this.i18n('Delete your account'), 25 $localize`Delete your account`,
28 this.i18n('Delete my account') 26 $localize`Delete my account`
29 ) 27 )
30 if (res === false) return 28 if (res === false) return
31 29
32 this.userService.deleteMe().subscribe( 30 this.userService.deleteMe().subscribe(
33 () => { 31 () => {
34 this.notifier.success(this.i18n('Your account is deleted.')) 32 this.notifier.success($localize`Your account is deleted.`)
35 33
36 this.authService.logout() 34 this.authService.logout()
37 this.redirectService.redirectToHomepage() 35 this.redirectService.redirectToHomepage()