diff --git a/src/app/components/shared/footer/footer.component.html b/src/app/components/shared/footer/footer.component.html index 4a9a0908ddfacf470a455af18ca24013016cd08b..88fad08f0c25bcf9ccc8a49cb586bbebf49c4ffa 100644 --- a/src/app/components/shared/footer/footer.component.html +++ b/src/app/components/shared/footer/footer.component.html @@ -7,12 +7,12 @@ <span class="fill-remaining-space"></span> <button mat-button (click)="navToDSGVO()"> <mat-icon>security</mat-icon> - DSGVO + {{ 'footer.dsgvo' | translate}} </button> <span class="fill-remaining-space"></span> <button mat-button (click)="navToImprint()"> <mat-icon>info</mat-icon> - Impressum + {{ 'footer.imprint' | translate}} </button> </mat-toolbar> </footer> diff --git a/src/app/components/shared/footer/footer.component.ts b/src/app/components/shared/footer/footer.component.ts index b13f6cc82f8bf8228ee1f7e5acc4e4404006651a..6a744993f6e5645b444f16c74d2eac08643dcca0 100644 --- a/src/app/components/shared/footer/footer.component.ts +++ b/src/app/components/shared/footer/footer.component.ts @@ -1,7 +1,9 @@ +import { LanguageService } from './../../../services/util/language.service'; import { Component, OnInit } from '@angular/core'; import { NotificationService } from '../../../services/util/notification.service'; import { Router } from '@angular/router'; import { MatDialog } from '@angular/material'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-footer', @@ -13,18 +15,29 @@ export class FooterComponent implements OnInit { blogUrl = 'https://arsnova.thm.de/blog/'; dsgvoUrl = 'https://arsnova.thm.de/blog/datenschutzerklaerung/'; imprUrl = 'https://arsnova.thm.de/blog/impressum/'; - constructor( - public notificationService: NotificationService, - public router: Router, - public dialog: MatDialog - ) { } + + open: string; + + constructor(public notificationService: NotificationService, + public router: Router, + public dialog: MatDialog, + private translateService: TranslateService, + private langService: LanguageService) { + langService.langEmitter.subscribe(lang => translateService.use(lang)); + } ngOnInit() { + this.translateService.use(localStorage.getItem('currentLang')); + this.translateService.get('footer.open').subscribe(message => { + this.open = message; + }); } navToBlog() { - this.notificationService.show('Der Blog wird in einem neuen Fenster geöffnet..', 'Öffnen' , { - duration: 4000 + this.translateService.get('footer.will-open').subscribe(message => { + this.notificationService.show('Blog' + message, this.open, { + duration: 4000 + }); }); this.notificationService.snackRef.afterDismissed().subscribe(info => { if (info.dismissedByAction === true) { @@ -33,8 +46,12 @@ export class FooterComponent implements OnInit { }); } navToDSGVO() { - this.notificationService.show('Die Datenschutzverordnung wird in einem neuen Fenster geöffnet..', 'Öffnen' , { - duration: 5000 + this.translateService.get('footer.will-open').subscribe(message => { + this.translateService.get('footer.dsgvo').subscribe(what => { + this.notificationService.show(what + message, this.open, { + duration: 4000 + }); + }); }); this.notificationService.snackRef.afterDismissed().subscribe(info => { if (info.dismissedByAction === true) { @@ -43,8 +60,12 @@ export class FooterComponent implements OnInit { }); } navToImprint() { - this.notificationService.show('Das Impressum wird in einem neuen Fenster geöffnet..', 'Öffnen' , { - duration: 5000 + this.translateService.get('footer.will-open').subscribe(message => { + this.translateService.get('footer.imprint').subscribe(what => { + this.notificationService.show(what + message, this.open, { + duration: 4000 + }); + }); }); this.notificationService.snackRef.afterDismissed().subscribe(info => { if (info.dismissedByAction === true) { diff --git a/src/app/components/shared/statistics-page/statistics-page.component.ts b/src/app/components/shared/statistics-page/statistics-page.component.ts index dd6cb63d71433cd24173b05f2f5a5835ff4f70f7..9ae19ce398c24f3a427b7a9efc73ed1ff094f53d 100644 --- a/src/app/components/shared/statistics-page/statistics-page.component.ts +++ b/src/app/components/shared/statistics-page/statistics-page.component.ts @@ -40,10 +40,10 @@ export class StatisticsPageComponent implements OnInit { } this.getRoom(localStorage.getItem('roomId')); this.tabGroup.selectedIndex = 1; + this.translateService.use(localStorage.getItem('currentLang')); } getRoom(id: string): void { - this.translateService.use(localStorage.getItem('currentLang')); this.roomService.getRoom(id).subscribe(room => { this.contentGroups = room.contentGroups; if (this.contentGroups) { diff --git a/src/assets/i18n/home/de.json b/src/assets/i18n/home/de.json index 8f779d1bda8e111d33bd420b019108ddd94abbda..8919680494729e3ecb2043798351dbc36f69162a 100644 --- a/src/assets/i18n/home/de.json +++ b/src/assets/i18n/home/de.json @@ -71,5 +71,11 @@ "description": "Beschreibung", "max-ls": "Max. Zeichen:", "create-session": "Session erstellen" - } + }, + "footer": { + "dsgvo": "DSGVO", + "imprint": "Impressum", + "will-open": " wird in einem neuen Fenster geöffnet..", + "open": "Öffnen" + } } diff --git a/src/assets/i18n/home/en.json b/src/assets/i18n/home/en.json index 42504f2b9e0a5232eefcdd06759937209d1a961d..3da52631f78fea66d5f8eb6470b5fd18809fa374 100644 --- a/src/assets/i18n/home/en.json +++ b/src/assets/i18n/home/en.json @@ -71,5 +71,11 @@ "description": "Description", "max-ls": "Max. letters / signs:", "create-session": "Create session" - } + }, + "footer": { + "dsgvo": "GDPR", + "imprint": "Imprint", + "will-open": " will be opened in a new tab..", + "open": "Open" + } }