aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit/src/routes/+layout.svelte
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-09-20 10:23:51 +0200
committerivarlovlie <git@ivarlovlie.no>2022-09-20 10:23:51 +0200
commit9a09b5d7448b32af7bc9f7972d1ef61c631ef436 (patch)
treeb7f4f44fc98331fd141e7320ae4839f69dc36e7f /apps/kit/src/routes/+layout.svelte
parenta9072370ca1eb9a5cce928b1d487db0f307edea6 (diff)
downloadgreatoffice-9a09b5d7448b32af7bc9f7972d1ef61c631ef436.tar.xz
greatoffice-9a09b5d7448b32af7bc9f7972d1ef61c631ef436.zip
feat: Loading locales now work, needs a bit of a polish
Diffstat (limited to 'apps/kit/src/routes/+layout.svelte')
-rw-r--r--apps/kit/src/routes/+layout.svelte7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/kit/src/routes/+layout.svelte b/apps/kit/src/routes/+layout.svelte
index ee76da9..688673b 100644
--- a/apps/kit/src/routes/+layout.svelte
+++ b/apps/kit/src/routes/+layout.svelte
@@ -3,6 +3,12 @@
import {afterNavigate, beforeNavigate, goto} from "$app/navigation";
import {is_active} from "$lib/session";
import type {Navigation} from "@sveltejs/kit";
+ import {setLocale} from "$lib/i18n/i18n-svelte";
+ import {onMount} from "svelte";
+ import type {LayoutData} from "./$types";
+
+ export let data: LayoutData;
+ onMount(() => setLocale(data.locale));
async function redirect_if_necessary(ticket: Navigation) {
const sessionIsValid = await is_active();
@@ -20,4 +26,5 @@
afterNavigate(redirect_if_necessary);
beforeNavigate(redirect_if_necessary);
</script>
+
<slot></slot> \ No newline at end of file