Mercurial > repos > IBBoard.Windows.Forms
diff Windows/Forms/I18N/ControlTranslator.cs @ 15:7c459ebc4210
* Code clean-up and documentation
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 18 Apr 2010 15:04:21 +0000 |
parents | 774fd3daefe1 |
children | 5f35edc84791 |
line wrap: on
line diff
--- a/Windows/Forms/I18N/ControlTranslator.cs Wed Apr 14 19:40:40 2010 +0000 +++ b/Windows/Forms/I18N/ControlTranslator.cs Sun Apr 18 15:04:21 2010 +0000 @@ -11,6 +11,12 @@ namespace IBBoard.Windows.Forms.I18N { + /// <summary> + /// A custom cascading translator. It take any widget type (controls or components) and translates them + /// if they implement <see>ITranslatable</see> and optionally cascades the process to translate all children. + /// + /// Note: Translations <strong>will not</strong> cascade into MdiClient controls + /// </summary> public class ControlTranslator { /// <summary> @@ -21,7 +27,11 @@ { foreach (Control ctrl in controls) { - ControlTranslator.TranslateControl(ctrl); + if (!(ctrl is MdiClient)) + { + //Client windows must translate themselves + ControlTranslator.TranslateControl(ctrl); + } } } @@ -78,10 +88,7 @@ } else { - foreach (Control subctr in ctrl.Controls) - { - TranslateControl(subctr, true, replacements); - } + TranslateControls(ctrl.Controls); } }