13 lines
309 B
TypeScript
13 lines
309 B
TypeScript
|
import { browser } from '$app/environment';
|
||
|
import '$lib/i18n'; // Initialize i18n
|
||
|
import { locale, waitLocale } from 'svelte-i18n';
|
||
|
import type { LayoutLoad } from './$types';
|
||
|
|
||
|
export const load: LayoutLoad = async () => {
|
||
|
if (browser) {
|
||
|
locale.set(window.navigator.language);
|
||
|
}
|
||
|
|
||
|
await waitLocale();
|
||
|
};
|