Skip to content

Commit

Permalink
Fixed a bug on dashboard with languagePath
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Jul 27, 2023
1 parent e7d902c commit d1e3743
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions UI/Web/src/httpLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Translation>(`assets/langs/${lang}.json`);
getTranslation(langPath: string) {
console.log('loading language: ', langPath);
const tokens = langPath.split('/');
console.log('\ttokens: ', tokens);
return this.http.get<Translation>(`assets/langs/${tokens[tokens.length - 1]}.json`);
// return this.accountService.currentUser$.pipe(
// distinctUntilChanged(),
// switchMap(user => {
Expand Down

0 comments on commit d1e3743

Please sign in to comment.