update user guide when language changes.
This commit is contained in:
parent
50169222c7
commit
7c347569fd
|
@ -1,11 +1,13 @@
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||||
import { LanguageService } from '@app/core/services/language/language.service';
|
import { LanguageService } from '@app/core/services/language/language.service';
|
||||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
||||||
import { UserGuideService } from '@app/core/services/user-guide/user-guide.service';
|
import { UserGuideService } from '@app/core/services/user-guide/user-guide.service';
|
||||||
import { BaseComponent } from '@common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
||||||
import { interval, Subject } from 'rxjs';
|
import { interval, Subject } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@ -33,7 +35,9 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit {
|
||||||
private languageService: LanguageService,
|
private languageService: LanguageService,
|
||||||
private httpClient: HttpClient,
|
private httpClient: HttpClient,
|
||||||
private matomoService: MatomoService,
|
private matomoService: MatomoService,
|
||||||
private configurationService: ConfigurationService
|
private configurationService: ConfigurationService,
|
||||||
|
private translate: TranslateService,
|
||||||
|
private router: Router
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -43,6 +47,9 @@ export class UserGuideContentComponent extends BaseComponent implements OnInit {
|
||||||
this.activeToc(ev);
|
this.activeToc(ev);
|
||||||
this.scroll(ev);
|
this.scroll(ev);
|
||||||
});
|
});
|
||||||
|
this.translate.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||||
|
this.router.navigate(['/reload']).then(() => this.router.navigate(['/user-guide']));
|
||||||
|
});
|
||||||
this.userGuideService.getUserGuide(this.languageService.getCurrentLanguage())
|
this.userGuideService.getUserGuide(this.languageService.getCurrentLanguage())
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(response => {
|
.subscribe(response => {
|
||||||
|
|
Loading…
Reference in New Issue