Include policies, minor fixes and add anonymous analytics

This commit is contained in:
Starystars67 committed 2026-06-16 16:43:43 +01:00
1 parent 74adf15820
commit 01281ebed2
22 files changed
+571 -63

No files matched your search

+3 -3
View File
@@ -31,12 +31,12 @@ export function getLocalizedPath(route, locale = null) {
export function switchLocale(newLocale, currentPath) {
// Split path from query string
const [pathOnly] = currentPath.split('?')
// Remove locale from the beginning: /en/servers -> /servers, /en/ -> /
const pathWithoutLocale = pathOnly.replace(/^\/[a-z]{2}(?:\/|$)/, '/')
// Remove trailing slashes and ensure we have the right format
const cleanPath = pathWithoutLocale.replace(/\/+/g, '/').replace(/\/$/, '') || ''
return `/${newLocale}${cleanPath}`.replace(/\/+/g, '/')
}