Nightly Issues (#2618)

This commit is contained in:
Joe Milazzo 2024-01-18 08:35:54 -06:00 committed by GitHub
parent 0ff6d4a6fc
commit d145dca0e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 138 additions and 100 deletions

View file

@ -1,7 +1,7 @@
import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {Translation, TranslocoLoader} from "@ngneat/transloco";
import cacheBusting from 'i18n-cache-busting.json'; // allowSyntheticDefaultImports must be true
@Injectable({ providedIn: 'root' })
export class HttpLoader implements TranslocoLoader {
@ -9,6 +9,7 @@ export class HttpLoader implements TranslocoLoader {
getTranslation(langPath: string) {
const tokens = langPath.split('/');
return this.http.get<Translation>(`assets/langs/${tokens[tokens.length - 1]}.json`);
const langCode = tokens[tokens.length - 1];
return this.http.get<Translation>(`assets/langs/${langCode}.json?v=${(cacheBusting as { [key: string]: string })[langCode]}`);
}
}