-
+
- Bild muss im PNG Format vorliegen
+ {{'decorations.submit.field.image.error.type' | translate}}

@@ -66,7 +66,7 @@
diff --git a/static/src/app/decorations/edit-decoration/edit-decoration.component.ts b/static/src/app/decorations/edit-decoration/edit-decoration.component.ts
index 11df1c1..c183653 100644
--- a/static/src/app/decorations/edit-decoration/edit-decoration.component.ts
+++ b/static/src/app/decorations/edit-decoration/edit-decoration.component.ts
@@ -7,6 +7,7 @@ import {Subscription} from 'rxjs/Subscription';
import {Fraction} from '../../utils/fraction.enum';
import {SnackBarService} from '../../services/user-interface/snack-bar/snack-bar.service';
import {Message} from '../../i18n/de.messages';
+import {TranslateService} from '@ngx-translate/core';
@Component({
templateUrl: './edit-decoration.component.html',
@@ -31,7 +32,8 @@ export class EditDecorationComponent implements OnInit, OnDestroy {
constructor(private route: ActivatedRoute,
private router: Router,
private decorationService: DecorationService,
- private snackBarService: SnackBarService) {
+ private snackBarService: SnackBarService,
+ private translate: TranslateService) {
}
ngOnInit() {
@@ -69,7 +71,12 @@ export class EditDecorationComponent implements OnInit, OnDestroy {
this.router.navigate(['..'], {relativeTo: this.route});
});
} else {
- return window.alert(`Bild ist ein Pflichtfeld`);
+ this.translate.get('decorations.submit.field.image').subscribe((fieldNameLogo) => {
+ this.translate.get('public.error.message.required',
+ {fieldName: fieldNameLogo}).subscribe((message) => {
+ this.snackBarService.showError(message, 4000);
+ })
+ });
}
} else {
if (this.fileList) {
diff --git a/static/src/app/ranks/rank-list/rank-list.component.ts b/static/src/app/ranks/rank-list/rank-list.component.ts
index cdd94e0..52ef347 100644
--- a/static/src/app/ranks/rank-list/rank-list.component.ts
+++ b/static/src/app/ranks/rank-list/rank-list.component.ts
@@ -8,6 +8,7 @@ import {RankService} from '../../services/army-management/rank.service';
import {Fraction} from '../../utils/fraction.enum';
import {UIHelpers} from '../../utils/global.helpers';
import {MatButtonToggleGroup} from '@angular/material';
+import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-rank-list',
@@ -28,7 +29,8 @@ export class RankListComponent implements OnInit {
constructor(private rankService: RankService,
private router: Router,
- private route: ActivatedRoute) {
+ private route: ActivatedRoute,
+ private translate: TranslateService) {
}
ngOnInit() {
@@ -60,10 +62,15 @@ export class RankListComponent implements OnInit {
deleteRank(rank) {
const fraction = rank.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR;
- if (confirm('Soll der Rang ' + rank.name + ' (' + fraction + ') wirklich gelöscht werden?')) {
- this.rankService.deleteRank(rank)
- .subscribe((res) => {
- });
- }
+ this.translate.get('ranks.list.delete.confirm', {
+ name: rank.name,
+ fraction: fraction
+ }).subscribe((confirmQuestion) => {
+ if (confirm(confirmQuestion)) {
+ this.rankService.deleteRank(rank)
+ .subscribe((res) => {
+ });
+ }
+ });
}
}
diff --git a/static/src/app/squads/squad-list/squad-list.component.ts b/static/src/app/squads/squad-list/squad-list.component.ts
index c52d9ea..a6e0edb 100644
--- a/static/src/app/squads/squad-list/squad-list.component.ts
+++ b/static/src/app/squads/squad-list/squad-list.component.ts
@@ -8,6 +8,7 @@ import {SquadService} from '../../services/army-management/squad.service';
import {Fraction} from '../../utils/fraction.enum';
import {UIHelpers} from '../../utils/global.helpers';
import {MatButtonToggleGroup} from '@angular/material';
+import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-squad-list',
@@ -28,7 +29,8 @@ export class SquadListComponent implements OnInit {
constructor(private squadService: SquadService,
private router: Router,
- private route: ActivatedRoute) {
+ private route: ActivatedRoute,
+ private translate: TranslateService) {
}
ngOnInit() {
@@ -54,11 +56,16 @@ export class SquadListComponent implements OnInit {
deleteSquad(squad) {
const fraction = squad.fraction === 'OPFOR' ? Fraction.OPFOR : Fraction.BLUFOR;
- if (confirm('Soll das Squad "' + squad.name + '" (' + fraction + ') wirklich gelöscht werden?')) {
- this.squadService.deleteSquad(squad)
- .subscribe((res) => {
- });
- }
+ this.translate.get('squad.list.delete.confirm', {
+ name: squad.name,
+ fraction: fraction
+ }).subscribe((confirmQuestion) => {
+ if (confirm(confirmQuestion)) {
+ this.squadService.deleteSquad(squad)
+ .subscribe((res) => {
+ });
+ }
+ });
}
filterSquads(group?: MatButtonToggleGroup) {
diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
index 3df42b0..c5b2f96 100644
--- a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
+++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts
@@ -5,6 +5,7 @@ import {PlayerUtils} from '../../../utils/player-utils';
import {saveAs} from 'file-saver/FileSaver';
import {MatSort} from '@angular/material';
import {SortUtils} from '../../../utils/sort-utils';
+import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-scoreboard',
@@ -37,7 +38,8 @@ export class ScoreboardComponent implements OnChanges {
displayedColumns = this.tableHead.map(head => head.prop);
- constructor(private elRef: ElementRef) {
+ constructor(private elRef: ElementRef,
+ private translate: TranslateService) {
this.displayedColumns.push('interact');
}
@@ -93,12 +95,13 @@ export class ScoreboardComponent implements OnChanges {
exportCSV() {
let csvOut = '';
for (let i = 0; i < this.tableHead.length; i++) {
- csvOut += this.tableHead[i].head;
- if (i !== this.tableHead.length - 1) {
- csvOut += ',';
- }
+ this.translate.get(this.tableHead[i].head).subscribe((translated) => {
+ csvOut += translated;
+ if (i !== this.tableHead.length - 1) {
+ csvOut += ',';
+ }
+ });
}
-
for (let j = 0; j < this.war.players.length; j++) {
const player = this.war.players[j];
csvOut += '\r\n';
diff --git a/static/src/app/users/user-list/user-list.component.ts b/static/src/app/users/user-list/user-list.component.ts
index 31a7495..9d32075 100644
--- a/static/src/app/users/user-list/user-list.component.ts
+++ b/static/src/app/users/user-list/user-list.component.ts
@@ -9,6 +9,7 @@ import {ADD, LOAD} from '../../services/stores/user.store';
import {Fraction} from '../../utils/fraction.enum';
import {MatButtonToggleGroup} from '@angular/material';
import {UIHelpers} from '../../utils/global.helpers';
+import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'cc-user-list',
@@ -37,7 +38,8 @@ export class UserListComponent implements OnInit {
constructor(private userService: UserService,
private router: Router,
- private route: ActivatedRoute) {
+ private route: ActivatedRoute,
+ private translate: TranslateService) {
}
ngOnInit() {
@@ -67,11 +69,13 @@ export class UserListComponent implements OnInit {
}
deleteUser(user: User) {
- if (confirm('Soll der Teilnehmer "' + user.username + '" wirklich gelöscht werden?')) {
- this.userService.deleteUser(user)
- .subscribe((res) => {
- });
- }
+ this.translate.get('squad.list.delete.confirm', {name: user.username}).subscribe((confirmQuestion) => {
+ if (confirm(confirmQuestion)) {
+ this.userService.deleteUser(user)
+ .subscribe((res) => {
+ });
+ }
+ });
}
filterUsers(action?, group?: MatButtonToggleGroup) {
diff --git a/static/src/assets/i18n/app/de.json b/static/src/assets/i18n/app/de.json
index 611c456..dac767e 100644
--- a/static/src/assets/i18n/app/de.json
+++ b/static/src/assets/i18n/app/de.json
@@ -42,5 +42,12 @@
"public.army.headline": "Übersicht über alle Spieler, Squads und Armeen",
"public army.squad.members": "Mitglieder:",
- "public.army.members": "Armeemitglieder:"
+ "public.army.members": "Armeemitglieder:",
+
+ "public.army.member.button.back": "Zurück",
+ "public.army.member.button.copy": "kopieren",
+ "public.army.member.headline": "Auszeichnungen von {{name}}",
+ "public.army.member.awards.title": "Bezeichnung",
+ "public.army.member.awards.reason": "Begründung",
+ "public.army.member.awards.date": "Verliehen am"
}
diff --git a/static/src/assets/i18n/decorations/de.json b/static/src/assets/i18n/decorations/de.json
new file mode 100644
index 0000000..675b0d1
--- /dev/null
+++ b/static/src/assets/i18n/decorations/de.json
@@ -0,0 +1,31 @@
+{
+ "public.error.message.required": "{{fieldName}} ist ein Pflichtfeld",
+ "public.error.message.min.length": "{{fieldName}} muss mindestens {{boundary}} Zeichen enthalten",
+ "public.error.message.max.length": "{{fieldName}} darf maximal {{boundary}} Zeichen enthalten",
+ "public.error.message.email": "Bitte geben Sie eine gültige E-Mail Adresse an",
+ "public.error.message.no.user": "Der eingetragene Benutzer existiert nicht.",
+ "public.error.message.default": "{{fieldName}} ist nicht valide",
+ "public.common.search.button": "Suchen",
+
+ "decorations.list.button.add": "Neue Auszeichnung hinzufügen",
+ "decorations.list.button.delete": "Löschen",
+ "decorations.list.filter.global": "Global",
+ "decorations.list.delete.confirm": "Soll die Auszeichnung '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
+
+ "decorations.item.label.sort": " - Sortierung {{value}}",
+
+ "decorations.submit.headline.edit": "Auszeichnung bearbeiten",
+ "decorations.submit.headline.new": "Neue Auszeichnung hinzufügen",
+ "decorations.submit.field.name": "Name",
+ "decorations.submit.field.fraction": "Fraktion",
+ "decorations.submit.field.fraction.global": "Global",
+ "decorations.submit.field.type": "Art",
+ "decorations.submit.field.type.ribbon": "Ordensband",
+ "decorations.submit.field.type.medal": "Orden",
+ "decorations.submit.field.sort": "Sortierung",
+ "decorations.submit.field.description": "Beschreibung",
+ "decorations.submit.field.image": "Bild",
+ "decorations.submit.field.image.error.type": "Bild muss im PNG Format vorliegen",
+ "decorations.submit,button.submit": "Bestätigen",
+ "decorations.submit,button.cancel": "Abbrechen"
+}
diff --git a/static/src/assets/i18n/decorations/en.json b/static/src/assets/i18n/decorations/en.json
new file mode 100644
index 0000000..0db3279
--- /dev/null
+++ b/static/src/assets/i18n/decorations/en.json
@@ -0,0 +1,3 @@
+{
+
+}
diff --git a/static/src/assets/i18n/ranks/de.json b/static/src/assets/i18n/ranks/de.json
index 38db0a0..75c1570 100644
--- a/static/src/assets/i18n/ranks/de.json
+++ b/static/src/assets/i18n/ranks/de.json
@@ -9,6 +9,7 @@
"ranks.list.button.add": "Neuen Rank hinzufügen",
"ranks.list.button.delete": "Löschen",
+ "ranks.list.delete.confirm": "Soll der Rang '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
"ranks.list.item.label.level": " - Stufe {{level}}",
"ranks.submit.headline.new": "Neuen Rang hinzufügen",
diff --git a/static/src/assets/i18n/squads/de.json b/static/src/assets/i18n/squads/de.json
index 37d4f51..556f99a 100644
--- a/static/src/assets/i18n/squads/de.json
+++ b/static/src/assets/i18n/squads/de.json
@@ -8,6 +8,7 @@
"public.common.search.button": "Suchen",
"squad.list.tooltip.delete": "Löschen",
+ "squad.list.delete.confirm": "Soll das Squad '{{name}}' ({{fraction}}) wirklich gelöscht werden?",
"squad.list.tooltip.new": "Neues Squad hinzufügen",
"squad.submit.new.headline": "Neues Squad hinzufügen",
"squad.submit.edit.headline": "Squad bearbeiten",
diff --git a/static/src/assets/i18n/users/de.json b/static/src/assets/i18n/users/de.json
index 67489a8..84b389d 100644
--- a/static/src/assets/i18n/users/de.json
+++ b/static/src/assets/i18n/users/de.json
@@ -12,6 +12,7 @@
"users.list.tooltip.awards": "Auszeichnungen",
"users.list.filter.no.squad": "Ohne Squad",
"users.list.item.label.no.squad": "ohne Squad/Fraktion",
+ "ranks.list.delete.confirm": "Soll der Teilnehmer '{{name}}' wirklich gelöscht werden?",
"users.award.headline": "Teilnehmer auszeichnen",
"users.award.field.decoration": "Auszeichnung",