mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 03:40:21 +00:00 
			
		
		
		
	Handle missing or empty translations in MSGComponentBase.
This commit is contained in:
		
							parent
							
								
									36df88a415
								
							
						
					
					
						commit
						2caf291db3
					
				@ -41,9 +41,17 @@ public abstract class MSGComponentBase : ComponentBase, IDisposable, IMessageBus
 | 
				
			|||||||
        var ns = $"{type.Namespace!}::{type.Name}".ToUpperInvariant().Replace(".", "::");
 | 
					        var ns = $"{type.Namespace!}::{type.Name}".ToUpperInvariant().Replace(".", "::");
 | 
				
			||||||
        var key = $"root::{ns}::T{fallbackEN.ToFNV32()}";
 | 
					        var key = $"root::{ns}::T{fallbackEN.ToFNV32()}";
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if(this.Lang.TryGetText(key, out var text, logWarning: false))
 | 
					        if(this.Lang is NoPluginLanguage)
 | 
				
			||||||
            return text;
 | 
					            return fallbackEN;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        if(this.Lang.TryGetText(key, out var text, logWarning: false))
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if(string.IsNullOrWhiteSpace(text))
 | 
				
			||||||
 | 
					                return fallbackEN;
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					            return text;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.Logger.LogWarning($"Missing translation key '{key}' for content '{fallbackEN}'.");
 | 
					        this.Logger.LogWarning($"Missing translation key '{key}' for content '{fallbackEN}'.");
 | 
				
			||||||
        return fallbackEN;
 | 
					        return fallbackEN;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user