Cachebust languages.json (#34705)

* Cachebust languages.json

To avoid loading stale language files. The individual language files as hashbusted but the metadata file is not, and it is not feasible to do so.

* Switch cachebust to use Date.now to further avoid collisions

* Fix tests

* Fix tests
This commit is contained in:
Michael Telatynski
2026-08-13 23:55:38 +00:00
committed by GitHub
parent bfd2d16fa6
commit ceaa3ff74e
5 changed files with 6 additions and 5 deletions
@@ -433,7 +433,8 @@ async function getLanguage(langPath: string): Promise<ICounterpartTranslation> {
}
export async function getLangsJson(): Promise<Languages> {
const url = i18nFolder + "languages.json";
const cachebust = Date.now();
const url = `${i18nFolder}languages.json?${cachebust}`;
const res = await fetch(url, { method: "GET" });
@@ -51,7 +51,7 @@ expect.addSnapshotSerializer({
function setupLanguageMock(): void {
fetchMock
.get("end:/i18n/languages.json", {
.get("include:/i18n/languages.json?", {
en: "en_EN.json",
})
.get("end:en_EN.json", en);