mirror of
https://github.com/ProjectSegfault/website.git
synced 2025-05-31 14:12:04 +05:30
Initial work on i18n (I'm lazy)
Signed-off-by: Alex J <odyssey346@disroot.org>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import * as strings from "$lib/strings";
|
||||
import { t } from '$lib/translations';
|
||||
</script>
|
||||
|
||||
<nav>
|
||||
@@ -15,12 +16,12 @@
|
||||
</a>
|
||||
|
||||
<div class="links">
|
||||
<a href="https://instances.projectsegfau.lt/">{strings.INSTANCES}</a>
|
||||
<a href="/minecraft">{strings.MINECRAFT}</a>
|
||||
<a href="/donate">{strings.DONATE}</a>
|
||||
<a href="/faq">{strings.FAQ}</a>
|
||||
<a href="/contact">{strings.CONTACT}</a>
|
||||
<a href="https://blog.projectsegfau.lt/">{strings.BLOG}</a>
|
||||
<a href="https://instances.projectsegfau.lt/">{$t('common.navbarInstances')}</a>
|
||||
<a href="/minecraft">{$t('common.navbarMinecraft')}</a>
|
||||
<a href="/donate">{$t('common.navbarDonate')}</a>
|
||||
<a href="/faq">{$t('common.FAQ')}</a>
|
||||
<a href="/contact">{$t('common.navbarContact')}</a>
|
||||
<a href="https://blog.projectsegfau.lt/">{$t('common.Blog')}</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
"NAME": "Project Segfault",
|
||||
"PROJECT": "Project",
|
||||
"SEGFAULT": "Segfault",
|
||||
"INSTANCES": "Instances & Gameservers",
|
||||
"MINECRAFT": "Minecraft",
|
||||
"DONATE": "Donate",
|
||||
"FAQ": "FAQ",
|
||||
"CONTACT": "Contact",
|
||||
"BLOG": "Blog",
|
||||
"SEO_BANNER_URL": "https://projectsegfau.lt:8448/_matrix/media/r0/download/projectsegfau.lt/HBgjhWUExhKPzbpkpIqQfUkF",
|
||||
"COPYRIGHT": "© 2021 - present, Project Segfault",
|
||||
"MATRIX_INVITE": "https://matrix.to/#/#project-segfault:projectsegfau.lt",
|
||||
|
||||
23
src/lib/translations.js
Normal file
23
src/lib/translations.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import i18n from 'sveltekit-i18n';
|
||||
|
||||
/** @type {import('sveltekit-i18n').Config} */
|
||||
const config = ({
|
||||
loaders: [
|
||||
{
|
||||
locale: 'en',
|
||||
key: 'common',
|
||||
loader: async () => (
|
||||
await import('../i18n/common.json')
|
||||
).default,
|
||||
},
|
||||
{
|
||||
locale: 'nb',
|
||||
key: 'common',
|
||||
loader: async () => (
|
||||
await import('../i18n/nb.json')
|
||||
).default,
|
||||
}
|
||||
],
|
||||
});
|
||||
|
||||
export const { t, locale, locales, loading, loadTranslations } = new i18n(config);
|
||||
Reference in New Issue
Block a user