2022-06-18 00:22:07 +05:30
|
|
|
<script>
|
2022-06-18 21:56:58 +05:30
|
|
|
import "$lib/app.css";
|
|
|
|
import Nav from "$lib/Nav.svelte";
|
|
|
|
import Footer from "$lib/Footer.svelte";
|
2022-02-28 23:42:33 +05:30
|
|
|
</script>
|
|
|
|
|
2022-06-21 23:39:59 +05:30
|
|
|
<script context="module">
|
|
|
|
import { locale, loadTranslations } from '$lib/translations';
|
|
|
|
|
|
|
|
export const load = async ({ url }) => {
|
|
|
|
const { pathname } = url;
|
|
|
|
|
|
|
|
const defaultLocale = 'en'; // get from cookie, user session, ...
|
|
|
|
|
|
|
|
const initLocale = locale.get() || defaultLocale; // set default if no locale already set
|
|
|
|
|
|
|
|
await loadTranslations(initLocale, pathname); // keep this just before the `return`
|
|
|
|
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-06-18 00:22:07 +05:30
|
|
|
<Nav />
|
2022-02-28 23:42:33 +05:30
|
|
|
<main>
|
2022-06-18 21:56:58 +05:30
|
|
|
<slot />
|
2022-06-18 00:22:07 +05:30
|
|
|
</main>
|
2022-06-18 21:56:58 +05:30
|
|
|
<Footer />
|