mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-11-04 04:20:20 +00:00 
			
		
		
		
	Refactor Lua string escaping to a new utility class
This commit is contained in:
		
							parent
							
								
									3e31d0a6d1
								
							
						
					
					
						commit
						eba3e7a9fe
					
				@ -69,12 +69,6 @@ public sealed partial class CollectI18NKeysCommand
 | 
			
		||||
        
 | 
			
		||||
        Console.WriteLine(" done.");
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    private static string EscapeLuaString(string value)
 | 
			
		||||
    {
 | 
			
		||||
        // Ersetze Backslash und Doppel-Anführungszeichen
 | 
			
		||||
        return value.Replace("\\", @"\\").Replace("\"", "\\\"");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private string ExportToLuaAssignments(Dictionary<string, string> keyValuePairs)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								app/SharedTools/LuaTools.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								app/SharedTools/LuaTools.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
namespace SharedTools;
 | 
			
		||||
 | 
			
		||||
public static class LuaTools
 | 
			
		||||
{
 | 
			
		||||
    public static string EscapeLuaString(string value)
 | 
			
		||||
    {
 | 
			
		||||
        // Replace backslashes with double backslashes and escape double quotes:
 | 
			
		||||
        return value.Replace("\\", @"\\").Replace("\"", "\\\"");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user