aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/users
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/shared/shared-main/users
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/shared/shared-main/users')
-rw-r--r--client/src/app/shared/shared-main/users/user-quota.component.ts10
1 files changed, 3 insertions, 7 deletions
diff --git a/client/src/app/shared/shared-main/users/user-quota.component.ts b/client/src/app/shared/shared-main/users/user-quota.component.ts
index 6830ad8fe..b38619186 100644
--- a/client/src/app/shared/shared-main/users/user-quota.component.ts
+++ b/client/src/app/shared/shared-main/users/user-quota.component.ts
@@ -1,7 +1,6 @@
1import { Subject } from 'rxjs' 1import { Subject } from 'rxjs'
2import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
3import { User, UserService } from '@app/core' 3import { User, UserService } from '@app/core'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { BytesPipe } from '../angular' 4import { BytesPipe } from '../angular'
6 5
7@Component({ 6@Component({
@@ -22,10 +21,7 @@ export class UserQuotaComponent implements OnInit {
22 userVideoQuotaUsedDaily = 0 21 userVideoQuotaUsedDaily = 0
23 userVideoQuotaDailyPercentage = 15 22 userVideoQuotaDailyPercentage = 15
24 23
25 constructor ( 24 constructor (private userService: UserService) { }
26 private userService: UserService,
27 private i18n: I18n
28 ) { }
29 25
30 ngOnInit () { 26 ngOnInit () {
31 this.userInformationLoaded.subscribe( 27 this.userInformationLoaded.subscribe(
@@ -33,13 +29,13 @@ export class UserQuotaComponent implements OnInit {
33 if (this.user.videoQuota !== -1) { 29 if (this.user.videoQuota !== -1) {
34 this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() 30 this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString()
35 } else { 31 } else {
36 this.userVideoQuota = this.i18n('Unlimited') 32 this.userVideoQuota = $localize`Unlimited`
37 } 33 }
38 34
39 if (this.user.videoQuotaDaily !== -1) { 35 if (this.user.videoQuotaDaily !== -1) {
40 this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() 36 this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString()
41 } else { 37 } else {
42 this.userVideoQuotaDaily = this.i18n('Unlimited') 38 this.userVideoQuotaDaily = $localize`Unlimited`
43 } 39 }
44 } 40 }
45 ) 41 )