Consistency with the starter

This commit is contained in:
Joseph Garrone 2024-06-06 06:10:41 +02:00
parent 83a9778c30
commit dae1053ca8
4 changed files with 6 additions and 5 deletions

View File

@ -14,18 +14,19 @@ export default function KcApp(props: { kcContext: KcContext }) {
useDownloadTerms({ useDownloadTerms({
kcContext, kcContext,
downloadTermMarkdown: async ({ currentLanguageTag }) => { downloadTermMarkdown: async ({ currentLanguageTag }) => {
const resource = (() => { const termsFileName = (() => {
switch (currentLanguageTag) { switch (currentLanguageTag) {
case "fr": case "fr":
return "/tos/tos_fr.md"; return "fr.md";
case "es": case "es":
return "/tos/tos_es.md"; return "es.md";
default: default:
return "/tos/tos_en.md"; return "en.md";
} }
})(); })();
const response = await fetch(resource); const response = await fetch(`/terms/${termsFileName}`);
return response.text(); return response.text();
} }
}); });