From 93d5211d278538b8d16e2154549c85fa9cb8b168 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Fri, 3 Jan 2025 18:23:48 +0100 Subject: [PATCH] fix home link for languages other than english --- website/src/lib/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts index 9ddfee9b..22d9707d 100644 --- a/website/src/lib/utils.ts +++ b/website/src/lib/utils.ts @@ -189,6 +189,10 @@ export function isSafari() { export function getURLForLanguage(lang: string | null | undefined, path: string): string { let newPath = path.replace(base, ''); + if (newPath === '/') { + newPath = ''; + } + let languageInPath = newPath.split('/')[1]; if (!languages.hasOwnProperty(languageInPath)) { languageInPath = 'en';