implemented storing of user's language as well as loading

This commit is contained in:
2025-09-22 17:42:20 +02:00
parent 60c9a956aa
commit f916a2c5ae
2 changed files with 26 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
<script>
import { onMount } from 'svelte';
import { Router, Route } from 'svelte-tiny-router';
import { loadTranslation } from './translations.svelte.js';
@@ -39,10 +38,11 @@
let translations_ready = $state(false);
onMount(async () => {
await loadTranslation('de','Login');
async function load(){
loadTheme(user.theme);
await loadTranslation(user.language?user.language:'de');
translations_ready = true;
});
}
function loadTheme(name){
if (!name) return;
@@ -56,7 +56,7 @@
next();
}
$effect(() => loadTheme(user.theme));
$effect(load);
</script>
{#if translations_ready }