mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 10:00:21 +00:00 
			
		
		
		
	Rename variables for clarification
This commit is contained in:
		
							parent
							
								
									9423af6747
								
							
						
					
					
						commit
						3e31d0a6d1
					
				@ -18,9 +18,9 @@
 | 
			
		||||
else if (!this.isLoading && string.IsNullOrWhiteSpace(this.loadingIssue))
 | 
			
		||||
{
 | 
			
		||||
    <MudText Typo="Typo.h6">
 | 
			
		||||
        Added Content (@this.addedKeys.Count entries)
 | 
			
		||||
        Added Content (@this.addedContent.Count entries)
 | 
			
		||||
    </MudText>
 | 
			
		||||
    <MudTable Items="@this.addedKeys" Hover="@true" Filter="@this.FilterFunc" Class="border-dashed border rounded-lg mb-6">
 | 
			
		||||
    <MudTable Items="@this.addedContent" Hover="@true" Filter="@this.FilterFunc" Class="border-dashed border rounded-lg mb-6">
 | 
			
		||||
        <ToolBarContent>
 | 
			
		||||
            <MudTextField @bind-Value="@this.searchString" Immediate="true" Placeholder="Search" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"/>
 | 
			
		||||
        </ToolBarContent>
 | 
			
		||||
@ -48,9 +48,9 @@ else if (!this.isLoading && string.IsNullOrWhiteSpace(this.loadingIssue))
 | 
			
		||||
    </MudTable>
 | 
			
		||||
    
 | 
			
		||||
    <MudText Typo="Typo.h6">
 | 
			
		||||
        Removed Content (@this.removedKeys.Count entries)
 | 
			
		||||
        Removed Content (@this.removedContent.Count entries)
 | 
			
		||||
    </MudText>
 | 
			
		||||
    <MudTable Items="@this.removedKeys" Hover="@true" Filter="@this.FilterFunc" Class="border-dashed border rounded-lg mb-6">
 | 
			
		||||
    <MudTable Items="@this.removedContent" Hover="@true" Filter="@this.FilterFunc" Class="border-dashed border rounded-lg mb-6">
 | 
			
		||||
        <ToolBarContent>
 | 
			
		||||
            <MudTextField @bind-Value="@this.searchString" Immediate="true" Placeholder="Search" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Search" IconSize="Size.Medium" Class="mt-0"/>
 | 
			
		||||
        </ToolBarContent>
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
 | 
			
		||||
    
 | 
			
		||||
    protected override string SubmitText => "Localize AI Studio & generate the Lua code";
 | 
			
		||||
    
 | 
			
		||||
    protected override Func<Task> SubmitAction => this.LocalizeText;
 | 
			
		||||
    protected override Func<Task> SubmitAction => this.LocalizeTextConntent;
 | 
			
		||||
 | 
			
		||||
    protected override bool SubmitDisabled => !this.localizationPossible;
 | 
			
		||||
    
 | 
			
		||||
@ -66,8 +66,8 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
 | 
			
		||||
    private string searchString = string.Empty;
 | 
			
		||||
    private Guid selectedLanguagePluginId;
 | 
			
		||||
    private ILanguagePlugin? selectedLanguagePlugin;
 | 
			
		||||
    private Dictionary<string, string> addedKeys = [];
 | 
			
		||||
    private Dictionary<string, string> removedKeys = [];
 | 
			
		||||
    private Dictionary<string, string> addedContent = [];
 | 
			
		||||
    private Dictionary<string, string> removedContent = [];
 | 
			
		||||
 | 
			
		||||
    #region Overrides of AssistantBase<SettingsDialogI18N>
 | 
			
		||||
 | 
			
		||||
@ -119,7 +119,6 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
 | 
			
		||||
        //
 | 
			
		||||
        // Read the file `Assistants\I18N\allTexts.lua`:
 | 
			
		||||
        //
 | 
			
		||||
        
 | 
			
		||||
        #if DEBUG
 | 
			
		||||
        var filePath = Path.Join(Environment.CurrentDirectory, "Assistants", "I18N");
 | 
			
		||||
        var resourceFileProvider = new PhysicalFileProvider(filePath);
 | 
			
		||||
@ -156,8 +155,8 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
 | 
			
		||||
                var newI18NContent = pluginLanguage.Content;
 | 
			
		||||
                
 | 
			
		||||
                var currentI18NContent = this.selectedLanguagePlugin.Content;
 | 
			
		||||
                this.addedKeys = newI18NContent.ExceptBy(currentI18NContent.Keys, n => n.Key).ToDictionary();
 | 
			
		||||
                this.removedKeys = currentI18NContent.ExceptBy(newI18NContent.Keys, n => n.Key).ToDictionary();
 | 
			
		||||
                this.addedContent = newI18NContent.ExceptBy(currentI18NContent.Keys, n => n.Key).ToDictionary();
 | 
			
		||||
                this.removedContent = currentI18NContent.ExceptBy(newI18NContent.Keys, n => n.Key).ToDictionary();
 | 
			
		||||
                this.localizationPossible = true;
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
@ -196,7 +195,7 @@ public partial class AssistantI18N : AssistantBaseCore<SettingsDialogI18N>
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    private async Task LocalizeText()
 | 
			
		||||
    private async Task LocalizeTextConntent()
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user