diff --git a/src/app/components/creator/_dialogs/delete-comment/delete-comment.component.ts b/src/app/components/creator/_dialogs/delete-comment/delete-comment.component.ts index 87f87f6d0844500f1f2cd0460891211a2460c457..a32d7196e75eae619ff872fd48aef44d790d8386 100644 --- a/src/app/components/creator/_dialogs/delete-comment/delete-comment.component.ts +++ b/src/app/components/creator/_dialogs/delete-comment/delete-comment.component.ts @@ -2,6 +2,8 @@ import { Component, Inject, OnInit } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { RoomEditComponent } from '../room-edit/room-edit.component'; import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-delete-comment', @@ -17,15 +19,32 @@ export class DeleteCommentComponent implements OnInit { constructor(public dialogRef: MatDialogRef<RoomEditComponent>, - @Inject(MAT_DIALOG_DATA) public data: any) { } + @Inject(MAT_DIALOG_DATA) public data: any, + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService ) { } ngOnInit() { + this.announce(); } close(type: string): void { this.dialogRef.close(type); } + public announce() { + const lang: string = this.translationService.currentLang; + + // current live announcer content must be cleared before next read + this.liveAnnouncer.clear(); + + if (lang === 'de') { + this.liveAnnouncer.announce('Willst du diese Frage wirklich löschen?'); + } else { + this.liveAnnouncer.announce('Do you really want to delete this question'); + } + } + + /** * Returns a lambda which closes the dialog on call. diff --git a/src/app/components/creator/_dialogs/delete-comments/delete-comments.component.ts b/src/app/components/creator/_dialogs/delete-comments/delete-comments.component.ts index 5f743019e7b2aea48141e451e8dab9a03a8b8d57..67addcaccdcef167de61848376bbfc4aa91af616 100644 --- a/src/app/components/creator/_dialogs/delete-comments/delete-comments.component.ts +++ b/src/app/components/creator/_dialogs/delete-comments/delete-comments.component.ts @@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { RoomEditComponent } from '../room-edit/room-edit.component'; import { LiveAnnouncer } from '@angular/cdk/a11y'; import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-delete-comment', @@ -19,7 +20,8 @@ export class DeleteCommentsComponent implements OnInit { constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @Inject(MAT_DIALOG_DATA) public data: any, - private liveAnnouncer: LiveAnnouncer) { } + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService ) { } ngOnInit() { @@ -28,7 +30,16 @@ export class DeleteCommentsComponent implements OnInit { public announce() { - this.liveAnnouncer.announce('Willst du wirklich alle Fragen dieser Sitzung löschen?', 'assertive'); + const lang: string = this.translationService.currentLang; + + // current live announcer content must be cleared before next read + this.liveAnnouncer.clear(); + + if (lang === 'de') { + this.liveAnnouncer.announce('Willst du wirklich alle Fragen dieser Sitzung löschen?'); + } else { + this.liveAnnouncer.announce('Do you really want to delete all questions of this session?'); + } } diff --git a/src/app/components/creator/_dialogs/moderator-delete/moderator-delete.component.ts b/src/app/components/creator/_dialogs/moderator-delete/moderator-delete.component.ts index a8838b3c95cad18870757d61608378aea65b6886..3cf33799ab2ec7da5d9ee38e7e4957fb815cfba8 100644 --- a/src/app/components/creator/_dialogs/moderator-delete/moderator-delete.component.ts +++ b/src/app/components/creator/_dialogs/moderator-delete/moderator-delete.component.ts @@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { ModeratorsComponent } from '../moderators/moderators.component'; import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-moderator-delete', @@ -22,7 +23,8 @@ export class ModeratorDeleteComponent implements OnInit { constructor(public dialogRef: MatDialogRef<ModeratorsComponent>, @Inject(MAT_DIALOG_DATA) public data: any, - private liveAnnouncer: LiveAnnouncer) { } + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService ) { } ngOnInit() { this.announce(); @@ -31,7 +33,16 @@ export class ModeratorDeleteComponent implements OnInit { public announce() { - this.liveAnnouncer.announce('Willst du wirklich diesen Moderator löschen?', 'assertive'); + const lang: string = this.translationService.currentLang; + + // current live announcer content must be cleared before next read + this.liveAnnouncer.clear(); + + if (lang === 'de') { + this.liveAnnouncer.announce('Willst du wirklich den Moderator ' + this.loginId + ' löschen?'); + } else { + this.liveAnnouncer.announce('Do you really want to remove the moderator? ' + this.loginId); + } } diff --git a/src/app/components/creator/_dialogs/room-delete/room-delete.component.ts b/src/app/components/creator/_dialogs/room-delete/room-delete.component.ts index 4e9574bd32bb519eff974df3ecff775ba7c122ad..1ae5ad4843f28aa156d059faf355127dd9b0e708 100644 --- a/src/app/components/creator/_dialogs/room-delete/room-delete.component.ts +++ b/src/app/components/creator/_dialogs/room-delete/room-delete.component.ts @@ -4,6 +4,7 @@ import { Room } from '../../../../models/room'; import { RoomEditComponent } from '../room-edit/room-edit.component'; import { DialogConfirmActionButtonType } from '../../../shared/dialog/dialog-action-buttons/dialog-action-buttons.component'; import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-room-delete', @@ -22,7 +23,8 @@ export class RoomDeleteComponent implements OnInit { constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @Inject(MAT_DIALOG_DATA) public data: any, - private liveAnnouncer: LiveAnnouncer) { } + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService ) { } ngOnInit() { @@ -31,7 +33,17 @@ export class RoomDeleteComponent implements OnInit { public announce() { - this.liveAnnouncer.announce('Willst du die Sitzung wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.', 'assertive'); + const lang: string = this.translationService.currentLang; + + // current live announcer content must be cleared before next read + this.liveAnnouncer.clear(); + + if (lang === 'de') { + this.liveAnnouncer.announce('Willst du die Sitzung' + this.room.name + 'wirklich löschen? ' + + 'Diese Aktion kann nicht rückgängig gemacht werden.'); + } else { + this.liveAnnouncer.announce('Do you really want to delete session' + this.room.name + '? This action can not be undone.'); + } }