From bf4b219234621ac7e9a027203adeb01816024114 Mon Sep 17 00:00:00 2001 From: HardiReady Date: Fri, 5 Oct 2018 10:29:57 +0200 Subject: [PATCH] Fix translations in campaign overview --- .../overview/campaign-overview.component.html | 2 +- .../overview/campaign-overview.component.ts | 19 +++---------------- static/src/assets/i18n/statistics/en.json | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/static/src/app/statistic/campaign/overview/campaign-overview.component.html b/static/src/app/statistic/campaign/overview/campaign-overview.component.html index 4bed291..5abdacb 100644 --- a/static/src/app/statistic/campaign/overview/campaign-overview.component.html +++ b/static/src/app/statistic/campaign/overview/campaign-overview.component.html @@ -26,7 +26,7 @@ [legendTitle]="legendTitle" [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" - [yAxisLabel]="yAxisLabel" + yAxisLabel="{{yAxisLabel | translate}}" [autoScale]="autoscale" [timeline]="timeline" [roundDomains]="roundDomains"> diff --git a/static/src/app/statistic/campaign/overview/campaign-overview.component.ts b/static/src/app/statistic/campaign/overview/campaign-overview.component.ts index a67de73..de6804b 100644 --- a/static/src/app/statistic/campaign/overview/campaign-overview.component.ts +++ b/static/src/app/statistic/campaign/overview/campaign-overview.component.ts @@ -66,19 +66,6 @@ export class StatisticOverviewComponent implements OnInit { if (itemsProcessed === campaigns.length) { if (this.id === 'all') { this.timeline = true; - this.title = 'Gesamtübersicht'; - wars.sort((a, b) => { - // sort by dates, because older campaign can contain newer war - if (a['date'] > (b['date'])) { - return -1; - } - if (a['date'] < (b['date'])) { - return 1; - } - return 0; - }); - } else { - this.title = campaign.title; } this.initChart(wars); } @@ -89,15 +76,15 @@ export class StatisticOverviewComponent implements OnInit { switch (parseInt(index, 10)) { case 0: this.currentData = this.pointSumData; - this.yAxisLabel = 'Gesamtpunkte'; + this.yAxisLabel = 'stats.graph.select.sum.points'; break; case 1: this.currentData = this.pointData; - this.yAxisLabel = 'Punkte'; + this.yAxisLabel = 'stats.graph.select.battle.points'; break; case 2: this.currentData = this.playerData; - this.yAxisLabel = 'Anzahl Spieler'; + this.yAxisLabel = 'stats.graph.select.player.count'; break; } } diff --git a/static/src/assets/i18n/statistics/en.json b/static/src/assets/i18n/statistics/en.json index 8eb7fc2..8b37afe 100644 --- a/static/src/assets/i18n/statistics/en.json +++ b/static/src/assets/i18n/statistics/en.json @@ -24,7 +24,7 @@ "stats.graph.select.sum.points": "Total Score", "stats.graph.select.battle.points": "Score per Battle", - "stats.graph.select.player.count": "Player count", + "stats.graph.select.player.count": "Player Count", "stats.fraction.select.points": "Score", "stats.fraction.select.budget": "Budget",