aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/follows/following-list
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-04 16:21:17 +0200
committerChocobozzz <me@florianbigard.com>2018-06-05 08:43:01 +0200
commitb1d40cff89f7cff565a98cdbcea9a624196a169a (patch)
treed24746c1cc69f50471a9eba0dfb1c1bae06a1870 /client/src/app/+admin/follows/following-list
parent989e526abf0c0dd7958deb630df009608561bb67 (diff)
downloadPeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.gz
PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.tar.zst
PeerTube-b1d40cff89f7cff565a98cdbcea9a624196a169a.zip
Add i18n attributes
Diffstat (limited to 'client/src/app/+admin/follows/following-list')
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.html8
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts18
2 files changed, 17 insertions, 9 deletions
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html
index 24981d3e9..e4a45e88c 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.html
+++ b/client/src/app/+admin/follows/following-list/following-list.component.html
@@ -4,10 +4,10 @@
4> 4>
5 <ng-template pTemplate="header"> 5 <ng-template pTemplate="header">
6 <tr> 6 <tr>
7 <th style="width: 60px">ID</th> 7 <th i18n style="width: 60px">ID</th>
8 <th>Host</th> 8 <th i18n>Host</th>
9 <th>State</th> 9 <th i18n>State</th>
10 <th pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th> 10 <th i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
11 <th></th> 11 <th></th>
12 </tr> 12 </tr>
13 </ng-template> 13 </ng-template>
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index 873a5d965..2fb818c90 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -5,6 +5,7 @@ import { AccountFollow } from '../../../../../../shared/models/actors/follow.mod
5import { ConfirmService } from '../../../core/confirm/confirm.service' 5import { ConfirmService } from '../../../core/confirm/confirm.service'
6import { RestPagination, RestTable } from '../../../shared' 6import { RestPagination, RestTable } from '../../../shared'
7import { FollowService } from '../shared' 7import { FollowService } from '../shared'
8import { I18n } from '@ngx-translate/i18n-polyfill'
8 9
9@Component({ 10@Component({
10 selector: 'my-followers-list', 11 selector: 'my-followers-list',
@@ -20,7 +21,8 @@ export class FollowingListComponent extends RestTable implements OnInit {
20 constructor ( 21 constructor (
21 private notificationsService: NotificationsService, 22 private notificationsService: NotificationsService,
22 private confirmService: ConfirmService, 23 private confirmService: ConfirmService,
23 private followService: FollowService 24 private followService: FollowService,
25 private i18n: I18n
24 ) { 26 ) {
25 super() 27 super()
26 } 28 }
@@ -30,16 +32,22 @@ export class FollowingListComponent extends RestTable implements OnInit {
30 } 32 }
31 33
32 async removeFollowing (follow: AccountFollow) { 34 async removeFollowing (follow: AccountFollow) {
33 const res = await this.confirmService.confirm(`Do you really want to unfollow ${follow.following.host}?`, 'Unfollow') 35 const res = await this.confirmService.confirm(
36 this.i18n('Do you really want to unfollow {{ host }}?', { host: follow.following.host }),
37 this.i18n('Unfollow')
38 )
34 if (res === false) return 39 if (res === false) return
35 40
36 this.followService.unfollow(follow).subscribe( 41 this.followService.unfollow(follow).subscribe(
37 () => { 42 () => {
38 this.notificationsService.success('Success', `You are not following ${follow.following.host} anymore.`) 43 this.notificationsService.success(
44 this.i18n('Success'),
45 this.i18n('You are not following {{ host }} anymore.', { host: follow.following.host })
46 )
39 this.loadData() 47 this.loadData()
40 }, 48 },
41 49
42 err => this.notificationsService.error('Error', err.message) 50 err => this.notificationsService.error(this.i18n('Error'), err.message)
43 ) 51 )
44 } 52 }
45 53
@@ -51,7 +59,7 @@ export class FollowingListComponent extends RestTable implements OnInit {
51 this.totalRecords = resultList.total 59 this.totalRecords = resultList.total
52 }, 60 },
53 61
54 err => this.notificationsService.error('Error', err.message) 62 err => this.notificationsService.error(this.i18n('Error'), err.message)
55 ) 63 )
56 } 64 }
57} 65}