[feat][experimental] Add auto-translate input message functionality and language support in chat panel and settings

This commit adds new entries in the language files and UI support for auto-translate messages.

The new feature uses a textarea input field to translate messages as they are typed, and the translated text is shown in a new field. Also, the language settings now provide an option to enable/disable auto message translation.

The code changes include adding a new function to update the input sizes for both input fields and some minor code refactoring to support new functionality.
This commit is contained in:
LL
2023-06-06 18:37:19 +09:00
parent e913a641fa
commit 89dc9c8c80
6 changed files with 97 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
import { changeLanguage, language } from "src/lang";
import { DataBase } from "src/ts/storage/database";
import { sleep } from "src/ts/util";
import Help from "src/lib/Others/Help.svelte";
let langChanged = false
</script>
<h2 class="mb-2 text-2xl font-bold mt-2">{language.language}</h2>
@@ -39,4 +40,11 @@ import { changeLanguage, language } from "src/lang";
<Check bind:check={$DataBase.autoTranslate} />
<span>{language.autoTranslation}</span>
</div>
{#if $DataBase.useExperimental}
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.useAutoTranslateInput} />
<span>{language.autoTranslateInput}</span>
<Help key="experimental" />
</div>
{/if}
{/if}