fix(matrix): wait for i18n to load before rendering

Prevents "Cannot format a message without first setting the initial locale"
error by showing a loading state until svelte-i18n is ready.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-29 16:02:26 +01:00
parent 8804ab77a2
commit 7442b09471

View file

@ -25,13 +25,20 @@
</script>
<svelte:head>
<title>{$t('app.name')}</title>
<title>{$i18nLoading ? 'Matrix Chat' : $t('app.name')}</title>
<meta name="description" content="Self-hosted Matrix chat client" />
</svelte:head>
<div class="min-h-screen bg-background text-foreground">
{@render children()}
</div>
{#if $i18nLoading}
<!-- Loading state while i18n initializes -->
<div class="min-h-screen bg-background flex items-center justify-center">
<div class="animate-pulse text-muted-foreground">Laden...</div>
</div>
{:else}
<div class="min-h-screen bg-background text-foreground">
{@render children()}
</div>
<!-- Global Toast notifications -->
<ToastContainer />
<!-- Global Toast notifications -->
<ToastContainer />
{/if}