diff --git a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs index ee3a94cf..93284c3f 100644 --- a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs +++ b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs @@ -306,8 +306,23 @@ public partial class AssistantI18N : AssistantBaseCore if(this.cancellationTokenSource!.IsCancellationRequested) return; - // Phase 2: Create the Lua code - this.Phase2CreateLuaCode(); + // + // Phase 2: Create the Lua code. We want to use the base language + // for the comments, though: + // + var commentContent = new Dictionary(this.addedContent); + foreach (var keyValuePair in PluginFactory.BaseLanguage.Content) + { + if (this.cancellationTokenSource!.IsCancellationRequested) + break; + + if (this.removedContent.ContainsKey(keyValuePair.Key)) + continue; + + commentContent.TryAdd(keyValuePair.Key, keyValuePair.Value); + } + + this.Phase2CreateLuaCode(commentContent); } private async Task Phase1TranslateAddedContent() @@ -346,10 +361,9 @@ public partial class AssistantI18N : AssistantBaseCore } } - private void Phase2CreateLuaCode() + private void Phase2CreateLuaCode(IReadOnlyDictionary commentContent) { this.finalLuaCode.Clear(); - var commentContent = this.addedContent.Concat(PluginFactory.BaseLanguage.Content).ToDictionary(); LuaTable.Create(ref this.finalLuaCode, "UI_TEXT_CONTENT", this.localizedContent, commentContent, this.cancellationTokenSource!.Token); // Next, we must remove the `root::` prefix from the keys: