mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-21 02:33:48 +00:00
23 lines
2.3 KiB
Plaintext
23 lines
2.3 KiB
Plaintext
@attribute [Route(Routes.ASSISTANT_TRANSLATION)]
|
|
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogTranslation>
|
|
|
|
@if (!this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)
|
|
{
|
|
<ReadWebContent @bind-Content="@this.inputText" @bind-URL="@this.webContentURL" ProviderSettings="@this.ProviderSettings" @bind-AgentIsRunning="@this.isAgentRunning" @bind-Preselect="@this.showWebContentReader" @bind-PreselectContentCleanerAgent="@this.useContentCleanerAgent"/>
|
|
}
|
|
|
|
<ReadFileContent @bind-FileContent="@this.inputText" EnableDragDrop="true" CatchAllDocuments="true"/>
|
|
|
|
<MudTextSwitch Label="@T("Live translation")" @bind-Value="@this.liveTranslation" LabelOn="@T("Live translation")" LabelOff="@T("No live translation")"/>
|
|
@if (this.liveTranslation)
|
|
{
|
|
<DebouncedTextField Disabled="@this.isAgentRunning" @bind-Text="@this.inputText" ValidationFunc="@this.ValidatingText" Icon="@AppIcons.INPUT_TEXT" Label="@TA("Your input")" Lines="6" MaxLines="12" DebounceTime="@TimeSpan.FromMilliseconds(this.SettingsManager.ConfigurationData.Translation.DebounceIntervalMilliseconds)" WhenTextChangedAsync="async _ => await this.TranslateText(force: false)" Attributes="@USER_INPUT_ATTRIBUTES"/>
|
|
}
|
|
else
|
|
{
|
|
@* Bound by its value, the field shows no issue before you type, also when you switch the live translation off. It checks your text again shortly after you stop typing, see TextFieldDefaults: *@
|
|
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.inputText" Validation="@this.ValidatingText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
|
}
|
|
|
|
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelecting)" @bind-Value="@this.selectedTargetLanguage" ValidateSelection="@this.ValidatingTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Target language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" />
|
|
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/> |