aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/+layout.ts
blob: 0509aafdc1e91de422aec657154f8bb54094f431 (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};
};