Browse Source

Localize the string `Generating portable PDB...`.

pull/3619/head
sonyps5201314 5 months ago
parent
commit
71cfce3a48
  1. 5
      ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs
  2. 8
      ILSpy/Commands/GeneratePdbContextMenuEntry.cs
  3. 26
      ILSpy/Properties/Resources.Designer.cs
  4. 3
      ILSpy/Properties/Resources.resx
  5. 3
      ILSpy/Properties/Resources.zh-Hans.resx

5
ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs

@ -72,7 +72,8 @@ namespace ICSharpCode.Decompiler.DebugInfo
Stream targetStream, Stream targetStream,
bool noLogo = false, bool noLogo = false,
BlobContentId? pdbId = null, BlobContentId? pdbId = null,
IProgress<DecompilationProgress> progress = null) IProgress<DecompilationProgress> progress = null,
string currentProgressTitle = "Generating portable PDB...")
{ {
MetadataBuilder metadata = new MetadataBuilder(); MetadataBuilder metadata = new MetadataBuilder();
MetadataReader reader = file.Metadata; MetadataReader reader = file.Metadata;
@ -99,7 +100,7 @@ namespace ICSharpCode.Decompiler.DebugInfo
DecompilationProgress currentProgress = new() { DecompilationProgress currentProgress = new() {
TotalUnits = sourceFiles.Count, TotalUnits = sourceFiles.Count,
UnitsCompleted = 0, UnitsCompleted = 0,
Title = "Generating portable PDB..." Title = currentProgressTitle
}; };
foreach (var sourceFile in sourceFiles) foreach (var sourceFile in sourceFiles)

8
ILSpy/Commands/GeneratePdbContextMenuEntry.cs

@ -99,7 +99,7 @@ namespace ICSharpCode.ILSpy
{ {
var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings);
decompiler.CancellationToken = ct; 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) catch (OperationCanceledException)
{ {
@ -168,7 +168,7 @@ namespace ICSharpCode.ILSpy
if (options.Progress != null) if (options.Progress != null)
{ {
options.Progress.Report(new DecompilationProgress { options.Progress.Report(new DecompilationProgress {
Title = "Generating portable PDB...", Title = Resources.GeneratingPortablePDB,
TotalUnits = total, TotalUnits = total,
UnitsCompleted = processed UnitsCompleted = processed
}); });
@ -184,7 +184,7 @@ namespace ICSharpCode.ILSpy
{ {
var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings); var decompiler = new CSharpDecompiler(file, assembly.GetAssemblyResolver(options.DecompilerSettings.AutoLoadAssemblyReferences), options.DecompilerSettings);
decompiler.CancellationToken = ct; 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)); output.WriteLine(string.Format(Resources.GeneratedPDBFile, fileName));
} }
@ -202,7 +202,7 @@ namespace ICSharpCode.ILSpy
if (options.Progress != null) if (options.Progress != null)
{ {
options.Progress.Report(new DecompilationProgress { options.Progress.Report(new DecompilationProgress {
Title = "Generating portable PDB...", Title = Resources.GeneratingPortablePDB,
TotalUnits = total, TotalUnits = total,
UnitsCompleted = processed UnitsCompleted = processed
}); });

26
ILSpy/Properties/Resources.Designer.cs generated

@ -1911,6 +1911,14 @@ namespace ICSharpCode.ILSpy.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Generated PDB: {0}.
/// </summary>
public static string GeneratedPDBFile {
get {
return ResourceManager.GetString("GeneratedPDBFile", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Generate portable PDB. /// Looks up a localized string similar to Generate portable PDB.
/// </summary> /// </summary>
@ -1921,11 +1929,11 @@ namespace ICSharpCode.ILSpy.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Generated PDB: {0}. /// Looks up a localized string similar to Generating portable PDB....
/// </summary> /// </summary>
public static string GeneratedPDBFile { public static string GeneratingPortablePDB {
get { get {
return ResourceManager.GetString("GeneratedPDBFile", resourceCulture); return ResourceManager.GetString("GeneratingPortablePDB", resourceCulture);
} }
} }
@ -1939,20 +1947,20 @@ namespace ICSharpCode.ILSpy.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Generation was cancelled.. /// Looks up a localized string similar to Failed to generate PDB for {0}: {1}.
/// </summary> /// </summary>
public static string GenerationWasCancelled { public static string GenerationFailedForAssembly {
get { get {
return ResourceManager.GetString("GenerationWasCancelled", resourceCulture); return ResourceManager.GetString("GenerationFailedForAssembly", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Failed to generate PDB for {0}: {1}. /// Looks up a localized string similar to Generation was cancelled..
/// </summary> /// </summary>
public static string GenerationFailedForAssembly { public static string GenerationWasCancelled {
get { get {
return ResourceManager.GetString("GenerationFailedForAssembly", resourceCulture); return ResourceManager.GetString("GenerationWasCancelled", resourceCulture);
} }
} }

3
ILSpy/Properties/Resources.resx

@ -660,6 +660,9 @@ Are you sure you want to continue?</value>
<data name="GeneratedPDBFile" xml:space="preserve"> <data name="GeneratedPDBFile" xml:space="preserve">
<value>Generated PDB: {0}</value> <value>Generated PDB: {0}</value>
</data> </data>
<data name="GeneratingPortablePDB" xml:space="preserve">
<value>Generating portable PDB...</value>
</data>
<data name="GenerationCompleteInSeconds" xml:space="preserve"> <data name="GenerationCompleteInSeconds" xml:space="preserve">
<value>Generation complete in {0} seconds.</value> <value>Generation complete in {0} seconds.</value>
</data> </data>

3
ILSpy/Properties/Resources.zh-Hans.resx

@ -613,6 +613,9 @@
<data name="GeneratedPDBFile" xml:space="preserve"> <data name="GeneratedPDBFile" xml:space="preserve">
<value>生成的 PDB: {0}</value> <value>生成的 PDB: {0}</value>
</data> </data>
<data name="GeneratingPortablePDB" xml:space="preserve">
<value>正在生成 Portable PDB...</value>
</data>
<data name="GenerationCompleteInSeconds" xml:space="preserve"> <data name="GenerationCompleteInSeconds" xml:space="preserve">
<value>生成完成,耗时 {0} 秒。</value> <value>生成完成,耗时 {0} 秒。</value>
</data> </data>

Loading…
Cancel
Save