Fixes translation

parent 2d572a71
......@@ -125,16 +125,12 @@ export function markedOptionsFactory(): MarkedOptions {
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (
createTranslateLoader
),
useFactory: createTranslateLoader,
deps: [HttpClient],
},
compiler: {
provide: TranslateCompiler,
useFactory: (
createTranslateCompiler
),
useFactory: createTranslateCompiler,
},
}),
RouterModule.forRoot(appRoutes, {
......
import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Subject } from 'rxjs';
......@@ -24,10 +24,11 @@ export class InfoComponent implements OnInit, OnDestroy, AfterViewInit {
constructor(
private footerBarService: FooterBarService,
private translateService: TranslateService,
private trackingService: TrackingService,
private route: ActivatedRoute,
private headerLabelService: HeaderLabelService,
private translate: TranslateService,
private cdRef: ChangeDetectorRef,
) {
headerLabelService.headerLabel = 'region.footer.about.title';
......@@ -37,6 +38,8 @@ export class InfoComponent implements OnInit, OnDestroy, AfterViewInit {
this.footerBarService.footerElemHome, this.footerBarService.footerElemTranslation, this.footerBarService.footerElemTheme,
]);
console.log(this.translate, this.cdRef);
if (environment.infoAboutTabEnabled) {
this.infoButtons.push({
id: 'about',
......
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TranslateModule } from '@ngx-translate/core';
import { SharedModule } from '../../shared/shared.module';
import { InfoComponent } from './info.component';
......@@ -9,23 +10,19 @@ const infoRoutes: Routes = [
path: 'about',
component: InfoComponent,
data: { content: 'about' },
},
{
}, {
path: 'tos',
component: InfoComponent,
data: { content: 'tos' },
},
{
}, {
path: 'imprint',
component: InfoComponent,
data: { content: 'imprint' },
},
{
}, {
path: 'dataprivacy',
component: InfoComponent,
data: { content: 'dataprivacy' },
},
{
}, {
path: '',
redirectTo: 'about',
pathMatch: 'full',
......@@ -34,8 +31,7 @@ const infoRoutes: Routes = [
@NgModule({
imports: [
SharedModule,
RouterModule.forChild(infoRoutes),
SharedModule, RouterModule.forChild(infoRoutes), TranslateModule,
],
declarations: [InfoComponent],
})
......
......@@ -72,6 +72,7 @@ export class RootComponent implements OnInit, AfterViewInit {
}
public ngOnInit(): void {
console.log(this.translateService);
if (isPlatformBrowser(this.platformId)) {
if (localStorage.getItem('hashtags')) {
// Migrate arsnova.click v1 quizzes
......@@ -175,7 +176,9 @@ export class RootComponent implements OnInit, AfterViewInit {
}
private fetchChildComponent(route: ActivatedRoute): INamedType {
return <INamedType>(route.firstChild ? this.fetchChildComponent(route.firstChild) : route.component);
return <INamedType>(
route.firstChild ? this.fetchChildComponent(route.firstChild) : route.component
);
}
private loadExternalStyles(styleUrl: string): Promise<void> {
......@@ -202,7 +205,9 @@ export class RootComponent implements OnInit, AfterViewInit {
}
private initializeCookieConsent(theme: QuizTheme): void {
if (!(<IWindow>window).cookieconsent || !theme || document.cookie.includes('cookieconsent_status=dismiss')) {
if (!(
<IWindow>window
).cookieconsent || !theme || document.cookie.includes('cookieconsent_status=dismiss')) {
return;
}
......@@ -213,7 +218,9 @@ export class RootComponent implements OnInit, AfterViewInit {
console.log('initializing cookie consent with theme', theme);
(<IWindow>window).cookieconsent.initialise({
(
<IWindow>window
).cookieconsent.initialise({
palette: {
popup: {
background: themeData[theme].quizNameRowStyle.bg,
......
......@@ -61,7 +61,7 @@ import {
faWrench,
} from '@fortawesome/free-solid-svg-icons';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { TranslateModule, TranslateStore } from '@ngx-translate/core';
import { TranslateModule } from '@ngx-translate/core';
import { AngularSvgIconModule } from 'angular-svg-icon';
import { AudioPlayerComponent } from './audio-player/audio-player.component';
import { GamificationAnimationComponent } from './gamification-animation/gamification-animation.component';
......@@ -83,7 +83,6 @@ import { NoDataErrorComponent } from './no-data-error/no-data-error.component';
AngularSvgIconModule,
NoDataErrorComponent,
],
providers: [TranslateStore],
declarations: [AudioPlayerComponent, GamificationAnimationComponent, NoDataErrorComponent],
bootstrap: [],
})
......
......@@ -13,5 +13,8 @@
},
"include": [
"**/*.d.ts"
],
"exclude": [
"**/testing"
]
}
Markdown is supported
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