Add more i18n strings

pull/46/head
HardiReady 2018-10-03 11:22:21 +02:00
parent 37eab6f33d
commit 8ad9000766
9 changed files with 75 additions and 52 deletions

View File

@ -74,7 +74,9 @@ export class CampaignPlayerDetailComponent implements OnInit {
for (let i = 0; i < this.playerAttributeNameMap.length; i++) { for (let i = 0; i < this.playerAttributeNameMap.length; i++) {
const attr = this.playerAttributeNameMap[i]; const attr = this.playerAttributeNameMap[i];
this.graphData.push({key: attr.prop, label: attr.head}); this.translate.get(attr.head).subscribe((translated) => {
this.graphData.push({key: attr.prop, label: translated});
});
} }
this.initDataArray(); this.initDataArray();

View File

@ -2,14 +2,14 @@
<div class="input-group search-field"> <div class="input-group search-field">
<input id="search-tasks" <input id="search-tasks"
markForCheck markForCheck
placeholder="Spielername (mehrere mit '&' trennen)" placeholder="{{'stats.highscore.filter.placholder' | translate}}"
type="text" #query class="form-control" type="text" #query class="form-control"
(keyup.enter)="filterPlayers()" (keyup.enter)="filterPlayers()"
[formControl]="searchTerm"> [formControl]="searchTerm">
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-default" type="button" <button class="btn btn-default" type="button"
(click)="filterPlayers()"> (click)="filterPlayers()">
Filter {{'stats.highscore.filter.button' | translate}}
</button> </button>
</span> </span>
</div> </div>
@ -26,7 +26,7 @@
</ng-container> </ng-container>
<ng-container matColumnDef="name"> <ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>Name</th> <th mat-header-cell *matHeaderCellDef>{{'stats.highscore.header.name' | translate}}</th>
<td mat-cell *matCellDef="let element" <td mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
@ -36,7 +36,7 @@
<ng-container matColumnDef="{{attributeMap.prop}}"> <ng-container matColumnDef="{{attributeMap.prop}}">
<th mat-header-cell *matHeaderCellDef> <th mat-header-cell *matHeaderCellDef>
<mat-icon svgIcon="{{attributeMap.prop}}" <mat-icon svgIcon="{{attributeMap.prop}}"
matTooltip="{{attributeMap.head}}"> matTooltip="{{attributeMap.head | translate}}">
</mat-icon> </mat-icon>
</th> </th>
<td mat-cell *matCellDef="let element"> {{element[attributeMap.prop]}}</td> <td mat-cell *matCellDef="let element"> {{element[attributeMap.prop]}}</td>

View File

@ -7,7 +7,7 @@
class="mat-elevation-z8"> class="mat-elevation-z8">
<ng-container matColumnDef="{{tableHead[0].prop}}"> <ng-container matColumnDef="{{tableHead[0].prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head}}</th> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</th>
<td mat-cell *matCellDef="let element" <td mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
@ -15,14 +15,14 @@
</ng-container> </ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head}}</th> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</th>
<td mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</td> <td mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</td>
</ng-container> </ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">
<th mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}"> <th mat-header-cell *matHeaderCellDef mat-sort-header="{{column.prop}}">
<mat-icon svgIcon="{{column.prop}}" <mat-icon svgIcon="{{column.prop}}"
matTooltip="{{column.head}}"> matTooltip="{{column.head | translate}}">
</mat-icon> </mat-icon>
</th> </th>
<td mat-cell *matCellDef="let element">{{element[column.prop]}}</td> <td mat-cell *matCellDef="let element">{{element[column.prop]}}</td>
@ -32,7 +32,7 @@
<th mat-header-cell *matHeaderCellDef></th> <th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<button mat-icon-button <button mat-icon-button
matTooltip="Kampagnenstatistik für {{element.name}}" matTooltip="{{ 'stats.scoreboard.button.detail' | translate:{name: element.name} }}"
(click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ? (click)="selectPlayerDetail(1, isSteamUUID(element['steamUUID']) ?
element['steamUUID'] : element['name'])"> element['steamUUID'] : element['name'])">
<mat-icon svgIcon="stats-detail"> <mat-icon svgIcon="stats-detail">

View File

@ -37,13 +37,6 @@ export class ScoreboardComponent implements OnChanges {
displayedColumns = this.tableHead.map(head => head.prop); displayedColumns = this.tableHead.map(head => head.prop);
reorderable = false;
customClasses = {
sortAscending: 'glyphicon glyphicon-triangle-top',
sortDescending: 'glyphicon glyphicon-triangle-bottom',
};
constructor(private elRef: ElementRef) { constructor(private elRef: ElementRef) {
this.displayedColumns.push('interact'); this.displayedColumns.push('interact');
} }

View File

@ -1,18 +1,18 @@
<form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview"> <form #form="ngForm" (keydown.enter)="$event.preventDefault()" class="overview">
<h3>Schlacht bearbeiten</h3> <h3>{{'stats.war.submit.headline' | translate}}</h3>
<div class="form-group"> <div class="form-group">
<label for="title">Titel</label> <label for="title">{{'stats.war.submit.title' | translate}}</label>
<input type="text" class="form-control" <input type="text" class="form-control"
[(ngModel)]="war.title" [(ngModel)]="war.title"
name="title" name="title"
id="title" id="title"
required maxlength="50"/> required maxlength="50"/>
<show-error displayName="Name" controlPath="title"></show-error> <show-error displayName="{{'stats.war.submit.title' | translate}}" controlPath="title"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="campaign">Kampagne</label> <label for="campaign">{{'stats.war.submit.campaign' | translate}}</label>
<select class="form-control" <select class="form-control"
name="campaign" name="campaign"
id="campaign" id="campaign"
@ -25,43 +25,47 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="ptBlufor">Punkte NATO</label> <label for="ptBlufor">{{'stats.war.submit.points' | translate}} {{fraction.BLUFOR}}</label>
<input type="number" class="form-control" <input type="number" class="form-control"
[(ngModel)]="war.ptBlufor" [(ngModel)]="war.ptBlufor"
name="ptBlufor" name="ptBlufor"
id="ptBlufor" id="ptBlufor"
required min="0"/> required min="0"/>
<show-error displayName="Name" controlPath="ptBlufor"></show-error> <show-error displayName="{{'stats.war.submit.points' | translate}} {{fraction.BLUFOR}}"
controlPath="ptBlufor"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="ptOpfor">Punkte CSAT</label> <label for="ptOpfor">{{'stats.war.submit.points' | translate}} {{fraction.OPFOR}}</label>
<input type="number" class="form-control" <input type="number" class="form-control"
[(ngModel)]="war.ptOpfor" [(ngModel)]="war.ptOpfor"
name="ptOpfor" name="ptOpfor"
id="ptOpfor" id="ptOpfor"
required min="0"/> required min="0"/>
<show-error displayName="Name" controlPath="ptOpfor"></show-error> <show-error displayName="{{'stats.war.submit.points' | translate}} {{fraction.OPFOR}}"
controlPath="ptOpfor"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="endBudgetBlufor">Endbudget NATO</label> <label for="endBudgetBlufor">{{'stats.war.submit.final.budget' | translate}} {{fraction.BLUFOR}}</label>
<input type="number" class="form-control" <input type="number" class="form-control"
[(ngModel)]="war.endBudgetBlufor" [(ngModel)]="war.endBudgetBlufor"
name="endBudgetBlufor" name="endBudgetBlufor"
id="endBudgetBlufor" id="endBudgetBlufor"
required/> required/>
<show-error displayName="Name" controlPath="endBudgetBlufor"></show-error> <show-error displayName="{{'stats.war.submit.final.budget' | translate}} {{fraction.BLUFOR}}"
controlPath="endBudgetBlufor"></show-error>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="endBudgetOpfor">Endbudget CSAT</label> <label for="endBudgetOpfor">{{'stats.war.submit.final.budget' | translate}} {{fraction.OPFOR}}</label>
<input type="number" class="form-control" <input type="number" class="form-control"
[(ngModel)]="war.endBudgetOpfor" [(ngModel)]="war.endBudgetOpfor"
name="endBudgetOpfor" name="endBudgetOpfor"
id="endBudgetOpfor" id="endBudgetOpfor"
required/> required/>
<show-error displayName="Name" controlPath="endBudgetOpfor"></show-error> <show-error displayName="{{'stats.war.submit.final.budget' | translate}} {{fraction.OPFOR}}"
controlPath="endBudgetOpfor"></show-error>
</div> </div>
<button id="cancel" <button id="cancel"

View File

@ -7,6 +7,7 @@ import {CampaignService} from '../../../services/logs/campaign.service';
import {Subscription} from 'rxjs/Subscription'; import {Subscription} from 'rxjs/Subscription';
import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service'; import {SnackBarService} from '../../../services/user-interface/snack-bar/snack-bar.service';
import {Message} from '../../../i18n/de.messages'; import {Message} from '../../../i18n/de.messages';
import {Fraction} from '../../../utils/fraction.enum';
@Component({ @Component({
@ -20,6 +21,8 @@ export class WarEditComponent {
subscription: Subscription; subscription: Subscription;
readonly fraction = Fraction;
@ViewChild(NgForm) form: NgForm; @ViewChild(NgForm) form: NgForm;
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,

View File

@ -1,14 +1,14 @@
<div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html"> <div *ngIf="war" class="war-header fade-in" xmlns="http://www.w3.org/1999/html">
<div class="war-header-container"> <div class="war-header-container">
<div class="pull-left head-field" style="width: 250px"> <div class="pull-left head-field" style="width: 250px">
<h4>Endpunktestand:</h4> <h4>{{'stats.scoreboard.standings' | translate}}</h4>
<span [style.color]="fraction.COLOR_BLUFOR" style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span> <span [style.color]="fraction.COLOR_BLUFOR" style="font-weight: bold; margin-right: 10px">{{fraction.BLUFOR}} {{war.ptBlufor}}</span>
<span style="font-size: x-large">|</span> <span style="font-size: x-large">|</span>
<span [style.color]="fraction.COLOR_OPFOR" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} {{fraction.OPFOR}}</span> <span [style.color]="fraction.COLOR_OPFOR" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} {{fraction.OPFOR}}</span>
</div> </div>
<div class="pull-left head-field " style="padding-left: 100px;"> <div class="pull-left head-field " style="padding-left: 100px;">
<h4 class="pull-left" style="margin-bottom: 0;">Teilnehmer:</h4> <h4 class="pull-left" style="margin-bottom: 0;">{{'stats.scoreboard.participants' | translate}}</h4>
<ngx-charts-pie-chart <ngx-charts-pie-chart
class="pull-left" class="pull-left"
[view]="[120, 120]" [view]="[120, 120]"
@ -24,20 +24,26 @@
<div class="pull-left " style="padding-left: 100px; padding-top:15px"> <div class="pull-left " style="padding-left: 100px; padding-top:15px">
<a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log"> <a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log">
Logfile anzeigen {{'stats.scoreboard.show.logs' | translate}}
</a> </a>
</div> </div>
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item" [ngClass]="{active :tab === 0}" (click)="switchTab(0)"> <li class="nav-item" [ngClass]="{active :tab === 0}" (click)="switchTab(0)">
<a class="nav-link"><img src="../../../assets/scoreboard-btn.png"> Scoreboard</a> <a class="nav-link"><img src="../../../assets/scoreboard-btn.png">
{{'stats.scoreboard.tab.scoreboard' | translate}}
</a>
</li> </li>
<li class="nav-item" [ngClass]="{active :tab === 1}" (click)="switchTab(1)"> <li class="nav-item" [ngClass]="{active :tab === 1}" (click)="switchTab(1)">
<a class="nav-link"><img src="../../../assets/fraction-btn.png"> Fraktionen</a> <a class="nav-link"><img src="../../../assets/fraction-btn.png">
{{'stats.scoreboard.tab.fractions' | translate}}
</a>
</li> </li>
<li class="nav-item" [ngClass]="{active :tab === 2, deactivated :tab !== 2} "> <li class="nav-item" [ngClass]="{active :tab === 2, deactivated :tab !== 2} ">
<a class="nav-link"><img src="../../../assets/player-stats-btn.png"> Player</a> <a class="nav-link"><img src="../../../assets/player-stats-btn.png">
{{'stats.scoreboard.tab.player' | translate}}
</a>
</li> </li>
<li> <li>
<div *ngIf="tab === 0"> <div *ngIf="tab === 0">
@ -46,23 +52,26 @@
<input type="radio" name="fractSelect" <input type="radio" name="fractSelect"
[checked]="(fractionFilterSelected == undefined) ? 'true' : 'false'" [checked]="(fractionFilterSelected == undefined) ? 'true' : 'false'"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
(change)="filterPlayersByFraction()">Alle (change)="filterPlayersByFraction()">
{{'stats.scoreboard.fraction.filter.all' | translate}}
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="fractSelect" value="BLUFOR" <input type="radio" name="fractSelect" value="BLUFOR"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
#fractRadioBufor #fractRadioBufor
(change)="filterPlayersByFraction(fractRadioBufor.value)">{{fraction.BLUFOR}} (change)="filterPlayersByFraction(fractRadioBufor.value)">
{{fraction.BLUFOR}}
</label> </label>
<label class="radio-inline"> <label class="radio-inline">
<input type="radio" name="fractSelect" value="OPFOR" <input type="radio" name="fractSelect" value="OPFOR"
[(ngModel)]="fractionFilterSelected" [(ngModel)]="fractionFilterSelected"
#fractRadioOpfor #fractRadioOpfor
(change)="filterPlayersByFraction(fractRadioOpfor.value)">{{fraction.OPFOR}} (change)="filterPlayersByFraction(fractRadioOpfor.value)">
{{fraction.OPFOR}}
</label> </label>
</form> </form>
<span class="btn btn-default pull-left tab-control" (click)="scoreBoardComponent.exportCSV()"> <span class="btn btn-default pull-left tab-control" (click)="scoreBoardComponent.exportCSV()">
Download CSV {{'stats.scoreboard.download.csv' | translate}}
</span> </span>
</div> </div>
</li> </li>

View File

@ -1,17 +1,17 @@
export class PlayerUtils { export class PlayerUtils {
public static readonly attributeDisplayNames = [ public static readonly attributeDisplayNames = [
{prop: 'name', head: 'Spieler'}, {prop: 'name', head: 'stats.scoreboard.header.player'},
{prop: 'fraction', head: 'Fraktion'}, {prop: 'fraction', head: 'stats.scoreboard.header.fraction'},
{prop: 'kill', head: 'Abschüsse'}, {prop: 'kill', head: 'stats.scoreboard.header.kill'},
{prop: 'friendlyFire', head: 'Friendly Fire'}, {prop: 'friendlyFire', head: 'stats.scoreboard.header.friendly.fire'},
{prop: 'revive', head: 'Revive'}, {prop: 'revive', head: 'stats.scoreboard.header.revive'},
{prop: 'flagTouch', head: 'Eroberungen'}, {prop: 'flagTouch', head: 'stats.scoreboard.header.capture'},
{prop: 'vehicleLight', head: 'Fahrzeug (leicht)'}, {prop: 'vehicleLight', head: 'stats.scoreboard.header.vehicle.light'},
{prop: 'vehicleHeavy', head: 'Fahrzeug (schwer)'}, {prop: 'vehicleHeavy', head: 'stats.scoreboard.header.vehicle.heavy'},
{prop: 'vehicleAir', head: 'Fahrzeug (Luft)'}, {prop: 'vehicleAir', head: 'stats.scoreboard.header.vehicle.air'},
{prop: 'death', head: 'Tode'}, {prop: 'death', head: 'stats.scoreboard.header.death'},
{prop: 'respawn', head: 'Respawn'} {prop: 'respawn', head: 'stats.scoreboard.header.respawn'}
]; ];
public static isSteamUUID(input: string): boolean { public static isSteamUUID(input: string): boolean {

View File

@ -34,8 +34,8 @@
"stats.player.detail.respawn.death.ratio": "Respawn/Death", "stats.player.detail.respawn.death.ratio": "Respawn/Death",
"stats.player.detail.graph.average": "Durchschnitt", "stats.player.detail.graph.average": "Durchschnitt",
"stats.scoreboard.standings": "Endpunktestand", "stats.scoreboard.standings": "Endpunktestand:",
"stats.scoreboard.participants": "Teilnehmer", "stats.scoreboard.participants": "Teilnehmer:",
"stats.scoreboard.show.logs": "Logfile anzeigen", "stats.scoreboard.show.logs": "Logfile anzeigen",
"stats.scoreboard.download.csv": "Download CSV", "stats.scoreboard.download.csv": "Download CSV",
"stats.scoreboard.tab.scoreboard": "Scoreboard", "stats.scoreboard.tab.scoreboard": "Scoreboard",
@ -53,5 +53,17 @@
"stats.scoreboard.header.vehicle.air": "Fahrzeug (Luft)", "stats.scoreboard.header.vehicle.air": "Fahrzeug (Luft)",
"stats.scoreboard.header.death": "Tode", "stats.scoreboard.header.death": "Tode",
"stats.scoreboard.header.respawn": "Respawn", "stats.scoreboard.header.respawn": "Respawn",
"stats.scoreboard.button.detail": "Kampagnenstatistik für {{name}}" "stats.scoreboard.button.detail": "Kampagnenstatistik für {{name}}",
"stats.highscore.filter.placholder": "Spielername (mehrere mit '&' trennen)",
"stats.highscore.filter.button": "Filter",
"stats.highscore.header.name": "Name",
"stats.war.submit.headline": "Schlacht bearbeiten",
"stats.war.submit.title": "Titel",
"stats.war.submit.campaign": "Kampagne",
"stats.war.submit.points": "Punkte",
"stats.war.submit.final.budget": "Endbudget",
"stats.war.submit.button.submit": "Bestätigen",
"stats.war.submit.button.cancel": "Abbrechen"
} }