From d1e3743e47438d8fc73061ad6cd135896958b065 Mon Sep 17 00:00:00 2001 From: Joseph Milazzo Date: Thu, 27 Jul 2023 17:35:07 -0500 Subject: [PATCH] Fixed a bug on dashboard with languagePath --- UI/Web/src/httpLoader.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/UI/Web/src/httpLoader.ts b/UI/Web/src/httpLoader.ts index a1dc25fb70..def663b086 100644 --- a/UI/Web/src/httpLoader.ts +++ b/UI/Web/src/httpLoader.ts @@ -10,9 +10,11 @@ import {catchError, distinctUntilChanged} from "rxjs/operators"; export class HttpLoader implements TranslocoLoader { constructor(private http: HttpClient, private accountService: AccountService) {} - getTranslation(lang: string) { - console.log('loading language: ', lang); - return this.http.get(`assets/langs/${lang}.json`); + getTranslation(langPath: string) { + console.log('loading language: ', langPath); + const tokens = langPath.split('/'); + console.log('\ttokens: ', tokens); + return this.http.get(`assets/langs/${tokens[tokens.length - 1]}.json`); // return this.accountService.currentUser$.pipe( // distinctUntilChanged(), // switchMap(user => {