Skip to content
Snippets Groups Projects
Commit 24e49715 authored by Stefan Plociennik's avatar Stefan Plociennik
Browse files

merge translation to slider toggle

parents 8b9638d4 91d2c925
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
<h1 mat-dialog-title>Do you really want to delete the topic "{{data.topic}}"?</h1> <h1 mat-dialog-title>{{'topic-cloud-confirm-dialog.confirm' | translate}} "{{data.topic}}"?</h1>
<div mat-dialog-actions> <div mat-dialog-actions>
<button class="primary" mat-stroked-button [mat-dialog-close]="false">Cancel</button> <button class="primary" mat-stroked-button [mat-dialog-close]="false">
<button class="warn" mat-stroked-button [mat-dialog-close]="true">Delete</button> {{'topic-cloud-confirm-dialog.cancel' | translate}}</button>
<button class="warn" mat-stroked-button [mat-dialog-close]="true">
{{'topic-cloud-confirm-dialog.delete' | translate}}
</button>
</div> </div>
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
{{keyword.keyword}} {{keyword.keyword}}
</mat-panel-title> </mat-panel-title>
<mat-panel-description> <mat-panel-description>
{{keyword.questions.length}} Questions {{keyword.questions.length}}
{{'topic-cloud-dialog.question-count-'+(keyword.questions.length > 1 ? 'plural' : 'singular') | translate}}
</mat-panel-description> </mat-panel-description>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<p *ngFor="let question of keyword.questions">{{question}}</p> <p *ngFor="let question of keyword.questions">{{question}}</p>
...@@ -33,21 +34,20 @@ ...@@ -33,21 +34,20 @@
</div> </div>
<!-- Only visible when editing --> <!-- Only visible when editing -->
<div *ngIf="edit"> <div *ngIf="edit">
<mat-divider></mat-divider> <mat-divider></mat-divider>
<mat-form-field>
<mat-form-field> <mat-label>{{'topic-cloud-dialog.editkeyword-tipp' | translate}}</mat-label>
<mat-label>Enter new Keyword</mat-label> <input matInput [(ngModel)]="newKeyword">
<input matInput [(ngModel)]="newKeyword"> </mat-form-field>
</mat-form-field> <div>
<div> <button mat-icon-button (click)="confirmEdit(keyword.keywordID)">
<button mat-icon-button (click)="confirmEdit(keyword.keywordID)"> <mat-icon class="primary">check</mat-icon>
<mat-icon class="primary">check</mat-icon> </button>
</button> <button mat-icon-button (click)="cancelEdit()">
<button mat-icon-button (click)="cancelEdit()"> <mat-icon class="warn">cancel</mat-icon>
<mat-icon class="warn">cancel</mat-icon> </button>
</button> </div>
</div>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
......
...@@ -5,7 +5,8 @@ import { NotificationService } from '../../../../services/util/notification.serv ...@@ -5,7 +5,8 @@ import { NotificationService } from '../../../../services/util/notification.serv
import { TopicCloudConfirmDialogComponent } from '../topic-cloud-confirm-dialog/topic-cloud-confirm-dialog.component'; import { TopicCloudConfirmDialogComponent } from '../topic-cloud-confirm-dialog/topic-cloud-confirm-dialog.component';
import { AuthenticationService } from '../../../../services/http/authentication.service'; import { AuthenticationService } from '../../../../services/http/authentication.service';
import { UserRole } from '../../../../models/user-roles.enum'; import { UserRole } from '../../../../models/user-roles.enum';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../../../services/util/language.service';
@Component({ @Component({
selector: 'app-topic-cloud-dialog', selector: 'app-topic-cloud-dialog',
...@@ -23,10 +24,18 @@ export class TopicCloudDialogComponent implements OnInit { ...@@ -23,10 +24,18 @@ export class TopicCloudDialogComponent implements OnInit {
constructor(public cloudDialogRef: MatDialogRef<HeaderComponent>, constructor(public cloudDialogRef: MatDialogRef<HeaderComponent>,
public confirmDialog: MatDialog, public confirmDialog: MatDialog,
private notificationService: NotificationService, private notificationService: NotificationService,
private authenticationService: AuthenticationService) { } private authenticationService: AuthenticationService,
private translateService: TranslateService,
private langService: LanguageService) {
this.langService.langEmitter.subscribe(lang => {
this.translateService.use(lang);
});
}
ngOnInit(): void { ngOnInit(): void {
this.translateService.use(localStorage.getItem('currentLang'));
if (this.authenticationService.getRole() === UserRole.CREATOR || if (this.authenticationService.getRole() === UserRole.CREATOR ||
this.authenticationService.getRole() === UserRole.EDITING_MODERATOR || this.authenticationService.getRole() === UserRole.EDITING_MODERATOR ||
this.authenticationService.getRole() === UserRole.EDITING_MODERATOR){ this.authenticationService.getRole() === UserRole.EDITING_MODERATOR){
...@@ -35,10 +44,6 @@ export class TopicCloudDialogComponent implements OnInit { ...@@ -35,10 +44,6 @@ export class TopicCloudDialogComponent implements OnInit {
this.hasAccess = false; this.hasAccess = false;
} }
if (this.keywords.length > 0){
this.notificationService.show("there are no keywords");
this.cloudDialogRef.close();
}
let questions = ["Wie genau ist die Cloud aufgebaut?", let questions = ["Wie genau ist die Cloud aufgebaut?",
"Wieviel speicherplatz steht mir in der Cloud zur verfuegung?", "Wieviel speicherplatz steht mir in der Cloud zur verfuegung?",
"Sollen wir die Tag Cloud implementieren?"]; "Sollen wir die Tag Cloud implementieren?"];
...@@ -52,12 +57,19 @@ export class TopicCloudDialogComponent implements OnInit { ...@@ -52,12 +57,19 @@ export class TopicCloudDialogComponent implements OnInit {
"Ich wollte Fragen ob sie gerne Sachen gefragt werden", "Ich wollte Fragen ob sie gerne Sachen gefragt werden",
"Langsam geht mir die Fragerei mit den ganzen Fragen auf den Geist"]; "Langsam geht mir die Fragerei mit den ganzen Fragen auf den Geist"];
this.pushToArray(3, "Frage", questions); this.pushToArray(3, "Frage", questions);
if (this.keywords.length == 0){
this.translateService.get('topic-cloud-dialog.nokeyword-note').subscribe(msg => {
this.notificationService.show(msg);
});
this.cloudDialogRef.close();
}
} }
pushToArray(id: number, key: string, questions: string[]){ pushToArray(id: number, key: string, questions: string[]){
let _keyword = { let _keyword = {
keywordID: id, keywordID: id,
keyword: key, keyword: key,
questions: questions questions: questions
} }
this.keywords.push(_keyword); this.keywords.push(_keyword);
......
...@@ -16,7 +16,7 @@ import { CorrectWrong } from '../../../../models/correct-wrong.enum'; ...@@ -16,7 +16,7 @@ import { CorrectWrong } from '../../../../models/correct-wrong.enum';
import { MatSliderChange } from '@angular/material/slider'; import { MatSliderChange } from '@angular/material/slider';
import { Period } from '../../comment-list/comment-list.component'; import { Period } from '../../comment-list/comment-list.component';
@Component({ @Component({
selector: 'app-question-wall', selector: 'app-question-wall',
templateUrl: './question-wall.component.html', templateUrl: './question-wall.component.html',
styleUrls: ['./question-wall.component.scss'] styleUrls: ['./question-wall.component.scss']
......
...@@ -292,5 +292,18 @@ ...@@ -292,5 +292,18 @@
}, },
"qr-dialog": { "qr-dialog": {
"session": "Raum" "session": "Raum"
},
"topic-cloud-dialog":{
"edit": "bearbeiten",
"delete": "löschen",
"question-count-singular": "Frage",
"question-count-plural": "Fragen",
"editkeyword-tipp": "geben Sie ein neues Keyword ein",
"nokeyword-note": "Es gibt keine Themen"
},
"topic-cloud-confirm-dialog":{
"cancel": "abbrechen",
"delete": "löschen",
"confirm": "Möchten Sie wirklich das Thema löschen"
} }
} }
...@@ -294,5 +294,18 @@ ...@@ -294,5 +294,18 @@
}, },
"qr-dialog": { "qr-dialog": {
"session": "Key code" "session": "Key code"
},
"topic-cloud-dialog":{
"edit": "edit",
"delete": "delete",
"question-count-singular": "question",
"question-count-plural": "questions",
"editkeyword-tipp": "enter new keyword",
"nokeyword-note": "there are no topics!"
},
"topic-cloud-confirm-dialog":{
"cancel": "cancel",
"delete": "delete",
"confirm": "Do you really want to delete the topic"
} }
} }
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