aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/+layout.ts
blob: 3893260ff25bdff19f4d848389c017769ed95934 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import type { LayoutLoad } from "./$types";
import type { Locales } from "$i18n/i18n-types";
import { loadLocaleAsync } from "$i18n/i18n-util.async";
import { setLocale } from "$i18n/i18n-svelte";

export const load: LayoutLoad<{ locale: Locales }> = async ({ data: { locale } }) => {
    await loadLocaleAsync(locale);
    setLocale(locale);
    return { locale };
};