diff --git a/src/Services/LocalizationService.cs b/src/Services/LocalizationService.cs index 3717eb7..ed09546 100644 --- a/src/Services/LocalizationService.cs +++ b/src/Services/LocalizationService.cs @@ -136,6 +136,10 @@ public string this[string key] ["Sim.SelectOutput"] = "选择模拟输出目录", ["Sim.ValidateDirs"] = "请填写所有必填项", ["Sim.DotnetCheck"] = "需要 .NET 10.0 SDK,请先安装", + ["Sim.Starting"] = "正在启动模拟...", + ["Sim.Completed"] = "模拟完成 ({0:F1}s)", + ["Sim.Failed"] = "模拟失败: {0}", + ["Sim.Report"] = "报告: {0}", }, ["en-US"] = new() { @@ -229,6 +233,10 @@ public string this[string key] ["Sim.SelectOutput"] = "Select simulation output directory", ["Sim.ValidateDirs"] = "Please fill in all required fields", ["Sim.DotnetCheck"] = ".NET 10.0 SDK is required. Please install it first.", + ["Sim.Starting"] = "Starting simulation...", + ["Sim.Completed"] = "Simulation completed ({0:F1}s)", + ["Sim.Failed"] = "Simulation failed: {0}", + ["Sim.Report"] = "Report: {0}", } }; diff --git a/src/ViewModels/SimulateViewModel.cs b/src/ViewModels/SimulateViewModel.cs index 0bc67c0..c545706 100644 --- a/src/ViewModels/SimulateViewModel.cs +++ b/src/ViewModels/SimulateViewModel.cs @@ -79,9 +79,9 @@ public int AppTypeIndex return r.Count > 0 ? r[0].Path.LocalPath : null; } - [RelayCommand] async Task SelectAppDir() { var p = await PickFolder("选择旧版本应用目录"); if (p != null) Config.AppDirectory = p; } - [RelayCommand] async Task SelectPatch() { var p = await PickFile("选择补丁包"); if (p != null) Config.PatchFilePath = p; } - [RelayCommand] async Task SelectOutputDir() { var p = await PickFolder("选择模拟输出目录"); if (p != null) Config.OutputDirectory = p; } + [RelayCommand] async Task SelectAppDir() { var p = await PickFolder(_loc["Sim.SelectAppDir"]); if (p != null) Config.AppDirectory = p; } + [RelayCommand] async Task SelectPatch() { var p = await PickFile(_loc["Sim.SelectPatch"]); if (p != null) Config.PatchFilePath = p; } + [RelayCommand] async Task SelectOutputDir() { var p = await PickFolder(_loc["Sim.SelectOutput"]); if (p != null) Config.OutputDirectory = p; } [RelayCommand] async Task StartSimulation() @@ -92,7 +92,7 @@ async Task StartSimulation() IsRunning = true; Log.Clear(); - Status = "Starting simulation..."; + Status = _loc["Sim.Starting"]; try { @@ -101,17 +101,17 @@ async Task StartSimulation() if (result.Success) { - Status = $"Simulation completed ({result.Elapsed.TotalSeconds:F1}s)"; + Status = _loc.T("Sim.Completed", result.Elapsed.TotalSeconds); L($"Result: {(result.Success ? "PASS" : "FAIL")}"); foreach (var note in result.Notes) L($" Note: {note}"); var reportPath = await _report.GenerateAsync(Config, result, Config.OutputDirectory); - L($"Report: {reportPath}"); + L(_loc.T("Sim.Report", reportPath)); } else { - Status = $"Simulation failed: {result.ErrorMessage}"; + Status = _loc.T("Sim.Failed", result.ErrorMessage); } } catch (Exception ex) diff --git a/src/Views/SimulateView.axaml b/src/Views/SimulateView.axaml index e09b162..ebe2137 100644 --- a/src/Views/SimulateView.axaml +++ b/src/Views/SimulateView.axaml @@ -3,24 +3,31 @@ xmlns:vm="using:GeneralUpdate.Tools.ViewModels" xmlns:svc="using:GeneralUpdate.Tools.Services" x:Class="GeneralUpdate.Tools.Views.SimulateView" + x:Name="SimRoot" x:DataType="vm:SimulateViewModel"> - + - + - + -