From cfbbe9593e7607e9fdbd490415da41dbcbb2a0cb Mon Sep 17 00:00:00 2001 From: jawanbdarni Date: Mon, 9 Dec 2024 14:38:07 +0200 Subject: [PATCH] URM-235599 NACSIS-ILL: The Cloud App's language changes to English without user action --- cloudapp/src/app/footer/footer.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudapp/src/app/footer/footer.component.ts b/cloudapp/src/app/footer/footer.component.ts index ec20d67..7e2c5b6 100644 --- a/cloudapp/src/app/footer/footer.component.ts +++ b/cloudapp/src/app/footer/footer.component.ts @@ -13,14 +13,14 @@ export class FooterComponent implements OnInit { ) { } ngOnInit() { - this.translate.use('jp'); const savedLang = localStorage.getItem('currentLang') || 'jp'; - this.translate.use(savedLang); - + this.translate.use(savedLang); + if (!localStorage.getItem('currentLang')) { - localStorage.setItem('currentLang', 'jp'); + localStorage.setItem('currentLang', 'jp'); } } + setLang(lang: string) { this.translate.use(lang);