add: added Playground + AddFilesPlaceholder translation

This commit is contained in:
Jannik Streidl 2024-03-05 11:44:37 +01:00
parent b9f53abf37
commit 7f9049c3a1
11 changed files with 73 additions and 25 deletions

View file

@ -1,8 +1,13 @@
<script>
import { getContext } from 'svelte';
const i18n = getContext('i18n');
</script>
<div class=" text-center text-6xl mb-3">📄</div>
<div class="text-center dark:text-white text-2xl font-semibold z-50">Add Files</div>
<div class="text-center dark:text-white text-2xl font-semibold z-50">{$i18n.t('Add Files')}</div>
<slot
><div class=" mt-2 text-center text-sm dark:text-gray-200 w-full">
Drop any files here to add to the conversation
{$i18n.t('Drop any files here to add to the conversation')}
</div>
</slot>

View file

@ -628,7 +628,7 @@
/>
</svg>
</div>
<div class=" self-center font-medium">Playground</div>
<div class=" self-center font-medium">{$i18n.t('Playground')}</div>
</button>
{/if}

View file

@ -1,5 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import { onMount, getContext } from 'svelte';
const i18n = getContext('i18n');
export let messages = [];
@ -20,7 +22,7 @@
class="px-2 py-1 text-sm font-semibold uppercase min-w-[6rem] text-left dark:group-hover:bg-gray-800 rounded-lg transition"
on:click={() => {
message.role = message.role === 'user' ? 'assistant' : 'user';
}}>{message.role}</button
}}>{$i18n.t(message.role)}</button
>
</div>
@ -28,7 +30,9 @@
<textarea
id="{message.role}-{idx}-textarea"
class="w-full bg-transparent outline-none rounded-lg p-2 text-sm resize-none overflow-hidden"
placeholder="Enter {message.role === 'user' ? 'a user' : 'an assistant'} message here"
placeholder={$i18n.t(
`Enter ${message.role === 'user' ? 'a user' : 'an assistant'} message here`
)}
rows="1"
on:input={(e) => {
e.target.style.height = '';
@ -100,6 +104,6 @@
</svg>
</div>
<div class=" text-sm font-medium">Add message</div>
<div class=" text-sm font-medium">{$i18n.t('Add message')}</div>
</button>
</div>