From 71cfce3a486152db9e3139b98ab6c4806459e053 Mon Sep 17 00:00:00 2001 From: sonyps5201314 Date: Fri, 21 Nov 2025 16:54:25 +0800 Subject: [PATCH] Localize the string `Generating portable PDB...`. --- .../DebugInfo/PortablePdbWriter.cs | 5 ++-- ILSpy/Commands/GeneratePdbContextMenuEntry.cs | 8 +++--- ILSpy/Properties/Resources.Designer.cs | 26 ++++++++++++------- ILSpy/Properties/Resources.resx | 3 +++ ILSpy/Properties/Resources.zh-Hans.resx | 3 +++ 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs b/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs index 5d2ee3a5d..f1636dbaf 100644 --- a/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs +++ b/ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs @@ -72,7 +72,8 @@ namespace ICSharpCode.Decompiler.DebugInfo Stream targetStream, bool noLogo = false, BlobContentId? pdbId = null, - IProgress progress = null) + IProgress progress = null, + string currentProgressTitle = "Generating portable PDB...") { MetadataBuilder metadata = new MetadataBuilder(); MetadataReader reader = file.Metadata; @@ -99,7 +100,7 @@ namespace ICSharpCode.Decompiler.DebugInfo DecompilationProgress currentProgress = new() { TotalUnits = sourceFiles.Count, UnitsCompleted = 0, - Title = "Generating portable PDB..." + Title = currentProgressTitle }; foreach (var sourceFile in sourceFiles) diff --git a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs index 8732a59ea..7c4a1decb 100644 --- a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs +++ b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs @@ -99,7 +99,7 @@ namespace ICSharpCode.ILSpy { var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); decompiler.CancellationToken = ct; - PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream, progress: options.Progress); + PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream, progress: options.Progress, currentProgressTitle: Resources.GeneratingPortablePDB); } catch (OperationCanceledException) { @@ -168,7 +168,7 @@ namespace ICSharpCode.ILSpy if (options.Progress != null) { options.Progress.Report(new DecompilationProgress { - Title = "Generating portable PDB...", + Title = Resources.GeneratingPortablePDB, TotalUnits = total, UnitsCompleted = processed }); @@ -184,7 +184,7 @@ namespace ICSharpCode.ILSpy { var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); decompiler.CancellationToken = ct; - PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream, progress: options.Progress); + PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream, progress: options.Progress, currentProgressTitle: Resources.GeneratingPortablePDB); } output.WriteLine(string.Format(Resources.GeneratedPDBFile, fileName)); } @@ -202,7 +202,7 @@ namespace ICSharpCode.ILSpy if (options.Progress != null) { options.Progress.Report(new DecompilationProgress { - Title = "Generating portable PDB...", + Title = Resources.GeneratingPortablePDB, TotalUnits = total, UnitsCompleted = processed }); diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index 88032f1e6..9b6b5b0d5 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -1911,6 +1911,14 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// Looks up a localized string similar to Generated PDB: {0}. + /// + public static string GeneratedPDBFile { + get { + return ResourceManager.GetString("GeneratedPDBFile", resourceCulture); + } + } /// /// Looks up a localized string similar to Generate portable PDB. /// @@ -1921,11 +1929,11 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Generated PDB: {0}. + /// Looks up a localized string similar to Generating portable PDB.... /// - public static string GeneratedPDBFile { + public static string GeneratingPortablePDB { get { - return ResourceManager.GetString("GeneratedPDBFile", resourceCulture); + return ResourceManager.GetString("GeneratingPortablePDB", resourceCulture); } } @@ -1939,20 +1947,20 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Generation was cancelled.. + /// Looks up a localized string similar to Failed to generate PDB for {0}: {1}. /// - public static string GenerationWasCancelled { + public static string GenerationFailedForAssembly { get { - return ResourceManager.GetString("GenerationWasCancelled", resourceCulture); + return ResourceManager.GetString("GenerationFailedForAssembly", resourceCulture); } } /// - /// Looks up a localized string similar to Failed to generate PDB for {0}: {1}. + /// Looks up a localized string similar to Generation was cancelled.. /// - public static string GenerationFailedForAssembly { + public static string GenerationWasCancelled { get { - return ResourceManager.GetString("GenerationFailedForAssembly", resourceCulture); + return ResourceManager.GetString("GenerationWasCancelled", resourceCulture); } } diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index b82465de4..0924816a9 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -660,6 +660,9 @@ Are you sure you want to continue? Generated PDB: {0} + + Generating portable PDB... + Generation complete in {0} seconds. diff --git a/ILSpy/Properties/Resources.zh-Hans.resx b/ILSpy/Properties/Resources.zh-Hans.resx index c318edad1..2651f17af 100644 --- a/ILSpy/Properties/Resources.zh-Hans.resx +++ b/ILSpy/Properties/Resources.zh-Hans.resx @@ -613,6 +613,9 @@ 生成的 PDB: {0} + + 正在生成 Portable PDB... + 生成完成,耗时 {0} 秒。