mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-27 15:59:47 +00:00
Clear final Lua code and localized content on language change for improved state management
This commit is contained in:
parent
78414f331e
commit
5a974fb45c
@ -134,16 +134,17 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
|
||||
|
||||
private async Task OnChangedLanguage()
|
||||
{
|
||||
this.finalLuaCode.Clear();
|
||||
this.localizedContent.Clear();
|
||||
this.localizationPossible = false;
|
||||
if (PluginFactory.RunningPlugins.FirstOrDefault(n => n is PluginLanguage && n.Id == this.selectedLanguagePluginId) is not PluginLanguage comparisonPlugin)
|
||||
{
|
||||
this.loadingIssue = $"Was not able to load the language plugin for comparison ({this.selectedLanguagePluginId}). Please select a valid, loaded & running language plugin.";
|
||||
this.localizationPossible = false;
|
||||
this.selectedLanguagePlugin = null;
|
||||
}
|
||||
else if (comparisonPlugin.IETFTag != this.selectedTargetLanguage.ToIETFTag())
|
||||
{
|
||||
this.loadingIssue = $"The selected language plugin for comparison uses the IETF tag '{comparisonPlugin.IETFTag}' which does not match the selected target language '{this.selectedTargetLanguage.ToIETFTag()}'. Please select a valid, loaded & running language plugin which matches the target language.";
|
||||
this.localizationPossible = false;
|
||||
this.selectedLanguagePlugin = null;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user