changeset 11:d052bc59cb22

Fixes #27: Create translatable menu items for new menus * Create translatable menu items for warfoundry:#258 * Add sub-item translation handling to ControlTranslator
author IBBoard <dev@ibboard.co.uk>
date Sun, 07 Mar 2010 20:52:18 +0000
parents fa95b81901f5
children 7274f305eb49
files IBBoard.Windows.Forms.csproj Windows/Forms/I18N/ControlTranslator.cs Windows/Forms/IBBToolStripMenuItem.cs
diffstat 3 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/IBBoard.Windows.Forms.csproj	Thu Dec 24 20:28:07 2009 +0000
+++ b/IBBoard.Windows.Forms.csproj	Sun Mar 07 20:52:18 2010 +0000
@@ -98,6 +98,9 @@
     <Compile Include="Windows\Forms\IBBToolBarButton.cs">
       <SubType>Component</SubType>
     </Compile>
+    <Compile Include="Windows\Forms\IBBToolStripMenuItem.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="Windows\Forms\ListViewColumnSorter.cs">
       <SubType>Code</SubType>
     </Compile>
--- a/Windows/Forms/I18N/ControlTranslator.cs	Thu Dec 24 20:28:07 2009 +0000
+++ b/Windows/Forms/I18N/ControlTranslator.cs	Sun Mar 07 20:52:18 2010 +0000
@@ -69,6 +69,13 @@
 					TranslateComponent(bttn, true, replacements);
 				}
 			}
+			else if (ctrl is ToolStrip)
+			{
+				foreach (ToolStripItem item in ((ToolStrip)ctrl).Items)
+				{
+					TranslateComponent(item, true, replacements);
+				}
+			}
 			else
 			{
 				foreach (Control subctr in ctrl.Controls)
@@ -116,6 +123,13 @@
 					TranslateComponent(mi, true, replacements);
 				}
 			}
+			else if (comp is ToolStripDropDownItem)
+			{
+				foreach (ToolStripItem item in ((ToolStripDropDownItem)comp).DropDownItems)
+				{
+					TranslateComponent(item, true, replacements);
+				}
+			}
 		}
 	}
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Windows/Forms/IBBToolStripMenuItem.cs	Sun Mar 07 20:52:18 2010 +0000
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using IBBoard.Lang;
+
+namespace IBBoard.Windows.Forms
+{
+	public partial class IBBToolStripMenuItem : ToolStripMenuItem, ITranslatable
+	{
+		//Marker interface for translation
+	}
+}