From 8863f977c5bdcd309f143d1489e8124449a771bc Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Thu, 16 Jul 2020 01:29:48 +0800 Subject: [PATCH] ILSpy.ReadyToRun and more statements is Translated --- ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj | 15 ++ .../Properties/Resources.Designer.cs | 99 +++++++++++++ ILSpy.ReadyToRun/Properties/Resources.resx | 132 ++++++++++++++++++ .../Properties/Resources.zh-Hans.resx | 132 ++++++++++++++++++ ILSpy.ReadyToRun/ReadyToRunLanguage.cs | 3 +- ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml | 7 +- ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs | 4 +- ILSpy/AboutPage.cs | 2 +- ILSpy/Commands/Pdb2XmlCommand.cs | 5 +- ILSpy/ILSpy.csproj | 1 + ILSpy/Properties/Resources.Designer.cs | 18 +++ ILSpy/Properties/Resources.resx | 6 + ILSpy/Properties/Resources.zh-Hans.resx | 16 ++- doc/ILSpyAboutPage.zh-Hans.txt | 13 ++ 14 files changed, 439 insertions(+), 14 deletions(-) create mode 100644 ILSpy.ReadyToRun/Properties/Resources.Designer.cs create mode 100644 ILSpy.ReadyToRun/Properties/Resources.resx create mode 100644 ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx create mode 100644 doc/ILSpyAboutPage.zh-Hans.txt diff --git a/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj b/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj index dddbbb74c..13d40df8a 100644 --- a/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj +++ b/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj @@ -44,6 +44,11 @@ + + True + True + Resources.resx + ReadyToRunOptionPage.xaml @@ -51,6 +56,16 @@ + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + + + diff --git a/ILSpy.ReadyToRun/Properties/Resources.Designer.cs b/ILSpy.ReadyToRun/Properties/Resources.Designer.cs new file mode 100644 index 000000000..56cf7ac1f --- /dev/null +++ b/ILSpy.ReadyToRun/Properties/Resources.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace ILSpy.ReadyToRun.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ILSpy.ReadyToRun.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性 + /// 重写当前线程的 CurrentUICulture 属性。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找类似 Disassembly Format 的本地化字符串。 + /// + public static string DisassemblyFormat { + get { + return ResourceManager.GetString("DisassemblyFormat", resourceCulture); + } + } + + /// + /// 查找类似 ReadyToRun 的本地化字符串。 + /// + public static string ReadyToRun { + get { + return ResourceManager.GetString("ReadyToRun", resourceCulture); + } + } + + /// + /// 查找类似 Show Debug Info 的本地化字符串。 + /// + public static string ShowDebugInfo { + get { + return ResourceManager.GetString("ShowDebugInfo", resourceCulture); + } + } + + /// + /// 查找类似 Show Unwind Info 的本地化字符串。 + /// + public static string ShowUnwindInfo { + get { + return ResourceManager.GetString("ShowUnwindInfo", resourceCulture); + } + } + } +} diff --git a/ILSpy.ReadyToRun/Properties/Resources.resx b/ILSpy.ReadyToRun/Properties/Resources.resx new file mode 100644 index 000000000..67b36ef54 --- /dev/null +++ b/ILSpy.ReadyToRun/Properties/Resources.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ReadyToRun + + + Disassembly Format + + + Show Unwind Info + + + Show Debug Info + + \ No newline at end of file diff --git a/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx b/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx new file mode 100644 index 000000000..f13237c18 --- /dev/null +++ b/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ReadyToRun + + + 反汇编格式 + + + 显示调试信息 + + + 显示展开信息 + + \ No newline at end of file diff --git a/ILSpy.ReadyToRun/ReadyToRunLanguage.cs b/ILSpy.ReadyToRun/ReadyToRunLanguage.cs index f29c5ce73..b244a5b43 100644 --- a/ILSpy.ReadyToRun/ReadyToRunLanguage.cs +++ b/ILSpy.ReadyToRun/ReadyToRunLanguage.cs @@ -24,6 +24,7 @@ using System.Linq; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; using System.Reflection.PortableExecutable; +using System.Resources; using System.Runtime.CompilerServices; using Iced.Intel; @@ -35,7 +36,7 @@ using ICSharpCode.Decompiler.Solution; using ICSharpCode.Decompiler.TypeSystem; using ILCompiler.Reflection.ReadyToRun; using ILCompiler.Reflection.ReadyToRun.Amd64; - +[assembly: NeutralResourcesLanguage("en-US")] namespace ICSharpCode.ILSpy.ReadyToRun { [Export(typeof(Language))] diff --git a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml index 188f52994..c3e28eaf0 100644 --- a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml +++ b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml @@ -1,5 +1,6 @@  @@ -11,11 +12,11 @@ - Disassembly Format + - Show Unwind Info + - Show Debug Info + \ No newline at end of file diff --git a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs index 3e81b1c7c..59ee6d734 100644 --- a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs +++ b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs @@ -20,10 +20,10 @@ using System.ComponentModel; using System.Windows.Controls; using System.Xml.Linq; using ICSharpCode.ILSpy.Options; - +using ILSpy.ReadyToRun; namespace ICSharpCode.ILSpy.ReadyToRun { - [ExportOptionPage(Title = "ReadyToRun", Order = 40)] + [ExportOptionPage(Title = nameof(global::ILSpy.ReadyToRun.Properties.Resources.ReadyToRun), Order = 40)] partial class ReadyToRunOptionPage : UserControl, IOptionPage { public ReadyToRunOptionPage() diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index e904de4a8..1916abee5 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -88,7 +88,7 @@ namespace ICSharpCode.ILSpy plugin.Write(output); output.WriteLine(); output.Address = new Uri("resource://AboutPage"); - using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), "ILSpyAboutPage.txt")) { + using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), Resources.ILSpyAboutPageTxt)) { using (StreamReader r = new StreamReader(s)) { string line; while ((line = r.ReadLine()) != null) { diff --git a/ILSpy/Commands/Pdb2XmlCommand.cs b/ILSpy/Commands/Pdb2XmlCommand.cs index 91b481f7b..13856e8b0 100644 --- a/ILSpy/Commands/Pdb2XmlCommand.cs +++ b/ILSpy/Commands/Pdb2XmlCommand.cs @@ -24,13 +24,14 @@ using System.Linq; using System.Threading.Tasks; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.Decompiler; +using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.TextView; using ICSharpCode.ILSpy.TreeNodes; using Microsoft.DiaSymReader.Tools; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "DEBUG -- Dump PDB as XML", MenuCategory = "Open", MenuOrder = 2.6)] + [ExportMainMenuCommand(Menu = nameof(Resources._File) , Header = nameof(Resources.DEBUGDumpPDBAsXML), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)] sealed class Pdb2XmlCommand : SimpleCommand { public override bool CanExecute(object parameter) @@ -64,7 +65,7 @@ namespace ICSharpCode.ILSpy } } - [ExportContextMenuEntry(Header = "DEBUG -- Dump PDB as XML")] + [ExportContextMenuEntry(Header = nameof(Resources.DEBUGDumpPDBAsXML))] class Pdb2XmlCommandContextMenuEntry : IContextMenuEntry { public void Execute(TextViewContext context) diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index c47538ca4..1abc6c53e 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -456,6 +456,7 @@ + license.txt diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index ce852aecd..5b55dfdfc 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -549,6 +549,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// 查找类似 DEBUG -- Dump PDB as XML 的本地化字符串。 + /// + public static string DEBUGDumpPDBAsXML { + get { + return ResourceManager.GetString("DEBUGDumpPDBAsXML", resourceCulture); + } + } + /// /// 查找类似 Debug Steps 的本地化字符串。 /// @@ -1379,6 +1388,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// 查找类似 ILSpyAboutPage.txt 的本地化字符串。 + /// + public static string ILSpyAboutPageTxt { + get { + return ResourceManager.GetString("ILSpyAboutPageTxt", resourceCulture); + } + } + /// /// 查找类似 ILSpy version 的本地化字符串。 /// diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index 4fb242324..cc292085b 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -873,4 +873,10 @@ Do you want to continue? Use new SDK style format for generated project files (*.csproj) + + DEBUG -- Dump PDB as XML + + + ILSpyAboutPage.txt + \ No newline at end of file diff --git a/ILSpy/Properties/Resources.zh-Hans.resx b/ILSpy/Properties/Resources.zh-Hans.resx index 4cf41e4ea..164844b44 100644 --- a/ILSpy/Properties/Resources.zh-Hans.resx +++ b/ILSpy/Properties/Resources.zh-Hans.resx @@ -481,16 +481,16 @@ 调试步骤 - UseFieldSugar + 使用变量语法糖 - UseLogicOperationSugar + 使用逻辑操作符语法糖 - ShowILRanges + 显示IL范围 - ShowChildIndexInBlock + 在块中显示子索引 在此步骤之前显示状态 @@ -817,7 +817,7 @@ 仅显示public类型和成员 - 仅显示 _public 类型和成员 + 仅显示公共类型和成员(_P) 选择输出的语言版本 @@ -873,4 +873,10 @@ 你确定要删除所有程序集列表并且重新创建默认的程序集列表? + + ILSpyAboutPage.zh-Hans.txt + + + DEBUG --转存PDB为XML + \ No newline at end of file diff --git a/doc/ILSpyAboutPage.zh-Hans.txt b/doc/ILSpyAboutPage.zh-Hans.txt new file mode 100644 index 000000000..859f9a8e1 --- /dev/null +++ b/doc/ILSpyAboutPage.zh-Hans.txt @@ -0,0 +1,13 @@ +ILSpy ǿԴ.NETͷ. + +վ: https://ilspy.net/ +BUG: https://github.com/icsharpcode/ILSpy/issues/new/choose +ķ뷴:https://github.com/maikebing/ILSpy/issues + +Copyright 2011-2020 AlphaSierraPapa for the ILSpy team +ǰ͹ȥĹ: https://github.com/icsharpcode/ILSpy/graphs/contributors + +ILSpy MIT License . + +ILSpy ʹԴħʵ֣ ڴͬʱлΪЩǣ +ǸԵɺͰȨϢ鿴third-partyע. \ No newline at end of file