diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 2108c89ca..1ed6a4643 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -33,10 +33,13 @@ export const handleError = Sentry.handleErrorWithSentry(); /** @type {import('@sveltejs/kit').Handle} */ async function language({ event, resolve }) { const lang = - event.request.headers.get("accept-language")?.split(",")[0] ?? "en-US"; + event.request.headers.get("accept-language")?.split(",")[0] ?? "en"; - if (lang) { - locale.set(lang); + // use en.json for en-US and such + const [language, ...tags] = lang.split("-"); + + if (language) { + locale.set(language); } return resolve(event, { diff --git a/src/lib/components/documents/Access.svelte b/src/lib/components/documents/Access.svelte index a07c21644..a8c106197 100644 --- a/src/lib/components/documents/Access.svelte +++ b/src/lib/components/documents/Access.svelte @@ -30,7 +30,7 @@