Skip to content
Snippets Groups Projects
Commit 39963761 authored by Lukas Mauß's avatar Lukas Mauß Committed by Tom Käsler
Browse files

Fix some i18n

parent 978901be
No related merge requests found
......@@ -5,7 +5,7 @@
placeholder="{{ 'session.session-name' | translate}}" maxlength="50" [(ngModel)]="longName" name="roomName"/>
<mat-hint align="start" *ngIf="!emptyInputs"><strong>{{ 'session.max-ls' | translate}}</strong></mat-hint>
<mat-hint align="end" *ngIf="!emptyInputs">{{longRoomName.value.length}} / 50</mat-hint>
<mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint>
<mat-hint align="start" *ngIf="emptyInputs"><strong>{{ 'home-page.no-empty-name' | translate }}</strong></mat-hint>
<button mat-button *ngIf="longName" matSuffix mat-icon-button aria-label="Clear" (click)="longName=''">
<mat-icon>close</mat-icon>
</button>
......@@ -15,7 +15,6 @@
placeholder="{{ 'session.description' | translate}}" maxlength="255" name="description"></textarea>
<mat-hint align="start" *ngIf="!emptyInputs"><strong>{{ 'session.max-ls' | translate}}</strong></mat-hint>
<mat-hint align="end" *ngIf="!emptyInputs">{{description.value.length}} / 255</mat-hint>
<mat-hint align="start" *ngIf="emptyInputs"><strong>Input is required</strong></mat-hint>
<button mat-button *ngIf="shortName" matSuffix mat-icon-button aria-label="Clear" (click)="shortName=''">
<mat-icon>close</mat-icon>
</button>
......
......@@ -11,6 +11,7 @@ import { ContentDeleteComponent } from '../../dialogs/content-delete/content-del
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { map, startWith } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
export class DisplayAnswer {
answerOption: AnswerOption;
......@@ -68,6 +69,7 @@ export class ContentChoiceCreatorComponent implements OnInit {
private notificationService: NotificationService,
public dialog: MatDialog,
public dialogRef: MatDialogRef<ContentListComponent>,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
......@@ -240,12 +242,16 @@ export class ContentChoiceCreatorComponent implements OnInit {
this.content.options = [];
this.content.correctOptionIndexes = [];
this.fillCorrectAnswers();
this.notificationService.show('Content submitted. Ready for creation of new content.');
this.translationService.get('content.submitted').subscribe(message => {
this.notificationService.show(message);
});
}
submitContent(subject: string, body: string, group: string) {
if (this.content.body.valueOf() === '' || this.content.body.valueOf() === '') {
this.notificationService.show('No empty fields allowed. Please check subject and body.');
this.translationService.get('content.no-empty').subscribe(message => {
this.notificationService.show(message);
});
return;
}
if (this.content.options.length === 0) {
......
......@@ -11,6 +11,7 @@ import { ContentDeleteComponent } from '../../dialogs/content-delete/content-del
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { map, startWith } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-content-likert-creator',
......@@ -56,6 +57,7 @@ export class ContentLikertCreatorComponent implements OnInit {
private notificationService: NotificationService,
public dialog: MatDialog,
public dialogRef: MatDialogRef<ContentListComponent>,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
......@@ -91,15 +93,18 @@ export class ContentLikertCreatorComponent implements OnInit {
this.content.body = '';
this.content.correctOptionIndexes = [];
this.fillCorrectAnswers();
this.notificationService.show('Content submitted. Ready for creation of new content.');
this.translationService.get('content.submitted').subscribe(message => {
this.notificationService.show(message);
});
}
submitContent(subject: string, body: string, group: string): void {
if (subject.valueOf() === '' || body.valueOf() === '') {
this.notificationService.show('No empty fields allowed. Please check subject and body.');
this.translationService.get('content.no-empty').subscribe(message => {
this.notificationService.show(message);
});
return;
}
this.notificationService.show('Content sumbitted.');
this.contentService.addContent(new ContentChoice(
'',
'',
......
<div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="20px" fxFill>
<div fxLayout="row" fxLayoutAlign="center">
<mat-card>
<mat-list>
<mat-list-item *ngFor="let content of contents" (click)="editContent(content.subject)">
<h3 mat-line>{{content.subject}}</h3>
<p mat-line>
<span>{{content.body}}</span>
</p>
<mat-divider></mat-divider>
</mat-list-item>
</mat-list>
</mat-card>
</div>
</div>
......@@ -8,6 +8,7 @@ import { ContentDeleteComponent } from '../../dialogs/content-delete/content-del
import { map, startWith } from 'rxjs/operators';
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-content-text-creator',
......@@ -37,6 +38,7 @@ export class ContentTextCreatorComponent implements OnInit {
private notificationService: NotificationService,
public dialog: MatDialog,
public dialogRef: MatDialogRef<ContentListComponent>,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
......@@ -58,7 +60,9 @@ export class ContentTextCreatorComponent implements OnInit {
resetAfterSubmit() {
this.content.subject = '';
this.content.body = '';
this.notificationService.show('Frage erstellt.');
this.translationService.get('content.submitted').subscribe(message => {
this.notificationService.show(message);
});
}
submitContent(subject: string, body: string, group: string) {
......@@ -72,7 +76,9 @@ export class ContentTextCreatorComponent implements OnInit {
[group],
)).subscribe();
if (this.content.body.valueOf() === '' || this.content.body.valueOf() === '') {
this.notificationService.show('Keine leeren Felder erlaubt. Bitte kontrollieren sie Thema und Inhalt.');
this.translationService.get('content.no-empty').subscribe(message => {
this.notificationService.show(message);
});
return;
}
sessionStorage.setItem('collection', group);
......
......@@ -7,10 +7,10 @@
</mat-form-field>
<mat-radio-group [(ngModel)]="yesno" [ngModelOptions]="{standalone: true}" fxLayout="row" fxLayoutAlign="center" fxLayoutGap="20px">
<mat-radio-button [value]=true [checked]=true>
Ja
{{ 'content.yes' | translate }}
</mat-radio-button>
<mat-radio-button [value]=false [checked]=false>
Nein
{{ 'content.no' | translate }}
</mat-radio-button>
</mat-radio-group>
<mat-form-field>
......
......@@ -11,6 +11,7 @@ import { ContentDeleteComponent } from '../../dialogs/content-delete/content-del
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs/Observable';
import { map, startWith } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-content-yes-no-creator',
......@@ -20,8 +21,8 @@ import { map, startWith } from 'rxjs/operators';
export class ContentYesNoCreatorComponent implements OnInit {
yesno = true;
answerLabels = [
'Ja',
'Nein'
'yes',
'no'
];
content: ContentChoice = new ContentChoice(
'0',
......@@ -52,6 +53,7 @@ export class ContentYesNoCreatorComponent implements OnInit {
private notificationService: NotificationService,
public dialog: MatDialog,
public dialogRef: MatDialogRef<ContentListComponent>,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
......@@ -86,15 +88,18 @@ export class ContentYesNoCreatorComponent implements OnInit {
this.content.body = '';
this.content.correctOptionIndexes = [];
this.fillCorrectAnswers();
this.notificationService.show('Content submitted. Ready for creation of new content.');
this.translationService.get('content.submitted').subscribe(message => {
this.notificationService.show(message);
});
}
submitContent(subject: string, body: string, group: string): void {
if (subject.valueOf() === '' || body.valueOf() === '') {
this.notificationService.show('No empty fields allowed. Please check subject and body.');
this.translationService.get('content.no-empty').subscribe(message => {
this.notificationService.show(message);
});
return;
}
this.notificationService.show('Content sumbitted.');
if (this.yesno) {
this.content.correctOptionIndexes = [0];
} else {
......
......@@ -50,6 +50,7 @@
},
"home-page": {
"create-session": "Neue Session erstellen",
"no-empty-name": "Bitte geben Sie einen Namen ein.",
"join-demo-session": "Demo-Session betreten",
"session-id": "Session-Id",
"no-room-found": "Es wurde keine Session mit dieser ID gefunden.",
......@@ -91,7 +92,9 @@
"actions": "Richtig / Falsch",
"reset": "Zurücksetzen",
"contents": "Fragen",
"click-here": "Klicken Sie auf einen Inhalt, um diesen zu editieren"
"click-here": "Klicken Sie auf einen Inhalt, um diesen zu editieren",
"submitted": "Frage erstellt. Bereit für die Erstellung neuer Fragen.",
"no-empty": "Keine leeren Felder erlaubt. Bitte überprüfen sie Thema und Inhalt."
},
"session": {
"session-name": "Name der Session",
......
......@@ -49,6 +49,7 @@
},
"home-page": {
"create-session": "Create new session ",
"no-empty-name": "Please enter a name.",
"join-demo-session": "Join demo-session",
"session-id": "Session-Id",
"no-room-found": "No session was found with id:",
......@@ -89,7 +90,9 @@
"actions": "Actions",
"reset": "Reset",
"contents": "Contents",
"click-here": "Click on a content to edit it"
"click-here": "Click on a content to edit it",
"submitted": "Content submitted. Ready for creation of new content.",
"no-empty": "No empty fields allowed. Please check subject and body."
},
"session": {
"session-name": "Session name",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment