-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,507 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// https://kit.svelte.dev/docs/hooks#server-hooks | ||
import { locale } from "svelte-i18n"; | ||
|
||
/** @type {import('@sveltejs/kit').Handle} */ | ||
export async function handle({ event, resolve }) { | ||
const lang = event.request.headers.get("accept-language")?.split(",")[0]; | ||
if (lang) { | ||
locale.set(lang); | ||
} | ||
return resolve(event); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { browser } from "$app/environment"; | ||
import { init, register } from "svelte-i18n"; | ||
import { LANGUAGES } from "@/config/config.js"; | ||
|
||
const defaultLocale = "en"; | ||
|
||
LANGUAGES.forEach(([name, code, flag]) => { | ||
register(code, () => import(`../../langs/json/${code}.json`)); | ||
}); | ||
|
||
init({ | ||
fallbackLocale: defaultLocale, | ||
initialLocale: browser ? window.navigator.language : defaultLocale, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { locale, waitLocale } from "svelte-i18n"; | ||
import { browser } from "$app/environment"; | ||
import "$lib/i18n/index.js"; // Import to initialize. Important :) | ||
|
||
/** @type {import('./$types').LayoutLoad} */ | ||
export async function load() { | ||
if (browser) { | ||
locale.set(window.navigator.language); | ||
} | ||
await waitLocale(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script> | ||
// todo: find a better long-term home for styles | ||
import "../style/variables.css"; | ||
import "../style/global.css"; | ||
</script> | ||
|
||
<slot /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// load homepage data | ||
|
||
/** @type {import('./$types').PageLoad} */ | ||
export async function load({ params }) {} |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* source-sans-pro-regular - latin */ | ||
@font-face { | ||
font-family: "Source Sans Pro"; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url("/fonts/source-sans-pro-v21-latin-regular.eot"); /* IE9 Compat Modes */ | ||
src: local(""), | ||
url("/fonts/source-sans-pro-v21-latin-regular.eot?#iefix") | ||
format("embedded-opentype"), | ||
/* IE6-IE8 */ url("/fonts/source-sans-pro-v21-latin-regular.woff2") | ||
format("woff2"), | ||
/* Super Modern Browsers */ | ||
url("/fonts/source-sans-pro-v21-latin-regular.woff") format("woff"), | ||
/* Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-regular.ttf") | ||
format("truetype"), | ||
/* Safari, Android, iOS */ | ||
url("/fonts/source-sans-pro-v21-latin-regular.svg#SourceSansPro") | ||
format("svg"); /* Legacy iOS */ | ||
} | ||
|
||
/* source-sans-pro-italic - latin */ | ||
@font-face { | ||
font-family: "Source Sans Pro"; | ||
font-style: italic; | ||
font-weight: 400; | ||
src: url("/fonts/source-sans-pro-v21-latin-italic.eot"); /* IE9 Compat Modes */ | ||
src: local(""), | ||
url("/fonts/source-sans-pro-v21-latin-italic.eot?#iefix") | ||
format("embedded-opentype"), | ||
/* IE6-IE8 */ url("/fonts/source-sans-pro-v21-latin-italic.woff2") | ||
format("woff2"), | ||
/* Super Modern Browsers */ | ||
url("/fonts/source-sans-pro-v21-latin-italic.woff") format("woff"), | ||
/* Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-italic.ttf") | ||
format("truetype"), | ||
/* Safari, Android, iOS */ | ||
url("/fonts/source-sans-pro-v21-latin-italic.svg#SourceSansPro") | ||
format("svg"); /* Legacy iOS */ | ||
} | ||
|
||
/* source-sans-pro-600 - latin */ | ||
@font-face { | ||
font-family: "Source Sans Pro"; | ||
font-style: normal; | ||
font-weight: 600; | ||
src: url("/fonts/source-sans-pro-v21-latin-600.eot"); /* IE9 Compat Modes */ | ||
src: local(""), | ||
url("/fonts/source-sans-pro-v21-latin-600.eot?#iefix") | ||
format("embedded-opentype"), | ||
/* IE6-IE8 */ url("/fonts/source-sans-pro-v21-latin-600.woff2") | ||
format("woff2"), | ||
/* Super Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-600.woff") | ||
format("woff"), | ||
/* Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-600.ttf") | ||
format("truetype"), | ||
/* Safari, Android, iOS */ | ||
url("/fonts/source-sans-pro-v21-latin-600.svg#SourceSansPro") | ||
format("svg"); /* Legacy iOS */ | ||
} | ||
|
||
/* source-sans-pro-700 - latin */ | ||
@font-face { | ||
font-family: "Source Sans Pro"; | ||
font-style: normal; | ||
font-weight: 700; | ||
src: url("/fonts/source-sans-pro-v21-latin-700.eot"); /* IE9 Compat Modes */ | ||
src: local(""), | ||
url("/fonts/source-sans-pro-v21-latin-700.eot?#iefix") | ||
format("embedded-opentype"), | ||
/* IE6-IE8 */ url("/fonts/source-sans-pro-v21-latin-700.woff2") | ||
format("woff2"), | ||
/* Super Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-700.woff") | ||
format("woff"), | ||
/* Modern Browsers */ url("/fonts/source-sans-pro-v21-latin-700.ttf") | ||
format("truetype"), | ||
/* Safari, Android, iOS */ | ||
url("/fonts/source-sans-pro-v21-latin-700.svg#SourceSansPro") | ||
format("svg"); /* Legacy iOS */ | ||
} |
Binary file not shown.
Oops, something went wrong.