diff --git a/src/app/components/participant/home-participant-page/home-participant-page.component.ts b/src/app/components/participant/home-participant-page/home-participant-page.component.ts index cdf91279c6e2110646d27ebcce93da972d5ee58e..d2f584299c42ee19a50b762526fcb2a9237f2fd0 100644 --- a/src/app/components/participant/home-participant-page/home-participant-page.component.ts +++ b/src/app/components/participant/home-participant-page/home-participant-page.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { LanguageService } from '../../shared/LanguageService'; @Component({ selector: 'app-home-participant-page', @@ -7,9 +9,13 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeParticipantPageComponent implements OnInit { - constructor() { } + constructor(private translateService: TranslateService, + protected langService: LanguageService) { + langService.langEmitter.subscribe(lang => translateService.use(lang)); + } ngOnInit() { + this.translateService.use(sessionStorage.getItem('currentLang')); } } diff --git a/src/app/components/participant/participant.module.ts b/src/app/components/participant/participant.module.ts index 17667eab24dd3a59230a81662308c9e7a993c206..b156b638073010f297564d66916cfc00eae4373a 100644 --- a/src/app/components/participant/participant.module.ts +++ b/src/app/components/participant/participant.module.ts @@ -1,20 +1,30 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ParticipantRoutingModule } from './participant-routing.module'; -import { EssentialsModule } from '../essentials/essentials.module'; +import { EssentialsModule, HttpLoaderFactory} from '../essentials/essentials.module'; import { ContentChoiceParticipantComponent } from './content-choice-participant/content-choice-participant.component'; import { ContentTextParticipantComponent } from './content-text-participant/content-text-participant.component'; import { HomeParticipantPageComponent } from './home-participant-page/home-participant-page.component'; import { RoomParticipantPageComponent } from './room-participant-page/room-participant-page.component'; import { SharedModule } from '../shared/shared.module'; import { ParticipantContentCarouselPageComponent } from './participant-content-carousel-page/participant-content-carousel-page.component'; +import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; +import { HttpClient } from '@angular/common/http'; @NgModule({ imports: [ CommonModule, ParticipantRoutingModule, EssentialsModule, - SharedModule + SharedModule, + TranslateModule.forChild({ + loader: { + provide: TranslateLoader, + useFactory: (HttpLoaderFactory), + deps: [HttpClient] + }, + isolate: true + }) ], declarations: [ ContentChoiceParticipantComponent,