diff options
Diffstat (limited to 'client/src/app/+accounts/accounts.component.ts')
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 9288fcb42..bbce62c35 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -5,7 +5,6 @@ import { ActivatedRoute } from '@angular/router' | |||
5 | import { AuthService, Notifier, RedirectService, RestExtractor, ScreenService, UserService } from '@app/core' | 5 | import { AuthService, Notifier, RedirectService, RestExtractor, ScreenService, UserService } from '@app/core' |
6 | import { Account, AccountService, DropdownAction, ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' | 6 | import { Account, AccountService, DropdownAction, ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main' |
7 | import { AccountReportComponent } from '@app/shared/shared-moderation' | 7 | import { AccountReportComponent } from '@app/shared/shared-moderation' |
8 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
9 | import { User, UserRight } from '@shared/models' | 8 | import { User, UserRight } from '@shared/models' |
10 | 9 | ||
11 | @Component({ | 10 | @Component({ |
@@ -36,8 +35,7 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
36 | private restExtractor: RestExtractor, | 35 | private restExtractor: RestExtractor, |
37 | private redirectService: RedirectService, | 36 | private redirectService: RedirectService, |
38 | private authService: AuthService, | 37 | private authService: AuthService, |
39 | private screenService: ScreenService, | 38 | private screenService: ScreenService |
40 | private i18n: I18n | ||
41 | ) { | 39 | ) { |
42 | } | 40 | } |
43 | 41 | ||
@@ -58,9 +56,9 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
58 | ) | 56 | ) |
59 | 57 | ||
60 | this.links = [ | 58 | this.links = [ |
61 | { label: this.i18n('VIDEO CHANNELS'), routerLink: 'video-channels' }, | 59 | { label: $localize`VIDEO CHANNELS`, routerLink: 'video-channels' }, |
62 | { label: this.i18n('VIDEOS'), routerLink: 'videos' }, | 60 | { label: $localize`VIDEOS`, routerLink: 'videos' }, |
63 | { label: this.i18n('ABOUT'), routerLink: 'about' } | 61 | { label: $localize`ABOUT`, routerLink: 'about' } |
64 | ] | 62 | ] |
65 | } | 63 | } |
66 | 64 | ||
@@ -88,11 +86,13 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
88 | } | 86 | } |
89 | 87 | ||
90 | activateCopiedMessage () { | 88 | activateCopiedMessage () { |
91 | this.notifier.success(this.i18n('Username copied')) | 89 | this.notifier.success($localize`Username copied`) |
92 | } | 90 | } |
93 | 91 | ||
94 | subscribersDisplayFor (count: number) { | 92 | subscribersDisplayFor (count: number) { |
95 | return this.i18n('{count, plural, =1 {1 subscriber} other {{{count}} subscribers}}', { count }) | 93 | if (count === 1) return $localize`1 subscriber` |
94 | |||
95 | return $localize`${count} subscribers` | ||
96 | } | 96 | } |
97 | 97 | ||
98 | private onAccount (account: Account) { | 98 | private onAccount (account: Account) { |
@@ -105,16 +105,14 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
105 | () => { | 105 | () => { |
106 | this.isAccountManageable = this.account.userId && this.account.userId === this.authService.getUser().id | 106 | this.isAccountManageable = this.account.userId && this.account.userId === this.authService.getUser().id |
107 | 107 | ||
108 | this.accountFollowerTitle = this.i18n( | 108 | const followers = this.subscribersDisplayFor(account.followersCount) |
109 | '{{followers}} direct account followers', | 109 | this.accountFollowerTitle = $localize`${followers} direct account followers` |
110 | { followers: this.subscribersDisplayFor(account.followersCount) } | ||
111 | ) | ||
112 | 110 | ||
113 | // It's not our account, we can report it | 111 | // It's not our account, we can report it |
114 | if (!this.isAccountManageable) { | 112 | if (!this.isAccountManageable) { |
115 | this.prependModerationActions = [ | 113 | this.prependModerationActions = [ |
116 | { | 114 | { |
117 | label: this.i18n('Report account'), | 115 | label: $localize`Report account`, |
118 | handler: () => this.showReportModal() | 116 | handler: () => this.showReportModal() |
119 | } | 117 | } |
120 | ] | 118 | ] |