diff --git a/src/app/components/shared/_dialogs/delete-account/delete-account.component.ts b/src/app/components/shared/_dialogs/delete-account/delete-account.component.ts index e4c9c8059c51032fc6862e169a29d4124d0f906d..a2ac9a57ddf5e18d25ccb6f1e2934f5d188199af 100644 --- a/src/app/components/shared/_dialogs/delete-account/delete-account.component.ts +++ b/src/app/components/shared/_dialogs/delete-account/delete-account.component.ts @@ -4,6 +4,8 @@ import { RoomEditComponent } from '../../../creator/_dialogs/room-edit/room-edit import { RoomService } from '../../../../services/http/room.service'; import { Room } from '../../../../models/room'; import { DialogConfirmActionButtonType } from '../../dialog/dialog-action-buttons/dialog-action-buttons.component'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-delete-account', @@ -23,9 +25,12 @@ export class DeleteAccountComponent implements OnInit { constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @Inject(MAT_DIALOG_DATA) public data: any, - private roomService: RoomService) { } + private roomService: RoomService, + private liveAnnouncer: LiveAnnouncer, + private translationService: TranslateService, ) { } ngOnInit() { + this.announce(); this.roomService.getCreatorRooms().subscribe(rooms => { this.rooms = rooms.sort((a, b) => { return a.name > b.name ? 1 : -1; @@ -33,6 +38,21 @@ export class DeleteAccountComponent implements OnInit { }); } + 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 dein Konto mit allen Sitzungen unwiderruflich löschen?', 'assertive'); + } else { + this.liveAnnouncer.announce('Do you really want to irrevocably delete your account with the associated sessions?', 'assertive'); + } + + } + + close(type: string): void { this.dialogRef.close(type); }