Nightly Issues (#2618)
This commit is contained in:
parent
0ff6d4a6fc
commit
d145dca0e7
28 changed files with 138 additions and 100 deletions
|
|
@ -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]}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue