feat: WIP: Initial setup for i18next

This commit is contained in:
Ased Mammad 2024-03-01 08:10:36 +03:30
parent 9b86e0bb41
commit fab89a76b1
17 changed files with 180 additions and 25 deletions

View file

@ -1,7 +1,9 @@
<script lang="ts">
import { WEBUI_BASE_URL } from '$lib/constants';
import { user } from '$lib/stores';
import { onMount } from 'svelte';
import { onMount, getContext } from 'svelte';
const i18n = getContext('i18n');
export let models = [];
export let modelfiles = [];
@ -64,9 +66,9 @@
</div>
{/if}
{:else}
<div class=" line-clamp-1">Hello, {$user.name}</div>
<div class=" line-clamp-1">{$i18n.t('Hello', { name: $user.name })}</div>
<div>How can I help you today?</div>
<div>{$i18n.t('GreetingPlaceholder')}</div>
{/if}
</div>
</div>