diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs index 735ce2089..00b96b6f0 100644 --- a/ILSpy/AboutPage.cs +++ b/ILSpy/AboutPage.cs @@ -33,11 +33,12 @@ using System.Xml.Linq; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.Decompiler; +using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.TextView; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_Help", Header = "_About", MenuOrder = 99999)] + [ExportMainMenuCommand(Menu = nameof(Resources._Help), Header = nameof(Resources._About), MenuOrder = 99999)] sealed class AboutPage : SimpleCommand { [Import] @@ -57,7 +58,7 @@ namespace ICSharpCode.ILSpy public static void Display(DecompilerTextView textView) { AvalonEditTextOutput output = new AvalonEditTextOutput(); - output.WriteLine("ILSpy version " + RevisionClass.FullVersion); + output.WriteLine(Resources.ILSpyVersion + RevisionClass.FullVersion); output.AddUIElement( delegate { StackPanel stackPanel = new StackPanel(); @@ -71,7 +72,7 @@ namespace ICSharpCode.ILSpy } CheckBox checkBox = new CheckBox(); checkBox.Margin = new Thickness(4); - checkBox.Content = "Automatically check for updates every week"; + checkBox.Content = Resources.AutomaticallyCheckUpdatesEveryWeek; UpdateSettings settings = new UpdateSettings(ILSpySettings.Load()); checkBox.SetBinding(CheckBox.IsCheckedProperty, new Binding("AutomaticUpdateCheckEnabled") { Source = settings }); return new StackPanel { @@ -118,12 +119,12 @@ namespace ICSharpCode.ILSpy static void AddUpdateCheckButton(StackPanel stackPanel, DecompilerTextView textView) { Button button = new Button(); - button.Content = "Check for updates"; + button.Content = Resources.CheckUpdates; button.Cursor = Cursors.Arrow; stackPanel.Children.Add(button); button.Click += delegate { - button.Content = "Checking..."; + button.Content = Resources.Checking; button.IsEnabled = false; GetLatestVersionAsync().ContinueWith( delegate (Task task) { @@ -152,19 +153,19 @@ namespace ICSharpCode.ILSpy }); stackPanel.Children.Add( new TextBlock { - Text = "You are using the latest release.", + Text = Resources.UsingLatestRelease, VerticalAlignment = VerticalAlignment.Bottom }); } else if (currentVersion < availableVersion.Version) { stackPanel.Children.Add( new TextBlock { - Text = "Version " + availableVersion.Version + " is available.", + Text = string.Format(Resources.VersionAvailable, availableVersion.Version ), Margin = new Thickness(0,0,8,0), VerticalAlignment = VerticalAlignment.Bottom }); if (availableVersion.DownloadUrl != null) { Button button = new Button(); - button.Content = "Download"; + button.Content = Resources.Download; button.Cursor = Cursors.Arrow; button.Click += delegate { MainWindow.OpenLink(availableVersion.DownloadUrl); @@ -172,7 +173,7 @@ namespace ICSharpCode.ILSpy stackPanel.Children.Add(button); } } else { - stackPanel.Children.Add(new TextBlock { Text = "You are using a nightly build newer than the latest release." }); + stackPanel.Children.Add(new TextBlock { Text = Resources.UsingNightlyBuildNewerThanLatestRelease }); } } diff --git a/ILSpy/Commands/BrowseBackCommand.cs b/ILSpy/Commands/BrowseBackCommand.cs index d3a6c9ee2..a79f11855 100644 --- a/ILSpy/Commands/BrowseBackCommand.cs +++ b/ILSpy/Commands/BrowseBackCommand.cs @@ -17,10 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System.Windows.Input; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = "Back", ToolbarIcon = "Images/Back.png", ToolbarCategory = "Navigation", ToolbarOrder = 0)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Back), ToolbarIcon = "Images/Back.png", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 0)] sealed class BrowseBackCommand : CommandWrapper { public BrowseBackCommand() diff --git a/ILSpy/Commands/BrowseForwardCommand.cs b/ILSpy/Commands/BrowseForwardCommand.cs index 47674bc40..583ddede1 100644 --- a/ILSpy/Commands/BrowseForwardCommand.cs +++ b/ILSpy/Commands/BrowseForwardCommand.cs @@ -17,10 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System.Windows.Input; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = "Forward", ToolbarIcon = "Images/Forward.png", ToolbarCategory = "Navigation", ToolbarOrder = 1)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Forward), ToolbarIcon = "Images/Forward.png", ToolbarCategory = nameof(Resources.Navigation), ToolbarOrder = 1)] sealed class BrowseForwardCommand : CommandWrapper { public BrowseForwardCommand() diff --git a/ILSpy/Commands/CheckForUpdatesCommand.cs b/ILSpy/Commands/CheckForUpdatesCommand.cs index 87d0a6e99..179e26b6f 100644 --- a/ILSpy/Commands/CheckForUpdatesCommand.cs +++ b/ILSpy/Commands/CheckForUpdatesCommand.cs @@ -17,9 +17,11 @@ // DEALINGS IN THE SOFTWARE. +using ICSharpCode.ILSpy.Properties; + namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_Help", Header = "_Check for Updates", MenuOrder = 5000)] + [ExportMainMenuCommand(Menu = nameof(Resources._Help), Header = nameof(Resources._CheckUpdates), MenuOrder = 5000)] sealed class CheckForUpdatesCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/DecompileAllCommand.cs b/ILSpy/Commands/DecompileAllCommand.cs index 38d89fd68..6cb53e5c8 100644 --- a/ILSpy/Commands/DecompileAllCommand.cs +++ b/ILSpy/Commands/DecompileAllCommand.cs @@ -23,11 +23,12 @@ using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using ICSharpCode.Decompiler; +using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.TextView; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "DEBUG -- Decompile All", MenuCategory = "Open", MenuOrder = 2.5)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)] sealed class DecompileAllCommand : SimpleCommand { public override bool CanExecute(object parameter) @@ -67,7 +68,7 @@ namespace ICSharpCode.ILSpy } } - [ExportMainMenuCommand(Menu = "_File", Header = "DEBUG -- Decompile 100x", MenuCategory = "Open", MenuOrder = 2.6)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.DEBUGDecompile100x), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)] sealed class Decompile100TimesCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/DisassembleAllCommand.cs b/ILSpy/Commands/DisassembleAllCommand.cs index 32a7fc997..74af340a1 100644 --- a/ILSpy/Commands/DisassembleAllCommand.cs +++ b/ILSpy/Commands/DisassembleAllCommand.cs @@ -22,10 +22,10 @@ using System; using System.Diagnostics; using System.Threading.Tasks; using ICSharpCode.ILSpy.TextView; - +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "DEBUG -- Disassemble All", MenuCategory = "Open", MenuOrder = 2.5)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.DEBUGDisassemble), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)] sealed class DisassembleAllCommand : SimpleCommand { public override bool CanExecute(object parameter) diff --git a/ILSpy/Commands/ExitCommand.cs b/ILSpy/Commands/ExitCommand.cs index f6a215d22..a3be28e72 100644 --- a/ILSpy/Commands/ExitCommand.cs +++ b/ILSpy/Commands/ExitCommand.cs @@ -15,11 +15,11 @@ // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. - +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "E_xit", MenuOrder = 99999, MenuCategory = "Exit")] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.E_xit), MenuOrder = 99999, MenuCategory = nameof(Resources.Exit))] sealed class ExitCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/ExportCommandAttribute.cs b/ILSpy/Commands/ExportCommandAttribute.cs index 989131bcb..2c8f3962f 100644 --- a/ILSpy/Commands/ExportCommandAttribute.cs +++ b/ILSpy/Commands/ExportCommandAttribute.cs @@ -30,6 +30,7 @@ namespace ICSharpCode.ILSpy string ToolbarCategory { get; } object Tag { get; } double ToolbarOrder { get; } + } [MetadataAttribute] @@ -58,7 +59,6 @@ namespace ICSharpCode.ILSpy string MenuCategory { get; } string InputGestureText { get; } bool IsEnabled { get; } - double MenuOrder { get; } } diff --git a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs index f4ddd6fd9..b21625562 100644 --- a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs +++ b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs @@ -28,7 +28,7 @@ using ICSharpCode.Decompiler.DebugInfo; using ICSharpCode.ILSpy.TextView; using ICSharpCode.ILSpy.TreeNodes; using Microsoft.Win32; - +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { [ExportContextMenuEntry(Header = "Generate portable PDB")] @@ -86,7 +86,7 @@ namespace ICSharpCode.ILSpy } } - [ExportMainMenuCommand(Menu = "_File", Header = "Generate portable PDB", MenuCategory = "Save")] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = "Save")] class GeneratePdbMainMenuEntry : SimpleCommand { public override bool CanExecute(object parameter) diff --git a/ILSpy/Commands/OpenCommand.cs b/ILSpy/Commands/OpenCommand.cs index 4fdad2bb9..0f5e86ca9 100644 --- a/ILSpy/Commands/OpenCommand.cs +++ b/ILSpy/Commands/OpenCommand.cs @@ -17,11 +17,12 @@ // DEALINGS IN THE SOFTWARE. using System.Windows.Input; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = "Open", ToolbarIcon = "Images/Open.png", ToolbarCategory = "Open", ToolbarOrder = 0)] - [ExportMainMenuCommand(Menu = "_File", Header = "_Open...", MenuIcon = "Images/Open.png", MenuCategory = "Open", MenuOrder = 0)] + [ExportToolbarCommand(ToolTip = nameof(Resources.Open), ToolbarIcon = "Images/Open.png", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 0)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Open), MenuIcon = "Images/Open.png", MenuCategory = nameof(Resources.Open), MenuOrder = 0)] sealed class OpenCommand : CommandWrapper { public OpenCommand() diff --git a/ILSpy/Commands/OpenFromGacCommand.cs b/ILSpy/Commands/OpenFromGacCommand.cs index 258a182e3..8f7f008e7 100644 --- a/ILSpy/Commands/OpenFromGacCommand.cs +++ b/ILSpy/Commands/OpenFromGacCommand.cs @@ -16,10 +16,10 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. - +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "Open from _GAC...", MenuIcon = "Images/AssemblyListGAC.png", MenuCategory = "Open", MenuOrder = 1)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.OpenFrom_GAC), MenuIcon = "Images/AssemblyListGAC.png", MenuCategory = nameof(Resources.Open), MenuOrder = 1)] sealed class OpenFromGacCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/OpenListCommand.cs b/ILSpy/Commands/OpenListCommand.cs index b4bb05cac..e5fe22139 100644 --- a/ILSpy/Commands/OpenListCommand.cs +++ b/ILSpy/Commands/OpenListCommand.cs @@ -17,9 +17,11 @@ // DEALINGS IN THE SOFTWARE. +using ICSharpCode.ILSpy.Properties; + namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "Open _List...", MenuIcon = "Images/AssemblyList.png", MenuCategory = "Open", MenuOrder = 1.7)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.Open_List), MenuIcon = "Images/AssemblyList.png", MenuCategory = nameof(Resources.Open), MenuOrder = 1.7)] sealed class OpenListCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/RefreshCommand.cs b/ILSpy/Commands/RefreshCommand.cs index 6f3312b5f..96e421882 100644 --- a/ILSpy/Commands/RefreshCommand.cs +++ b/ILSpy/Commands/RefreshCommand.cs @@ -17,11 +17,12 @@ // DEALINGS IN THE SOFTWARE. using System.Windows.Input; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportToolbarCommand(ToolTip = "Reload all assemblies", ToolbarIcon = "Images/Refresh.png", ToolbarCategory = "Open", ToolbarOrder = 2)] - [ExportMainMenuCommand(Menu = "_File", Header = "_Reload", MenuIcon = "Images/Refresh.png", MenuCategory = "Open", MenuOrder = 2)] + [ExportToolbarCommand(ToolTip = nameof(Resources.RefreshCommand_ReloadAssemblies), ToolbarIcon = "Images/Refresh.png", ToolbarCategory = nameof(Resources.Open), ToolbarOrder = 2)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._Reload), MenuIcon = "Images/Refresh.png", MenuCategory = nameof(Resources.Open), MenuOrder = 2)] sealed class RefreshCommand : CommandWrapper { public RefreshCommand() diff --git a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs b/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs index 2570a0a7d..e67515444 100644 --- a/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs +++ b/ILSpy/Commands/RemoveAssembliesWithLoadErrors.cs @@ -19,10 +19,11 @@ using System; using System.Collections.Generic; using System.Linq; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "_Remove Assemblies with load errors", MenuCategory = "Remove", MenuOrder = 2.6)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._RemoveAssembliesWithLoadErrors), MenuCategory = nameof(Resources.Remove), MenuOrder = 2.6)] class RemoveAssembliesWithLoadErrors : SimpleCommand { public override bool CanExecute(object parameter) diff --git a/ILSpy/Commands/SaveCommand.cs b/ILSpy/Commands/SaveCommand.cs index f195fccf8..22da9c57c 100644 --- a/ILSpy/Commands/SaveCommand.cs +++ b/ILSpy/Commands/SaveCommand.cs @@ -17,10 +17,11 @@ // DEALINGS IN THE SOFTWARE. using System.Windows.Input; +using ICSharpCode.ILSpy.Properties; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_File", Header = "_Save Code...", MenuIcon = "Images/SaveFile.png", MenuCategory = "Save", MenuOrder = 0)] + [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources._SaveCode), MenuIcon = "Images/SaveFile.png", MenuCategory = nameof(Resources.Save), MenuOrder = 0)] sealed class SaveCommand : CommandWrapper { public SaveCommand() diff --git a/ILSpy/Commands/ShowDebugSteps.cs b/ILSpy/Commands/ShowDebugSteps.cs index c04c36594..d7b12f155 100644 --- a/ILSpy/Commands/ShowDebugSteps.cs +++ b/ILSpy/Commands/ShowDebugSteps.cs @@ -1,8 +1,10 @@ #if DEBUG +using ICSharpCode.ILSpy.Properties; + namespace ICSharpCode.ILSpy.Commands { - [ExportMainMenuCommand(Menu = "_View", Header = "_Show debug steps", MenuOrder = 5000)] + [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources._ShowDebugSteps), MenuOrder = 5000)] class ShowDebugSteps : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Commands/SortAssemblyListCommand.cs b/ILSpy/Commands/SortAssemblyListCommand.cs index a161d373b..b205cc03a 100644 --- a/ILSpy/Commands/SortAssemblyListCommand.cs +++ b/ILSpy/Commands/SortAssemblyListCommand.cs @@ -18,12 +18,13 @@ using System; using System.Collections.Generic; +using ICSharpCode.ILSpy.Properties; using ICSharpCode.TreeView; namespace ICSharpCode.ILSpy { - [ExportMainMenuCommand(Menu = "_View", Header = "Sort assembly _list by name", MenuIcon = "Images/Sort.png", MenuCategory = "View")] - [ExportToolbarCommand(ToolTip = "Sort assembly list by name", ToolbarIcon = "Images/Sort.png", ToolbarCategory = "View")] + [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources.SortAssembly_listName), MenuIcon = "Images/Sort.png", MenuCategory = nameof(Resources.View))] + [ExportToolbarCommand(ToolTip = nameof(Resources.SortAssemblyListName), ToolbarIcon = "Images/Sort.png", ToolbarCategory = nameof(Resources.View))] sealed class SortAssemblyListCommand : SimpleCommand, IComparer { public override void Execute(object parameter) @@ -38,8 +39,8 @@ namespace ICSharpCode.ILSpy } } - [ExportMainMenuCommand(Menu = "_View", Header = "_Collapse all tree nodes", MenuIcon = "Images/CollapseAll.png", MenuCategory = "View")] - [ExportToolbarCommand(ToolTip = "Collapse all tree nodes", ToolbarIcon = "Images/CollapseAll.png", ToolbarCategory = "View")] + [ExportMainMenuCommand(Menu = nameof(Resources._View), Header = nameof(Resources._CollapseTreeNodes), MenuIcon = "Images/CollapseAll.png", MenuCategory = nameof(Resources.View))] + [ExportToolbarCommand(ToolTip = nameof(Resources.CollapseTreeNodes), ToolbarIcon = "Images/CollapseAll.png", ToolbarCategory = nameof(Resources.View))] sealed class CollapseAllCommand : SimpleCommand { public override void Execute(object parameter) diff --git a/ILSpy/Controls/ResourceObjectTable.xaml b/ILSpy/Controls/ResourceObjectTable.xaml index 7e8d5977a..f019fa7de 100644 --- a/ILSpy/Controls/ResourceObjectTable.xaml +++ b/ILSpy/Controls/ResourceObjectTable.xaml @@ -2,6 +2,7 @@ - - - diff --git a/ILSpy/Controls/ResourceStringTable.xaml b/ILSpy/Controls/ResourceStringTable.xaml index 49553b588..231a1eac2 100644 --- a/ILSpy/Controls/ResourceStringTable.xaml +++ b/ILSpy/Controls/ResourceStringTable.xaml @@ -2,6 +2,7 @@ -