Skip to content
Snippets Groups Projects
Commit c95cd8e2 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Make translation-service available for all shared-pages/components

parent 61d36f0f
Branches
Tags
No related merge requests found
......@@ -8,6 +8,8 @@ import { NotificationService } from '../../../services/util/notification.service
import { AuthenticationService } from '../../../services/http/authentication.service';
import { UserRole } from '../../../models/user-roles.enum';
import { User } from '../../../models/user';
import {TranslateService} from "@ngx-translate/core";
import {LanguageService} from "../LanguageService";
@Component({
selector: 'app-comment-list',
......@@ -28,7 +30,10 @@ export class CommentListComponent implements OnInit {
private roomService: RoomService,
private location: Location,
private commentService: CommentService,
private notification: NotificationService) {
private notification: NotificationService,
private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
......@@ -37,6 +42,7 @@ export class CommentListComponent implements OnInit {
this.roomShortId = this.route.snapshot.paramMap.get('roomId');
this.roomId = localStorage.getItem(`roomId`);
this.getComments();
this.translateService.use(sessionStorage.getItem('currentLang'));
}
getComments(): void {
......
......@@ -13,6 +13,8 @@ import { ContentTextCreatorComponent } from '../../creator/content-text-creator/
import { NotificationService } from '../../../services/util/notification.service';
import { Room } from '../../../models/room';
import { RoomService } from '../../../services/http/room.service';
import {TranslateService} from "@ngx-translate/core";
import {LanguageService} from "../LanguageService";
class ContentGroup {
name: string;
......@@ -51,7 +53,10 @@ export class ContentListComponent implements OnInit {
private roomService: RoomService,
private route: ActivatedRoute,
private notificationService: NotificationService,
public dialog: MatDialog) {
public dialog: MatDialog,
private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
......@@ -66,6 +71,7 @@ export class ContentListComponent implements OnInit {
this.route.params.subscribe(params => {
sessionStorage.setItem('collection', params['contentGroup']);
});
this.translateService.use(sessionStorage.getItem('currentLang'));
}
findIndexOfSubject(subject: string): number {
......
......@@ -3,6 +3,8 @@ import { AuthenticationService } from '../../../services/http/authentication.ser
import { UserRole } from '../../../models/user-roles.enum';
import { NotificationService } from '../../../services/util/notification.service';
/* ToDo: Use TranslateService */
@Component({
selector: 'app-feedback-barometer-page',
templateUrl: './feedback-barometer-page.component.html',
......
......@@ -8,6 +8,8 @@ import { AnswerText } from '../../../models/answer-text';
import { AnswerChoice } from '../../../models/answer-choice';
import { ContentType } from '../../../models/content-type.enum';
/* TODO: Use TranslateService */
@Component({
selector: 'app-statistics',
templateUrl: './statistics.component.html',
......
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