diff --git a/src/app/components/participant/content-text-participant/content-text-participant.component.ts b/src/app/components/participant/content-text-participant/content-text-participant.component.ts index 234978ba7523e98b04acb4320b54186334ed5a83..d0f6e47064f8e82dd0ab98bcf1676b51fffdd57a 100644 --- a/src/app/components/participant/content-text-participant/content-text-participant.component.ts +++ b/src/app/components/participant/content-text-participant/content-text-participant.component.ts @@ -3,6 +3,8 @@ import { ContentText } from '../../../models/content-text'; import { ContentAnswerService } from '../../../services/http/content-answer.service'; import { AnswerText } from '../../../models/answer-text'; import { NotificationService } from '../../../services/util/notification.service'; +import { TranslateService } from '@ngx-translate/core'; +import { LanguageService } from '../../shared/LanguageService'; @Component({ selector: 'app-content-text-participant', @@ -16,13 +18,16 @@ export class ContentTextParticipantComponent implements OnInit { isAnswerSent = false; constructor(private answerService: ContentAnswerService, - private notificationService: NotificationService) { - } + private notificationService: NotificationService, + private translateService: TranslateService, + protected langService: LanguageService) { + langService.langEmitter.subscribe(lang => translateService.use(lang)); +} ngOnInit() { + this.translateService.use(sessionStorage.getItem('currentLang')); } -// submitAnswer(answer: string) { submitAnswer() { if (this.textAnswer.trim().valueOf() === '') { this.notificationService.show('No empty answer allowed.'); diff --git a/src/app/components/participant/participant-content-carousel-page/participant-content-carousel-page.component.ts b/src/app/components/participant/participant-content-carousel-page/participant-content-carousel-page.component.ts index c9cbe08687ac8e32f8f8a414a5c816b32d142630..6791be5a4a9fd744bf99643da957cedfa3e7cde4 100644 --- a/src/app/components/participant/participant-content-carousel-page/participant-content-carousel-page.component.ts +++ b/src/app/components/participant/participant-content-carousel-page/participant-content-carousel-page.component.ts @@ -1,8 +1,5 @@ import { Component, OnInit } from '@angular/core'; import { ContentType } from '../../../models/content-type.enum'; -import { AnswerOption } from '../../../models/answer-option'; -import { ContentChoice } from '../../../models/content-choice'; -import { ContentText } from '../../../models/content-text'; import { ContentService } from '../../../services/http/content.service'; import { ActivatedRoute } from '@angular/router'; import { Content } from '../../../models/content'; diff --git a/src/app/components/participant/room-participant-page/room-participant-page.component.ts b/src/app/components/participant/room-participant-page/room-participant-page.component.ts index 8942ede249c57e13abe0dbab60335194f0a429dc..03f9b324d780ef42338e4d15f8dbcfc58d3c4dbd 100644 --- a/src/app/components/participant/room-participant-page/room-participant-page.component.ts +++ b/src/app/components/participant/room-participant-page/room-participant-page.component.ts @@ -3,6 +3,8 @@ import { Room } from '../../../models/room'; import { Location } from '@angular/common'; import { RoomService } from '../../../services/http/room.service'; import { ActivatedRoute, Router } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { LanguageService } from '../../shared/LanguageService'; @Component({ selector: 'app-room-participant-page', @@ -17,13 +19,16 @@ export class RoomParticipantPageComponent implements OnInit { constructor(private location: Location, private roomService: RoomService, private route: ActivatedRoute, - private router: Router) { + private translateService: TranslateService, + protected langService: LanguageService) { + langService.langEmitter.subscribe(lang => translateService.use(lang)); } ngOnInit() { this.route.params.subscribe(params => { this.getRoom(params['roomId']); }); + this.translateService.use(sessionStorage.getItem('currentLang')); } getRoom(id: string): void {