diff --git a/src/app/components/creator/_dialogs/content-delete/content-delete.component.html b/src/app/components/creator/_dialogs/content-delete/content-delete.component.html index cf6fc8b3e690f27abe4864c42fbc4a8bad71aa1e..ec9c306b291eb9aeaec466ebedb9865f9605e16b 100644 --- a/src/app/components/creator/_dialogs/content-delete/content-delete.component.html +++ b/src/app/components/creator/_dialogs/content-delete/content-delete.component.html @@ -1,4 +1,4 @@ -<h3>Are you sure?</h3> +<h3>{{ 'room-page.sure' | translate}}</h3> <p>Do you really want to delete content <strong>{{content.subject}}</strong>? This action can not be undone.</p> <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px"> <button mat-raised-button color="warn" (click)="closeDialog('delete')"> diff --git a/src/app/components/creator/content-choice-creator/content-choice-creator.component.html b/src/app/components/creator/content-choice-creator/content-choice-creator.component.html index b1bf1f8097ae0a284daf90e70e3a6491c62acc49..e4d24bd803bf5172b87fcba70451aa88a87102b4 100644 --- a/src/app/components/creator/content-choice-creator/content-choice-creator.component.html +++ b/src/app/components/creator/content-choice-creator/content-choice-creator.component.html @@ -71,8 +71,7 @@ <button mat-raised-button type="submit" color="accent">{{ 'content.create' | translate }}</button> <button mat-raised-button (click)="reset($event)" color="primary">{{ 'content.reset' | translate }}</button> <button mat-raised-button *ngIf="lastDeletedDisplayAnswer" (click)="recoverDeletedAnswer($event)" color="primary"> - Undo - deletion + {{ 'content.undo' | translate}} </button> </div> <div *ngIf="editDialogMode" fxLayout="row" fxLayoutAlign="center" fxLayoutGap="50px"> diff --git a/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts b/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts index 45d0019821312a1c02ff0cd6cdc82c9d588af996..8ccc928f3d4ff1f61263dcc6d67ea4bf7e81355c 100644 --- a/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts +++ b/src/app/components/creator/content-choice-creator/content-choice-creator.component.ts @@ -111,20 +111,26 @@ export class ContentChoiceCreatorComponent implements OnInit { addAnswer($event) { $event.preventDefault(); if (this.newAnswerOptionLabel === '') { - this.notificationService.show('No empty answers allowed.'); + this.translationService.get('content.no-empty2').subscribe(message => { + this.notificationService.show(message); + }); this.newAnswerOptionChecked = false; this.newAnswerOptionLabel = ''; return; } if (this.singleChoice && this.content.correctOptionIndexes.length > 0 && this.newAnswerOptionChecked) { - this.notificationService.show('In single choice mode is only 1 true answer allowed.'); + this.translationService.get('content.only-one').subscribe(message => { + this.notificationService.show(message); + }); this.newAnswerOptionChecked = false; this.newAnswerOptionLabel = ''; return; } for (let i = 0; i < this.content.options.length; i++) { if (this.content.options[i].label.valueOf() === this.newAnswerOptionLabel.valueOf()) { - this.notificationService.show('Same answer label is not allowed.'); + this.translationService.get('content.same-answer').subscribe(message => { + this.notificationService.show(message); + }); return; } } @@ -169,7 +175,9 @@ export class ContentChoiceCreatorComponent implements OnInit { } this.fillCorrectAnswers(); if (matDialogOutput) { - this.notificationService.show('Update changes.'); + this.translationService.get('content.changes-made').subscribe(message => { + this.notificationService.show(message); + }); } } @@ -188,30 +196,32 @@ export class ContentChoiceCreatorComponent implements OnInit { } } this.fillCorrectAnswers(); - this.notificationService.show('Answer "' + this.lastDeletedDisplayAnswer.answerOption.label + '" successfully deleted.'); + this.translationService.get('content.answer-deleted').subscribe(message => { + this.notificationService.show(message); + }); } recoverDeletedAnswer($event) { $event.preventDefault(); - let msgAddon = 'Answer "' + this.lastDeletedDisplayAnswer.answerOption.label + '" successfully recovered.'; - if (this.lastDeletedDisplayAnswer === null) { - this.notificationService.show('Nothing to recover.'); - } + this.translationService.get('content.answer-recovered').subscribe(message => { this.notificationService.show(message); + }); for (let i = 0; i < this.content.options.length; i++) { if (this.content.options[i].label.valueOf() === this.lastDeletedDisplayAnswer.answerOption.label.valueOf()) { - this.notificationService.show('Same answer label is not allowed.'); + this.translationService.get('content.same-answer').subscribe(message => { + this.notificationService.show(message); + }); return; } } this.content.options.push(this.lastDeletedDisplayAnswer.answerOption); if (this.lastDeletedDisplayAnswer.correct) { if (this.singleChoice && this.content.correctOptionIndexes.length > 0) { - msgAddon = 'In single mode is only 1 true answer allowed. Recovered item is set to false.'; + this.translationService.get('content.only-one-true').subscribe(message => { this.notificationService.show(message); + }); } else { this.content.correctOptionIndexes.push(this.content.options.length - 1); } } - this.notificationService.show(msgAddon); this.lastDeletedDisplayAnswer = null; this.fillCorrectAnswers(); } @@ -233,7 +243,9 @@ export class ContentChoiceCreatorComponent implements OnInit { this.content.options = []; this.content.correctOptionIndexes = []; this.fillCorrectAnswers(); - this.notificationService.show('Reset all inputs to default.'); + this.translationService.get('content.reset-all').subscribe(message => { + this.notificationService.show(message); + }); } resetAfterSubmit() { @@ -255,15 +267,21 @@ export class ContentChoiceCreatorComponent implements OnInit { return; } if (this.content.options.length === 0) { - this.notificationService.show('Choice content needs answers. Please add some answers.'); + this.translationService.get('content.need-answers').subscribe(message => { + this.notificationService.show(message); + }); return; } if (this.singleChoice && this.content.correctOptionIndexes.length !== 1) { - this.notificationService.show('In single choice mode you have to select 1 true answer.'); + this.translationService.get('content.select-one').subscribe(message => { + this.notificationService.show(message); + }); return; } if (!this.singleChoice && this.content.correctOptionIndexes.length < 1) { - this.notificationService.show('In multiple choice mode you have to select at least 1 true answer.'); + this.translationService.get('content.at-least-one').subscribe(message => { + this.notificationService.show(message); + }); return; } if (this.singleChoice) { diff --git a/src/app/components/participant/_dialogs/answer-edit/answer-edit.component.html b/src/app/components/participant/_dialogs/answer-edit/answer-edit.component.html index 797df3faf590ab249296c1cc70d5c175db3d6918..bff24530cb7b8b0fd6dec742c1ef728e57527354 100644 --- a/src/app/components/participant/_dialogs/answer-edit/answer-edit.component.html +++ b/src/app/components/participant/_dialogs/answer-edit/answer-edit.component.html @@ -1,19 +1,18 @@ <div *ngIf="answer"> <mat-form-field class="input-block"> - <input [(ngModel)]="answer.answerOption.label" #roomName matInput placeholder="Answer label" name="answer-label"/> + <input [(ngModel)]="answer.answerOption.label" #roomName matInput placeholder="{{ 'content.answer' | translate }}" name="answer-label"/> </mat-form-field> <mat-form-field class="input-block"> <textarea [(ngModel)]="answer.answerOption.points" #roomDescription matInput matTextareaAutosize - matAutosizeMinRows="2" matAutosizeMaxRows="5" placeholder="Points" name="points"> + matAutosizeMinRows="2" matAutosizeMaxRows="5" placeholder="{{ 'content.points' | translate }}" name="points"> </textarea> </mat-form-field> - <mat-checkbox [(ngModel)]="answer.correct" color="primary">Answer is {{answer.correct}}.</mat-checkbox> <div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="10px"> <button (click)="dialogRef.close()" mat-button color="primary"> - Leave + {{ 'room-page.abort' | translate }} </button> <button (click)="dialogRef.close('edit')" mat-raised-button color="primary"> - Update + {{ 'room-page.update' | translate }} </button> </div> </div> diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index c31fa448fe1b2342d50b217067b1c94238be17c2..21be3eafdfaec4887c4a778094f13f5231ca8917 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -100,7 +100,20 @@ "contents": "Fragen", "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." + "no-empty": "Keine leeren Felder erlaubt. Bitte überprüfen sie Thema und Inhalt.", + "no-empty2": "Keine leeren Felder erlaubt.", + "only-one": "Im Single-Choice-Modus ist nur eine Antwort erlaubt.", + "same-answer": "Zweimal die selbe Antwort ist nicht erlaubt.", + "changes-made": "Änderungen gespeichert.", + "answer-deleted": "Antwort gelöscht.", + "answer-recovered": "Antwort wiederhergestellt.", + "only-one-true": "Im Single-Modus ist nur eine richtige Antwort erlaubt.", + "reset-all": "Alle Eingaben wurden zurückgesetzt.", + "need-answers": "Auswahlfragen brauchen Antworten. Bitte fügen Sie Antworten hinzu", + "select-one": "Im Single-Choice-Modus muss es eine richtige Antwort geben.", + "at-least-one": "Im Multiple-Choice-Modus muss es mindestens eine richtige Antwort geben.", + "undo": "Rückgängig", + "points": "Punkte" }, "session": { "session-name": "Name der Session", diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 01eb033dc804c0220bd9dff967fcf2e632e564ec..ccbc87612f098ce63b707c416974c6c0d25c98c5 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -97,7 +97,20 @@ "contents": "Contents", "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." + "no-empty": "No empty fields allowed. Please check subject and body.", + "no-empty2": "No empty filed allowed.", + "only-one": "In single choice mode is only 1 true answer allowed.", + "same-answer": "Same answer label is not allowed.", + "changes-made": "Changes are made.", + "answer-deleted": "Answer deleted.", + "answer-recovered": "Answer recovered.", + "only-one-true": "In single mode is only 1 true answer allowed.", + "reset-all": "Reseted all inputs", + "need-answers": "Choice content needs answers. Please add some answers.", + "select-one": "In single choice mode you have to select 1 true answer.", + "at-least-one": "In multiple choice mode you have to select at least 1 true answer.", + "undo": "Undo", + "points": "Points" }, "session": { "session-name": "Session name",