From 5fcc189410a22e83bfaacbeb5fdc34e5c1910473 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 25 Apr 2024 15:00:03 -0700 Subject: layout file --- src/routes/+layout.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/routes/+layout.js (limited to 'src') diff --git a/src/routes/+layout.js b/src/routes/+layout.js new file mode 100644 index 00000000..7b5d4f44 --- /dev/null +++ b/src/routes/+layout.js @@ -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