fix some URLs

This commit is contained in:
vcoppe committed 2024-08-16 12:51:55 +02:00
1 parent fa30739fd0
commit 49582dcddd
3 files changed
+13 -7

No files matched your search

+2 -2
View File
@@ -122,8 +122,8 @@ export function setScissorsCursor() {
setCursor(scissorsCursor);
}
export function getURLForLanguage(lang: string | null | undefined, path?: string): string {
let newPath = path ?? (browser ? window.location.pathname.replace(base, '') : '');
export function getURLForLanguage(lang: string | null | undefined, path: string): string {
let newPath = path.replace(base, '');
let languageInPath = newPath.split('/')[1];
if (!languages.hasOwnProperty(languageInPath)) {
languageInPath = 'en';