diff --git a/src/pages/settings/translations/analyseLangs.ts b/src/pages/settings/translations/analyseLangs.ts index 8167082..d627210 100644 --- a/src/pages/settings/translations/analyseLangs.ts +++ b/src/pages/settings/translations/analyseLangs.ts @@ -16,9 +16,13 @@ missingKeys?: { k: string; v: string }[]; } +// Replaced by webpack DefinePlugin and git-revision-webpack-plugin +declare const __GIT_VERSION__: string; +const gitVersion: string = __GIT_VERSION__; + const IGNORE_KEYS = /_(?:plural|interval|male|female|\d+)$/; export async function getLanguage([code, language]: [string, Language]): Promise { - const res = await fetch(`/locales/${code}.json`); + const res = await fetch(`/locales/${code}.json?v=${encodeURIComponent(gitVersion)}`); if (!res.ok) throw new Error(res.statusText); // Translations now use JSON5 to allow for comments, newlines, and basic