Added the choice between formal and informal address to the whole app (#1200)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-13 10:16:56 +01:00
1 parent 382db4b8d0
commit c9a376f742
342 files changed
+14378 -1893

No files matched your search

@@ -34,32 +34,32 @@
@bind-Text="@this.importantAspects"
Class="mb-3"
Label="@T("(Optional) Important Aspects for the prompt")"
HelperText="@T("(Optional) Specify aspects the optimizer should emphasize in the resulting prompt, such as output structure, or constraints.")"
HelperText="@TA("(Optional) Specify aspects the optimizer should emphasize in the resulting prompt, such as output structure, or constraints.")"
ShrinkLabel="true"
Variant="Variant.Outlined"
AdornmentIcon="@AppIcons.IMPORTANT_ASPECTS"
Adornment="Adornment.Start"/>
<MudStack Row="true" AlignItems="AlignItems.Center" Class="mb-2">
<MudText Typo="Typo.h6">@T("Recommendations for your prompt")</MudText>
<MudText Typo="Typo.h6">@TA("Recommendations for your prompt")</MudText>
</MudStack>
@if (this.ShowUpdatedPromptGuidelinesIndicator)
{
<MudAlert Severity="Severity.Info" Dense="true" Variant="Variant.Outlined" Class="mb-3">
<MudStack Row="true" AlignItems="AlignItems.Center" Wrap="Wrap.Wrap">
<MudText Typo="Typo.body2">@T("Prompt recommendations were updated based on your latest optimization.")</MudText>
<MudText Typo="Typo.body2">@TA("Prompt recommendations were updated based on your latest optimization.")</MudText>
</MudStack>
</MudAlert>
}
@if (!this.useCustomPromptGuide)
{
<MudJustifiedText Class="mb-3">@T("Use these recommendations, that are based on the default prompt guide, to improve your prompts. The suggestions are updated based on your latest prompt optimization.")</MudJustifiedText>
<MudJustifiedText Class="mb-3">@TA("Use these recommendations, which are based on the default prompt guide, to improve your prompts. The suggestions are updated based on your latest prompt optimization.")</MudJustifiedText>
<MudGrid Class="mb-3">
<MudItem xs="12" sm="6" md="4">
<MudTextField T="string" Value="@this.recClarityDirectness" Label="@T("Be clear and direct")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
<MudTextField T="string" Value="@this.recClarityDirectness" Label="@TA("Be clear and direct")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
</MudItem>
<MudItem xs="12" sm="6" md="4">
<MudTextField T="string" Value="@this.recExamplesContext" Label="@T("Add examples and context")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
@@ -71,21 +71,21 @@
<MudTextField T="string" Value="@this.recStructureMarkers" Label="@T("Structure with markers")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
</MudItem>
<MudItem xs="12" sm="6" md="4">
<MudTextField T="string" Value="@this.recRoleDefinition" Label="@T("Give the model a role")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
<MudTextField T="string" Value="@this.recRoleDefinition" Label="@TA("Give the model a role")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
</MudItem>
<MudItem xs="12" sm="6" md="4">
<MudTextField T="string" Value="@this.recLanguageChoice" Label="@T("Choose prompt language deliberately")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
<MudTextField T="string" Value="@this.recLanguageChoice" Label="@TA("Choose prompt language deliberately")" ReadOnly="true" Variant="Variant.Outlined" Lines="2" Sizing="InputSizing.Auto" />
</MudItem>
</MudGrid>
}
@if (this.useCustomPromptGuide && this.IsCustomPromptGuideLocked)
{
<MudJustifiedText Class="mb-3">@T("Use the prompt recommendations from the prompt guide of your organization.")</MudJustifiedText>
<MudJustifiedText Class="mb-3">@TA("Use the prompt recommendations from the prompt guide of your organization.")</MudJustifiedText>
}
else if (this.useCustomPromptGuide)
{
<MudJustifiedText Class="mb-3">@T("Use the prompt recommendations from the custom prompt guide.")</MudJustifiedText>
<MudJustifiedText Class="mb-3">@TA("Use the prompt recommendations from the custom prompt guide.")</MudJustifiedText>
}
<MudStack Row="true" AlignItems="AlignItems.Center" Wrap="Wrap.Wrap" StretchItems="StretchItems.None" Class="mb-3">
@@ -30,7 +30,7 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
protected override string Title => T("Prompt Optimizer");
protected override string Description => T("Use an LLM to optimize your prompt by following either the default or your individual prompt guidelines and get targeted recommendations for future versions of the prompt.");
protected override string Description => TA("Use an LLM to optimize your prompt by following either the default or your individual prompt guidelines and get targeted recommendations for future versions of the prompt.");
// Sending to a new chat puts the optimized prompt into its input field, so no chat continues this conversation:
protected override ChatSystemPromptChoice ChatSystemPrompt => ChatSystemPromptChoice.AI_STUDIO_DEFAULT;
@@ -104,7 +104,7 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
new ButtonData
{
Text = T("Improve further"),
Tooltip = T("Moves the optimized prompt into the prompt field so you can optimize it again."),
Tooltip = TA("Moves the optimized prompt into the prompt field so you can optimize it again."),
Icon = AppIcons.USE_AS_INPUT,
Color = Color.Default,
AsyncAction = this.UseOptimizedPromptAsInput,
@@ -332,7 +332,7 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
private string? ValidateInputPrompt(string text)
{
if (string.IsNullOrWhiteSpace(text))
return T("Please provide a prompt or prompt description.");
return TA("Please provide a prompt or prompt description.");
return null;
}
@@ -340,7 +340,7 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
private string? ValidateCustomLanguage(string language)
{
if (this.selectedTargetLanguage == CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language))
return T("Please provide a custom language.");
return TA("Please provide a custom language.");
return null;
}
@@ -374,11 +374,11 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
if (string.IsNullOrWhiteSpace(promptingGuideline))
{
if (this.useCustomPromptGuide && this.IsCustomPromptGuideLocked)
this.AddInputIssue(T("The prompt guide of your organization could not be loaded."));
this.AddInputIssue(TA("The prompt guide of your organization could not be loaded."));
else if (this.useCustomPromptGuide)
this.AddInputIssue(T("Please attach and load a valid custom prompt guide file."));
this.AddInputIssue(TA("Please attach and load a valid custom prompt guide file."));
else
this.AddInputIssue(T("The prompting guideline file could not be loaded. Please verify 'prompting_guideline.md' in Assistants/PromptOptimizer."));
this.AddInputIssue(TA("The prompting guideline file could not be loaded. Please verify 'prompting_guideline.md' in Assistants/PromptOptimizer."));
return;
}
@@ -497,12 +497,12 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
private void ApplyFallbackRecommendations()
{
this.recClarityDirectness = T("Add clearer goals and explicit quality expectations.");
this.recExamplesContext = T("Add short examples and background context for your specific use case.");
this.recSequentialSteps = T("Break the task into numbered steps if order matters.");
this.recStructureMarkers = T("Use headings or markers to separate context, task, and constraints.");
this.recRoleDefinition = T("Define a role for the model to focus output style and expertise.");
this.recLanguageChoice = T("Use English for complex prompts and explicitly request response language if needed.");
this.recClarityDirectness = TA("Add clearer goals and explicit quality expectations.");
this.recExamplesContext = TA("Add short examples and background context for your specific use case.");
this.recSequentialSteps = TA("Break the task into numbered steps if order matters.");
this.recStructureMarkers = TA("Use headings or markers to separate context, task, and constraints.");
this.recRoleDefinition = TA("Define a role for the model to focus output style and expertise.");
this.recLanguageChoice = TA("Use English for complex prompts and explicitly request response language if needed.");
}
private string EmptyFallback(string text)
@@ -542,12 +542,12 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
private void ResetGuidelineSummaryToDefault()
{
this.recClarityDirectness = T("Use clear, explicit instructions and directly state quality expectations.");
this.recExamplesContext = T("Include short examples and context that explain the purpose behind your requirements.");
this.recSequentialSteps = T("Prefer numbered steps when task order matters.");
this.recStructureMarkers = T("Separate context, task, constraints, and output format with headings or markers.");
this.recRoleDefinition = T("Assign a role to shape tone, expertise, and focus.");
this.recLanguageChoice = T("For complex tasks, write prompts in English.");
this.recClarityDirectness = TA("Use clear, explicit instructions and directly state quality expectations.");
this.recExamplesContext = TA("Include short examples and context that explain the purpose behind your requirements.");
this.recSequentialSteps = TA("Prefer numbered steps when task order matters.");
this.recStructureMarkers = TA("Separate context, task, constraints, and output format with headings or markers.");
this.recRoleDefinition = TA("Assign a role to shape tone, expertise, and focus.");
this.recLanguageChoice = TA("For complex tasks, write prompts in English.");
}
private void AddVisibleOptimizedPromptBlock()