From 9c7665915827495b8e84b59b59f3400bafce8eb6 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 30 Aug 2014 23:52:39 +0200 Subject: [PATCH] make ComboBox items of TaskListPad translatable --- data/resources/StringResources.resx | 18 ++++++++++++++++++ .../Gui/Pads/TaskList/TaskListPadCommands.cs | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index 3de78c039c..50adcf0594 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -8219,4 +8219,22 @@ a line break Break on handled ${ExceptionName} + + Solution + + + Project + + + All opened files + + + File + + + Namespace + + + Class/Module + \ No newline at end of file diff --git a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs index 994995328a..851042f315 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPadCommands.cs @@ -17,6 +17,7 @@ // DEALINGS IN THE SOFTWARE. using System; +using System.Linq; using System.Windows; using System.Windows.Controls; using ICSharpCode.Core; @@ -25,12 +26,11 @@ namespace ICSharpCode.SharpDevelop.Gui { public class SelectScopeComboBox : ComboBox { - // TODO Translate! - static readonly string[] viewTypes = new string[] {"Solution", "Project", "All open files", "File", "Namespace", "Class/Module"}; + static readonly string[] viewTypes = {"${res:MainWindow.Windows.TaskList.Solution}", "${res:MainWindow.Windows.TaskList.Project}", "${res:MainWindow.Windows.TaskList.AllOpenedFiles}", "${res:MainWindow.Windows.TaskList.CurrentFile}", "${res:MainWindow.Windows.TaskList.Namespace}", "${res:MainWindow.Windows.TaskList.CurrentClass}"}; public SelectScopeComboBox() { - this.ItemsSource = viewTypes; + this.ItemsSource = viewTypes.Select(s => StringParser.Parse(s)); this.SelectedIndex = 0; }