diff --git a/src/app/components/dialogs/room-create/room-create.component.html b/src/app/components/dialogs/room-create/room-create.component.html index 0e1e29b7693f574f1f1688f6e59bc6a3c27fcaa6..7cadc1b0e3a6ca800456c2b54e0b74ae3d3b65d7 100644 --- a/src/app/components/dialogs/room-create/room-create.component.html +++ b/src/app/components/dialogs/room-create/room-create.component.html @@ -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> diff --git a/src/app/components/fragments/content-choice-creator/content-choice-creator.component.ts b/src/app/components/fragments/content-choice-creator/content-choice-creator.component.ts index 53fd0353f7885d3c8738bcd012b678e593c7b810..f59e731ace08637420ccab8fc0e433eabff324b1 100644 --- a/src/app/components/fragments/content-choice-creator/content-choice-creator.component.ts +++ b/src/app/components/fragments/content-choice-creator/content-choice-creator.component.ts @@ -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) { diff --git a/src/app/components/fragments/content-likert-creator/content-likert-creator.component.ts b/src/app/components/fragments/content-likert-creator/content-likert-creator.component.ts index 357658a27a3be0e692cce4cad6c4e38773b9646e..7f7f2bb46d9b155ef3334712e39406f50b036226 100644 --- a/src/app/components/fragments/content-likert-creator/content-likert-creator.component.ts +++ b/src/app/components/fragments/content-likert-creator/content-likert-creator.component.ts @@ -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( '', '', diff --git a/src/app/components/fragments/content-list/content-list.component.html.save b/src/app/components/fragments/content-list/content-list.component.html.save deleted file mode 100644 index c4808ff315963a11b5859f19d85d8efd84fb91af..0000000000000000000000000000000000000000 --- a/src/app/components/fragments/content-list/content-list.component.html.save +++ /dev/null @@ -1,15 +0,0 @@ -<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> diff --git a/src/app/components/fragments/content-text-creator/content-text-creator.component.ts b/src/app/components/fragments/content-text-creator/content-text-creator.component.ts index da8668184efd18db45208a04a1d8ebb78a5c5bb0..633f68e27a0dbfb0a15336d7e3a1f05c3b702346 100644 --- a/src/app/components/fragments/content-text-creator/content-text-creator.component.ts +++ b/src/app/components/fragments/content-text-creator/content-text-creator.component.ts @@ -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); diff --git a/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.html b/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.html index befb2397cdc3cfe43d225e0a47280c50bf8b5ccf..2a6489270632a49fa96d0390555f521657fce89a 100644 --- a/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.html +++ b/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.html @@ -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> diff --git a/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.ts b/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.ts index 9e20a26952e4c7e4aff6db176e9a2d33f508d70e..472f8ba326f29f4ac79a9172d4974e2958b1a396 100644 --- a/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.ts +++ b/src/app/components/fragments/content-yes-no-creator/content-yes-no-creator.component.ts @@ -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 { diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index 4be9b856ba8e5590eabc71f5f08c1b1ca3813867..3ee512897ea443e5ac436c840df0a612f6395354 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -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", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 09ad31b4a7cd67eaadac849d57e1e95baa6af9f1..6fd5d9872b25ec949616573a1e5a4fa069e62075 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -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",