webui/src/routes/+layout.ts
2023-11-17 13:12:22 +01:00

20 lines
No EOL
551 B
TypeScript

import "$lib/style/app.scss";
import { browser } from '$app/environment'
import '$lib/i18n' // Import to initialize. Important :)
import { locale, waitLocale } from 'svelte-i18n'
import type { LayoutLoad } from './$types'
export const load: LayoutLoad = async () => {
if (browser && localStorage.getItem('locale')) {
locale.set(localStorage.getItem('locale'));
} else if (browser) {
locale.set(window.navigator.language)
}
await waitLocale();
}
export const prerender = true;
export const ssr = false;
export const csr = true;