aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/+layout.js
blob: add74f87285d30f2ead901c7f63e5be79f14473f (plain) (blame)
1
2
3
4
5
6
7
8
import { loadTranslations, locale } from '$lib/translations';
export const load = async ({ url }) => {
	const { pathname } = url;
	const defaultLocale = 'en'; // get from cookie, user session, ...
	const initLocale = locale.get() || defaultLocale; // set default if no locale already set
	await loadTranslations(initLocale, pathname); // keep this just before the `return`
	return {};
};