mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 05:09:57 +00:00
23 lines
551 B
TypeScript
23 lines
551 B
TypeScript
export const prerender = true;
|
|
export const ssr = false;
|
|
|
|
import { browser } from '$app/environment';
|
|
|
|
import { get } from 'svelte/store';
|
|
import type { Load } from '@sveltejs/kit';
|
|
|
|
import { loadTranslations, defaultLocale } from '$lib/i18n/translations';
|
|
|
|
export const load: Load = async ({ url }) => {
|
|
const { pathname } = url;
|
|
|
|
let preferredLocale = defaultLocale;
|
|
|
|
if (browser) {
|
|
preferredLocale = get((await import('$lib/i18n/locale')).default);
|
|
}
|
|
|
|
await loadTranslations(preferredLocale, pathname);
|
|
return {};
|
|
}
|