mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
use base in URLs
This commit is contained in:
@@ -1,17 +1,3 @@
|
||||
export const languages: Record<string, string> = {
|
||||
'en': 'English',
|
||||
};
|
||||
|
||||
export function getURLForLanguage(route: string | null, lang: string | null | undefined): string {
|
||||
if (route === null) {
|
||||
return '/';
|
||||
}
|
||||
|
||||
let url = route.replace('[...language]', (lang === null || lang === undefined) ? 'en' : lang).replace('/en', '');
|
||||
|
||||
if (url === '') {
|
||||
return '/';
|
||||
} else {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user