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 3bc8b60e8d3d620f78e4eb9808680fd0684bb247..66089deb868fb697330a81d57b4eb570fa2983be 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 @@ -17,47 +17,28 @@ export class DeleteCommentComponent implements OnInit { */ confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Alert; - constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @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 die Frage wirklich löschen?'); - } else { - this.liveAnnouncer.announce('Do you really want to delete this question'); - } + this.translationService.get('comment-list.really-delete').subscribe(msg => { + this.liveAnnouncer.announce(msg); + }); } - - /** * Returns a lambda which closes the dialog on call. */ buildCloseDialogActionCallback(): () => void { - return () => this.close('abort'); + return () => this.dialogRef.close('abort'); } - /** * Returns a lambda which executes the dialog dedicated action on call. */ buildCommentDeleteActionCallback(): () => void { - return () => this.close('delete'); + return () => this.dialogRef.close('delete'); } } 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 67addcaccdcef167de61848376bbfc4aa91af616..c8e750473144b80f37f8c05dfefb4dea70fa0e46 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 @@ -17,7 +17,6 @@ export class DeleteCommentsComponent implements OnInit { */ confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Alert; - constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @Inject(MAT_DIALOG_DATA) public data: any, private liveAnnouncer: LiveAnnouncer, @@ -25,24 +24,11 @@ export class DeleteCommentsComponent implements OnInit { ngOnInit() { - this.announce(); - } - - - 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 wirklich alle Fragen dieser Sitzung löschen?'); - } else { - this.liveAnnouncer.announce('Do you really want to delete all questions of this session?'); - } + this.translationService.get('room-page.really-delete-comments').subscribe(msg => { + this.liveAnnouncer.announce(msg); + }); } - /** * Returns a lambda which closes the dialog on call. */ @@ -50,7 +36,6 @@ export class DeleteCommentsComponent implements OnInit { return () => this.dialogRef.close('abort'); } - /** * Returns a lambda which executes the dialog dedicated action on call. */ 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 3cf33799ab2ec7da5d9ee38e7e4957fb815cfba8..8ef7fe3df208f8233be67382625e2f5a4cee93bd 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 @@ -14,43 +14,26 @@ export class ModeratorDeleteComponent implements OnInit { loginId: string; - /** * The confirm button type of the dialog. */ confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Alert; - constructor(public dialogRef: MatDialogRef<ModeratorsComponent>, @Inject(MAT_DIALOG_DATA) public data: any, private liveAnnouncer: LiveAnnouncer, private translationService: TranslateService ) { } ngOnInit() { - this.announce(); - + this.translationService.get('room-page.really-remove-moderator').subscribe(msg => { + this.liveAnnouncer.announce(msg + this.loginId); + }); } - - 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 wirklich den Moderator ' + this.loginId + ' löschen?'); - } else { - this.liveAnnouncer.announce('Do you really want to remove the moderator? ' + this.loginId); - } - } - - close(type: string): void { this.dialogRef.close(type); } - /** * Returns a lambda which closes the dialog on call. */ @@ -58,7 +41,6 @@ export class ModeratorDeleteComponent implements OnInit { return () => this.close('abort'); } - /** * Returns a lambda which executes the dialog dedicated action on call. */ 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 1ae5ad4843f28aa156d059faf355127dd9b0e708..ad5f73eb2c2cc51d972f7f2d8319c2afd5f33836 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 @@ -14,13 +14,11 @@ import { TranslateService } from '@ngx-translate/core'; export class RoomDeleteComponent implements OnInit { room: Room; - /** * The confirm button type of the dialog. */ confirmButtonType: DialogConfirmActionButtonType = DialogConfirmActionButtonType.Alert; - constructor(public dialogRef: MatDialogRef<RoomEditComponent>, @Inject(MAT_DIALOG_DATA) public data: any, private liveAnnouncer: LiveAnnouncer, @@ -28,25 +26,13 @@ export class RoomDeleteComponent implements OnInit { ngOnInit() { - this.announce(); - } - - - 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 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.'); - } + this.translationService.get('room-page.reallySession').subscribe(msg1 => { + this.translationService.get('room-page.really2').subscribe(msg2 => { + this.liveAnnouncer.announce(msg1 + this.room.name + msg2); + }); + }); } - /** * Closes the dialog on call. */ @@ -54,7 +40,6 @@ export class RoomDeleteComponent implements OnInit { this.dialogRef.close(); } - /** * Returns a lambda which closes the dialog on call. */ @@ -62,7 +47,6 @@ export class RoomDeleteComponent implements OnInit { return () => this.closeDialog(); } - /** * Returns a lambda which executes the dialog dedicated action on call. */