From 25e05f9855f782d07fa65bc3fde59fcaf767cf13 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Sat, 4 Jan 2025 12:48:58 +0100 Subject: [PATCH] fix home link for english --- website/src/lib/utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/src/lib/utils.ts b/website/src/lib/utils.ts index 22d9707d..a7c1d1e8 100644 --- a/website/src/lib/utils.ts +++ b/website/src/lib/utils.ts @@ -189,9 +189,6 @@ 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)) { @@ -205,6 +202,10 @@ export function getURLForLanguage(lang: string | null | undefined, path: string) } } + if (newPath === '/' && lang !== 'en') { + newPath = ''; + } + if (languageInPath === 'en') { if (lang === 'en') { return `${base}${newPath}`;