]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/followers-list/followers-list.component.ts
Support occitan
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / followers-list / followers-list.component.ts
index 64981570902b0450ce8db3c123eb961b92fbcc59..96fb67588ddda45617e239bfd19c7839ab0ac54e 100644 (file)
@@ -1,17 +1,18 @@
-import { Component } from '@angular/core'
+import { Component, OnInit } from '@angular/core'
 
 import { NotificationsService } from 'angular2-notifications'
 import { SortMeta } from 'primeng/primeng'
 import { AccountFollow } from '../../../../../../shared/models/actors/follow.model'
 import { RestPagination, RestTable } from '../../../shared'
 import { FollowService } from '../shared'
+import { I18n } from '@ngx-translate/i18n-polyfill'
 
 @Component({
   selector: 'my-followers-list',
   templateUrl: './followers-list.component.html',
   styleUrls: [ './followers-list.component.scss' ]
 })
-export class FollowersListComponent extends RestTable {
+export class FollowersListComponent extends RestTable implements OnInit {
   followers: AccountFollow[] = []
   totalRecords = 0
   rowsPerPage = 10
@@ -20,11 +21,16 @@ export class FollowersListComponent extends RestTable {
 
   constructor (
     private notificationsService: NotificationsService,
-    private followService: FollowService
+    private followService: FollowService,
+    private i18n: I18n
   ) {
     super()
   }
 
+  ngOnInit () {
+    this.loadSort()
+  }
+
   protected loadData () {
     this.followService.getFollowers(this.pagination, this.sort)
                       .subscribe(
@@ -33,7 +39,7 @@ export class FollowersListComponent extends RestTable {
                           this.totalRecords = resultList.total
                         },
 
-                        err => this.notificationsService.error('Error', err.message)
+                        err => this.notificationsService.error(this.i18n('Error'), err.message)
                       )
   }
 }