We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 55e7210 commit 974b6b6Copy full SHA for 974b6b6
src/routes/+layout.svelte
@@ -1,4 +1,5 @@
1
<script lang="ts">
2
+ import { lang } from '../stores.js';
3
import Meta from '$lib/Meta.svelte';
4
import Header from '$lib/Header.svelte';
5
import Footer from '$lib/Footer.svelte';
@@ -8,6 +9,15 @@
8
9
}
10
11
let { children }: Props = $props();
12
+
13
+ if (typeof window !== 'undefined') {
14
+ const url = new URL(window.location.href);
15
+ const url_lang = url.searchParams.get('lang');
16
+ if (url_lang) {
17
+ console.log('setting language to', url_lang, 'due to lang url param');
18
+ lang.set(url_lang);
19
+ }
20
21
</script>
22
23
<Meta title="" />
0 commit comments