mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-13 22:27:21 +00:00
Added the choice between formal and informal address to the whole app (#1200)
This commit is contained in:
1 parent
382db4b8d0
commit
c9a376f742
342 files changed
+14378
-1893
No files matched your search
@@ -94,7 +94,7 @@
|
||||
}
|
||||
|
||||
<MudOverlay Visible="@this.performingUpdate" DarkBackground="@true" LockScroll="@true">
|
||||
<MudText Typo="Typo.h3">@T("Please wait for the update to complete...")</MudText>
|
||||
<MudText Typo="Typo.h3">@TA("Please wait for the update to complete...")</MudText>
|
||||
<MudProgressLinear Color="Color.Primary" Indeterminate="@true" Size="Size.Large" Rounded="@true"/>
|
||||
</MudOverlay>
|
||||
</MudContainer>
|
||||
|
||||
@@ -133,7 +133,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
||||
this.MessageBus.RegisterComponent(this, this.CircuitState);
|
||||
this.MessageBus.ApplyFilters(this, [],
|
||||
[
|
||||
Event.UPDATE_AVAILABLE, Event.CONFIGURATION_CHANGED, Event.COLOR_THEME_CHANGED, Event.SHOW_ERROR,
|
||||
Event.UPDATE_AVAILABLE, Event.CONFIGURATION_CHANGED, Event.COLOR_THEME_CHANGED, Event.ADDRESS_FORM_CHANGED, Event.SHOW_ERROR,
|
||||
Event.SHOW_WARNING, Event.SHOW_SUCCESS, Event.SHOW_INFO, Event.SHOW_PROMPT_INJECTION_ALERT, Event.STARTUP_PLUGIN_SYSTEM, Event.PLUGINS_RELOADED,
|
||||
Event.SHOW_FILE_EXPORT_RUNNING, Event.SHOW_FILE_EXPORT_SUCCESS, Event.HIDE_FILE_EXPORT_RUNNING,
|
||||
Event.INSTALL_UPDATE, Event.STARTUP_COMPLETED, Event.AI_JOB_CHANGED, Event.AI_JOB_FINISHED,
|
||||
@@ -199,12 +199,12 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
||||
var reason = this.SettingsManager.SettingsWriteBlockReason;
|
||||
var message = reason switch
|
||||
{
|
||||
SettingsWriteBlockReason.VERSION_NEWER_THAN_APP => T("Your settings were created by a newer AI Studio version. Changes in this session will not be saved. Please install or start the latest available update."),
|
||||
SettingsWriteBlockReason.VERSION_MISSING => T("Your settings file does not contain a settings-format version. Changes in this session will not be saved to avoid overwriting your settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.VERSION_UNKNOWN => T("AI Studio does not recognize your settings-format version. Changes in this session will not be saved to avoid overwriting your settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.FILE_UNREADABLE => T("AI Studio could not read your settings file. Changes in this session will not be saved to avoid overwriting recoverable settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.CURRENT_VERSION_INVALID => T("AI Studio found the current settings format but could not load it safely. Changes in this session will not be saved. Please check for updates or contact support."),
|
||||
_ => T("AI Studio cannot safely save settings in this session. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.VERSION_NEWER_THAN_APP => TA("Your settings were created by a newer AI Studio version. Changes in this session will not be saved. Please install or start the latest available update."),
|
||||
SettingsWriteBlockReason.VERSION_MISSING => TA("Your settings file does not contain a settings-format version. Changes in this session will not be saved to avoid overwriting your settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.VERSION_UNKNOWN => TA("AI Studio does not recognize your settings-format version. Changes in this session will not be saved to avoid overwriting your settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.FILE_UNREADABLE => TA("AI Studio could not read your settings file. Changes in this session will not be saved to avoid overwriting recoverable settings. Please check for updates or contact support."),
|
||||
SettingsWriteBlockReason.CURRENT_VERSION_INVALID => TA("AI Studio found the current settings format but could not load it safely. Changes in this session will not be saved. Please check for updates or contact support."),
|
||||
_ => TA("AI Studio cannot safely save settings in this session. Please check for updates or contact support."),
|
||||
};
|
||||
message = $"{message} {T("Reason")}: {reason}";
|
||||
|
||||
@@ -236,6 +236,13 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets a text which addresses the reader, in the form of address the person chose; see I18N.AddressForm.
|
||||
/// </summary>
|
||||
/// <param name="fallbackEN">The text in English (US).</param>
|
||||
/// <returns>The text from the language plugin or the English text.</returns>
|
||||
public string TA(string fallbackEN) => this.GetText(this.Lang, fallbackEN, addressForm: I18N.I.AddressForm);
|
||||
|
||||
#region Implementation of IMessageBusReceiver
|
||||
|
||||
public string ComponentName => nameof(MainLayout);
|
||||
@@ -293,6 +300,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
||||
break;
|
||||
|
||||
case Event.COLOR_THEME_CHANGED:
|
||||
case Event.ADDRESS_FORM_CHANGED:
|
||||
this.StateHasChanged();
|
||||
break;
|
||||
|
||||
@@ -613,7 +621,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
||||
{
|
||||
var dialogParameters = new DialogParameters<ConfirmDialog>
|
||||
{
|
||||
{ x => x.Message, T("Are you sure you want to leave the chat page? All unsaved changes will be lost.") },
|
||||
{ x => x.Message, TA("Are you sure you want to leave the chat page? All unsaved changes will be lost.") },
|
||||
};
|
||||
|
||||
var dialogReference = await this.DialogService.ShowAsync<ConfirmDialog>(T("Leave Chat Page"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||
|
||||
Reference in new issue
Block a user