# HG changeset patch # User IBBoard # Date 1327163720 0 # Node ID 5f35edc84791e92eeee30b6a2014ede92fe71e93 # Parent 3a0dea3d6996fdd3eea29f1857c6259ab5c43e54 * Add translatable tab control for warfoundry:ticket:383 diff -r 3a0dea3d6996 -r 5f35edc84791 IBBoard.Windows.Forms.csproj --- a/IBBoard.Windows.Forms.csproj Sat Sep 24 12:01:17 2011 +0100 +++ b/IBBoard.Windows.Forms.csproj Sat Jan 21 16:35:20 2012 +0000 @@ -88,6 +88,9 @@ Code + + Component + Component diff -r 3a0dea3d6996 -r 5f35edc84791 Windows/Forms/I18N/ControlTranslator.cs --- a/Windows/Forms/I18N/ControlTranslator.cs Sat Sep 24 12:01:17 2011 +0100 +++ b/Windows/Forms/I18N/ControlTranslator.cs Sat Jan 21 16:35:20 2012 +0000 @@ -85,10 +85,17 @@ { TranslateComponent(item, true, replacements); } - } - else - { - TranslateControls(ctrl.Controls); + } + else if (ctrl is IBBTabControl) + { + foreach (TabPage page in ((IBBTabControl)ctrl).TabPages) + { + page.Text = Translation.GetTranslation(page.Name, page.Text); + } + } + else + { + TranslateControls(ctrl.Controls); } } diff -r 3a0dea3d6996 -r 5f35edc84791 Windows/Forms/IBBTabControl.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Windows/Forms/IBBTabControl.cs Sat Jan 21 16:35:20 2012 +0000 @@ -0,0 +1,14 @@ +// This file (IBBTabControl.cs) is a part of the IBBoard.Windows.Forms library and is copyright 2012 IBBoard. +// +// The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. + +using System; +using System.Windows.Forms; +using IBBoard.Lang; + +namespace IBBoard.Windows.Forms +{ + public class IBBTabControl : TabControl, ITranslatable + { + } +}