# HG changeset patch # User IBBoard # Date 1293651602 0 # Node ID 63919afde887f23722ab2e4dbfb7356fef2e8232 # Parent f716932608283897b95236a8069d8c0ebfe0ab65 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) diff -r f71693260828 -r 63919afde887 Translatable/ControlTranslator.cs --- 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; + } } }