Anvil/src/routes/+layout.ts

13 lines
309 B
TypeScript
Raw Normal View History

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();
};