From 0975cd5cf260bd06c797ac7582675ac624a47ebc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Jun 2018 16:31:52 +0200 Subject: Translate tab heads --- client/src/app/+admin/follows/follows.component.ts | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'client/src/app/+admin/follows/follows.component.ts') diff --git a/client/src/app/+admin/follows/follows.component.ts b/client/src/app/+admin/follows/follows.component.ts index f29ad384f..f7af9826c 100644 --- a/client/src/app/+admin/follows/follows.component.ts +++ b/client/src/app/+admin/follows/follows.component.ts @@ -1,6 +1,7 @@ import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core' import { NavigationEnd, Router } from '@angular/router' import { TabsetComponent } from 'ngx-bootstrap/tabs' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ templateUrl: './follows.component.html', @@ -9,22 +10,27 @@ import { TabsetComponent } from 'ngx-bootstrap/tabs' export class FollowsComponent implements OnInit, AfterViewInit { @ViewChild('followsMenuTabs') followsMenuTabs: TabsetComponent - links = [ - { - path: 'following-list', - title: 'Following' - }, - { - path: 'following-add', - title: 'Follow' - }, - { - path: 'followers-list', - title: 'Followers' - } - ] - - constructor (private router: Router) {} + links: { path: string, title: string }[] = [] + + constructor ( + private i18n: I18n, + private router: Router + ) { + this.links = [ + { + path: 'following-list', + title: this.i18n('Following') + }, + { + path: 'following-add', + title: this.i18n('Follow') + }, + { + path: 'followers-list', + title: this.i18n('Followers') + } + ] + } ngOnInit () { this.router.events.subscribe( -- cgit v1.2.3