From df71664f20312e81134ee90ad561f55d3020ee0a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 30 Aug 2024 20:04:29 -0700 Subject: typescript --- src/routes/+layout.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/routes/+layout.ts (limited to 'src/routes/+layout.ts') diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts new file mode 100644 index 00000000..7b5d4f44 --- /dev/null +++ b/src/routes/+layout.ts @@ -0,0 +1,14 @@ +import { addTranslations, setLocale, setRoute } from "$lib/translations"; + +/** @type {import('@sveltejs/kit').Load} */ +export const load = async ({ data }) => { + const { i18n, translations } = data; + const { locale, route } = i18n; + + addTranslations(translations); + + await setRoute(route); + await setLocale(locale); + + return i18n; +}; -- cgit v1.2.3