2022-06-21 23:39:59 +05:30
|
|
|
<script context="module">
|
2022-06-22 12:27:47 +05:30
|
|
|
import { locale, loadTranslations } from "$lib/translations";
|
2022-06-21 23:39:59 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
export const load = async ({ url }) => {
|
|
|
|
const { pathname } = url;
|
2022-06-21 23:39:59 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
const defaultLocale = "en"; // get from cookie, user session, ...
|
2022-06-21 23:39:59 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
const initLocale = locale.get() || defaultLocale; // set default if no locale already set
|
2022-06-21 23:39:59 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
await loadTranslations(initLocale, pathname); // keep this just before the `return`
|
2022-06-21 23:39:59 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
// firefox
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
|
|
|
|
// chrome
|
|
|
|
// https://developer.chrome.com/extensions/i18n#overview-getAcceptLanguages
|
|
|
|
// edge
|
|
|
|
// https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
|
2022-06-22 04:31:35 +05:30
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
return {};
|
|
|
|
};
|
2022-06-21 23:39:59 +05:30
|
|
|
</script>
|
|
|
|
|
2022-06-22 12:27:47 +05:30
|
|
|
<script>
|
|
|
|
import "$lib/app.css";
|
|
|
|
import Nav from "$lib/Nav.svelte";
|
|
|
|
import Footer from "$lib/Footer.svelte";
|
|
|
|
import SvelteSeo from "svelte-seo";
|
|
|
|
import Banner from "$lib/images/ProjectSegfault_Desktop_16-9.png";
|
|
|
|
import * as global from "../i18n/_global.json";
|
|
|
|
import { t } from "$lib/translations";
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<SvelteSeo
|
|
|
|
openGraph={{
|
|
|
|
title: global.NAME,
|
|
|
|
description: $t("common.INDEX_DESCRIPTION"),
|
|
|
|
type: "website",
|
|
|
|
images: [
|
|
|
|
{
|
|
|
|
url: Banner,
|
|
|
|
width: 850,
|
|
|
|
height: 650,
|
|
|
|
alt: "Image"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
|
2022-06-18 00:22:07 +05:30
|
|
|
<Nav />
|
2022-06-22 12:27:47 +05:30
|
|
|
|
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-22 12:27:47 +05:30
|
|
|
|
2022-06-18 21:56:58 +05:30
|
|
|
<Footer />
|