changeset 26:63919afde887

Re #47: Add translatable GTK# widgets * Add methods for translating buttons (public and not using ITranslatable because it works around Stetic limitations by letting the developer define what is translated)
author IBBoard <dev@ibboard.co.uk>
date Wed, 29 Dec 2010 19:40:02 +0000
parents f71693260828
children 2d76577e28ff
files Translatable/ControlTranslator.cs
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Translatable/ControlTranslator.cs	Wed Dec 29 16:57:25 2010 +0000
+++ b/Translatable/ControlTranslator.cs	Wed Dec 29 19:40:02 2010 +0000
@@ -81,6 +81,21 @@
 		{
 			action.Label = Translation.GetTranslation(action.Name, action.Label);
 		}
+
+		public static void TranslateButtons(params Button[] buttons)
+		{
+			foreach (Button button in buttons)
+			{
+				TranslateButton(button);
+			}
+		}
+
+		public static void TranslateButton(Button button)
+		{
+			Widget image = button.Image;
+			button.Label = Translation.GetTranslation(button.Name, button.Label);
+			button.Image = image;
+		}
 	}
 }