Added some i18n keys & updated german locale

This commit is contained in:
Jannik Streidl
2024-04-30 10:46:16 +02:00
parent c9589e2118
commit 142f82bae5
35 changed files with 2448 additions and 344 deletions

View File

@@ -57,7 +57,7 @@
{#if selectedModelIdx === 0}
<div class=" self-center mr-2 disabled:text-gray-600 disabled:hover:text-gray-600">
<Tooltip content="Add Model">
<Tooltip content={$i18n.t('Add Model')}>
<button
class=" "
{disabled}
@@ -80,7 +80,7 @@
</div>
{:else}
<div class=" self-center disabled:text-gray-600 disabled:hover:text-gray-600 mr-2">
<Tooltip content="Remove Model">
<Tooltip content={$i18n.t('Remove Model')}>
<button
{disabled}
on:click={() => {

View File

@@ -21,7 +21,7 @@
export let value = '';
export let placeholder = 'Select a model';
export let searchEnabled = true;
export let searchPlaceholder = 'Search a model';
export let searchPlaceholder = $i18n.t(`Search a model`);
export let items = [{ value: 'mango', label: 'Mango' }];
@@ -291,7 +291,7 @@
{:else}
<div>
<div class="block px-3 py-2 text-sm text-gray-700 dark:text-gray-100">
No results found
{$i18n.t('No results found')}
</div>
</div>
{/each}
@@ -303,7 +303,8 @@
pullModelHandler();
}}
>
Pull "{searchValue}" from Ollama.com
{$i18n.t(`Pull "{{searchValue}}" from Ollama.com`, { searchValue: searchValue })}
</button>
{/if}

View File

@@ -447,7 +447,7 @@
{/if}
</button>
<Tooltip content="Create new key">
<Tooltip content={$i18n.t('Create new key')}>
<button
class=" px-1.5 py-1 dark:hover:bg-gray-850transition rounded-lg"
on:click={() => {
@@ -479,7 +479,7 @@
>
<Plus strokeWidth="2" className=" size-3.5" />
Create new secret key</button
{$i18n.t('Create new secret key')}</button
>
{/if}
</div>

View File

@@ -164,7 +164,7 @@
<div class="flex gap-1.5">
<input
class="w-full rounded-lg py-2 px-4 text-sm dark:text-gray-300 dark:bg-gray-850 outline-none"
placeholder="Enter URL (e.g. http://localhost:11434)"
placeholder={$i18n.t('Enter URL (e.g. http://localhost:11434)')}
bind:value={url}
/>

View File

@@ -98,9 +98,9 @@
<div class=" text-sm dark:text-gray-300 mb-1">
{#if chat.share_id}
<a href="/s/{chat.share_id}" target="_blank"
>You have shared this chat <span class=" underline">before</span>.</a
>{$i18n.t("You have shared this chat")} <span class=" underline">{$i18n.t("before")}</span>.</a
>
Click here to
{$i18n.t("Click here to")}
<button
class="underline"
on:click={async () => {
@@ -109,11 +109,10 @@
if (res) {
chat = await getChatById(localStorage.token, chatId);
}
}}>delete this link</button
> and create a new shared link.
}}>{$i18n.t("delete this link")} </button
> {$i18n.t("and create a new shared link.")}
{:else}
Messages you send after creating your link won't be shared. Users with the URL will be
able to view the shared chat.
{$i18n.t("Messages you send after creating your link won't be shared. Users with the URL will beable to view the shared chat.")}
{/if}
</div>

View File

@@ -42,7 +42,7 @@
<div class="flex self-center w-[1px] h-5 mx-2 bg-gray-300 dark:bg-stone-700" />
{#if !shareEnabled}
<Tooltip content="Settings">
<Tooltip content={$i18n.t('Settings')}>
<button
class="cursor-pointer p-1.5 flex dark:hover:bg-gray-700 rounded-full transition"
id="open-settings-button"
@@ -104,7 +104,7 @@
</button>
</Menu>
{/if}
<Tooltip content="New Chat">
<Tooltip content={$i18n.t('New Chat')}>
<button
id="new-chat-button"
class=" cursor-pointer p-1.5 flex dark:hover:bg-gray-700 rounded-full transition"

View File

@@ -1,5 +1,6 @@
<script lang="ts">
import { DropdownMenu } from 'bits-ui';
import { getContext } from 'svelte';
import fileSaver from 'file-saver';
const { saveAs } = fileSaver;
@@ -12,6 +13,8 @@
import { downloadChatAsPDF } from '$lib/apis/utils';
const i18n = getContext('i18n');
export let shareEnabled: boolean = false;
export let shareHandler: Function;
export let downloadHandler: Function;
@@ -104,7 +107,7 @@
d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
/>
</svg>
<div class="flex items-center">Settings</div>
<div class="flex items-center">{$i18n.t('Settings')}</div>
</DropdownMenu.Item>
{#if shareEnabled}
@@ -126,7 +129,7 @@
clip-rule="evenodd"
/>
</svg>
<div class="flex items-center">Share</div>
<div class="flex items-center">{$i18n.t('Share')}</div>
</DropdownMenu.Item>
<!-- <DropdownMenu.Item
@@ -154,7 +157,7 @@
/>
</svg>
<div class="flex items-center">Download</div>
<div class="flex items-center">{$i18n.t('Download')}</div>
</DropdownMenu.SubTrigger>
<DropdownMenu.SubContent
class="w-full rounded-lg px-1 py-1.5 border border-gray-300/30 dark:border-gray-700/50 z-50 bg-white dark:bg-gray-900 dark:text-white shadow-lg"
@@ -167,7 +170,7 @@
downloadTxt();
}}
>
<div class="flex items-center line-clamp-1">Plain text (.txt)</div>
<div class="flex items-center line-clamp-1">{$i18n.t('Plain text (.txt)')}</div>
</DropdownMenu.Item>
<DropdownMenu.Item
@@ -176,7 +179,7 @@
downloadPdf();
}}
>
<div class="flex items-center line-clamp-1">PDF document (.pdf)</div>
<div class="flex items-center line-clamp-1">{$i18n.t('PDF document (.pdf)')}</div>
</DropdownMenu.Item>
</DropdownMenu.SubContent>
</DropdownMenu.Sub>

View File

@@ -399,7 +399,7 @@
await chats.set(await getChatList(localStorage.token));
}}
>
all
{$i18n.t('all')}
</button>
{#each $tags as tag}
<button
@@ -610,7 +610,7 @@
</button>
</ChatMenu>
<Tooltip content="Archive">
<Tooltip content={$i18n.t('Archive')}>
<button
aria-label="Archive"
class=" self-center dark:hover:text-white transition"

View File

@@ -162,7 +162,7 @@
{/each} -->
</div>
{:else}
<div class="text-left text-sm w-full mb-8">You have no archived conversations.</div>
<div class="text-left text-sm w-full mb-8">{$i18n.t('You have no archived conversations.')}</div>
{/if}
</div>
</div>

View File

@@ -1,6 +1,7 @@
<script lang="ts">
import { DropdownMenu } from 'bits-ui';
import { flyAndScale } from '$lib/utils/transitions';
import { getContext } from 'svelte';
import Dropdown from '$lib/components/common/Dropdown.svelte';
import GarbageBin from '$lib/components/icons/GarbageBin.svelte';
@@ -9,6 +10,8 @@
import Tags from '$lib/components/chat/Tags.svelte';
import Share from '$lib/components/icons/Share.svelte';
const i18n = getContext('i18n');
export let shareHandler: Function;
export let renameHandler: Function;
export let deleteHandler: Function;
@@ -27,7 +30,7 @@
}
}}
>
<Tooltip content="More">
<Tooltip content={$i18n.t('More')}>
<slot />
</Tooltip>
@@ -46,7 +49,7 @@
}}
>
<Share />
<div class="flex items-center">Share</div>
<div class="flex items-center">{$i18n.t('Share')}</div>
</DropdownMenu.Item>
<DropdownMenu.Item
@@ -56,7 +59,7 @@
}}
>
<Pencil strokeWidth="2" />
<div class="flex items-center">Rename</div>
<div class="flex items-center">{$i18n.t('Rename')}</div>
</DropdownMenu.Item>
<DropdownMenu.Item
@@ -66,7 +69,7 @@
}}
>
<GarbageBin strokeWidth="2" />
<div class="flex items-center">Delete</div>
<div class="flex items-center">{$i18n.t('Delete')}</div>
</DropdownMenu.Item>
<hr class="border-gray-100 dark:border-gray-800 mt-2.5 mb-1.5" />