From 23b9b4ddd949730d8e5acace9fc35648631344c5 Mon Sep 17 00:00:00 2001 From: Amit Moryossef Date: Sun, 24 Nov 2024 14:46:44 +0100 Subject: [PATCH] feat(landing): force landing page to always use english --- src/app/pages/landing/landing.component.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/pages/landing/landing.component.ts b/src/app/pages/landing/landing.component.ts index f1d8d137..655c6539 100644 --- a/src/app/pages/landing/landing.component.ts +++ b/src/app/pages/landing/landing.component.ts @@ -1,5 +1,6 @@ -import {Component} from '@angular/core'; +import {Component, inject} from '@angular/core'; import {MediaMatcher} from '@angular/cdk/layout'; +import {TranslocoService} from '@ngneat/transloco'; @Component({ selector: 'app-landing', @@ -13,4 +14,16 @@ export class LandingComponent { constructor(private mediaMatcher: MediaMatcher) { this.isMobile = this.mediaMatcher.matchMedia('(max-width: 768px)'); } + + // TODO: remove this when i18n is supported + private transloco = inject(TranslocoService); + lastActiveLang = this.transloco.getActiveLang(); + + ionViewWillEnter() { + this.transloco.setActiveLang('en'); + } + + ionViewWillLeave() { + this.transloco.setActiveLang(this.lastActiveLang); + } }