Initial work on i18n (I'm lazy)

Signed-off-by: Alex J <odyssey346@disroot.org>
This commit is contained in:
Alex J
2022-06-21 20:09:59 +02:00
parent f721504b66
commit f980b9d0a7
12 changed files with 169 additions and 46 deletions

View File

@@ -4,6 +4,22 @@
import Footer from "$lib/Footer.svelte";
</script>
<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>
<Nav />
<main>
<slot />

View File

@@ -1,21 +1,18 @@
---
title: Donate to Project Segfault
description: Our donation methods
---
<script lang="ts">
import MoneroQR from "$lib/images/Monero.png";
import { t } from '$lib/translations';
</script>
# {title}
<h1>{$t('common.DONATETITLE')}</h1>
## {description}
<h2>{$t('common.DONATEDESCRIPTION')}</h2>
# please do
<h1>{$t('common.DONATEPLEASEDO')}</h1>
If you donate, we will be more motivated to work on the server and host more stuff and maybe even get more hardware. I really recommend you donate any spare money you have if you enjoy or use our services on a daily basis.
<p>{$t('common.DONATEEXPLANATION')}</p>
# yeah sure I'll donate. links?
<h1>{$t('common.DONATEOKSURE')}</h1>
<div class="monero">
<span>Monero: <code>47L7Qsto7XcifY3CdG18ySe5Tt83kpFLDLve9jQwbc9taPBLNGv6ZrJNUKpMG9Nj9zHgCZ4FQMSyt75e8Jvx12JFLtJyFdA</code></span>

View File

@@ -1,16 +0,0 @@
---
title: Project Segfault
description: 4 idiots, a Sun server and a Hitachi Compute Rack.
---
# {title}
## {description}
# what
We are 4 teenagers who have a decently powerful server. What do we do with this server? Host game servers and random assortment of privacy respecting tools like Invidious, Nextcloud, Matrix etc.... and maybe some original works. You'll see eventually!
# Tell me more! What do you guys host? Where can I contact you? Can you fix my daughter's iPad?
We can't fix your daughter's iPad, but there is a navigation bar at the top of the page with links to websites that explain things about us, or contain useful information about us.

15
src/routes/index.svelte Normal file
View File

@@ -0,0 +1,15 @@
<script>
import { t } from '$lib/translations';
</script>
<h1> {$t('common.INDEXTITLE')} </h1>
<h2> {$t('common.indexDescription')} </h2>
<h1> {$t('common.INDEXWHAT')} </h1> <!-- Cause I feel the need to scream -->
<p> {$t('common.INDEXWHOAREWE')} </p>
<h1> {$t('common.INDEXTELLMEMORE')} </h1>
<p>{$t('common.INDEXMOREINFO')}</p>