remove svelte-i18n dependency, replace with minimalistic implementation

This commit is contained in:
vcoppe
2025-06-08 13:49:39 +02:00
parent a9ea0e223d
commit 228ad1044e
59 changed files with 121 additions and 746 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import '../app.pcss';
import { ModeWatcher } from 'mode-watcher';
import { isLoading, _, locale } from 'svelte-i18n';
import { _, locale, isLoadingInitialLocale, isLoadingLocale } from '$lib/i18n';
import { page } from '$app/stores';
import Nav from '$lib/components/Nav.svelte';
import Footer from '$lib/components/Footer.svelte';
@@ -44,7 +44,7 @@
}
}
$: if (browser && !$isLoading && $locale) {
$: if (browser && !$isLoadingLocale && $locale) {
let title = `gpx.studio — ${$_(`metadata.${$page.route.id?.replace('/[[language]]', '').split('/')[1] ?? 'home'}_title`)}`;
if ($page.params.guide) {
document.title = `${title} | ${data.guideTitles[$page.params.guide]}`;
@@ -58,7 +58,7 @@
<ModeWatcher />
<div class="flex flex-col min-h-screen">
{#if !$isLoading}
{#if !$isLoadingInitialLocale}
{#if showNavAndFooter}
<Nav />
{/if}