webui/src/routes/+layout.ts

20 lines
551 B
TypeScript
Raw Normal View History

2023-11-17 00:05:35 +00:00
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 () => {
2023-11-17 12:12:22 +00:00
if (browser && localStorage.getItem('locale')) {
locale.set(localStorage.getItem('locale'));
} else if (browser) {
2023-11-17 00:05:35 +00:00
locale.set(window.navigator.language)
}
2023-11-17 12:12:22 +00:00
await waitLocale();
2023-11-17 00:05:35 +00:00
}
2023-11-17 10:09:06 +00:00
export const prerender = true;
export const ssr = false;
export const csr = true;