Mercurial > repos > IBBoard.GtkSharp
comparison Translatable/ControlTranslator.cs @ 20:06715f517af6
Re #47: Add translatable GTK# widgets
* Add ITranslatableWithActions interface to provide a common way to get at actions (WinForms menu items are widgets, GTK uses Actions and ActionGroups)
* Add implementation of interface for Windows (most likely candidate for having translatable actions)
* Translate actions as well as sub-widgets
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 27 Dec 2010 20:48:29 +0000 |
parents | 2ddde7f1730e |
children | 0364560fcec2 |
comparison
equal
deleted
inserted
replaced
19:2ddde7f1730e | 20:06715f517af6 |
---|---|
36 { | 36 { |
37 foreach (Widget childWidget in container.AllChildren) | 37 foreach (Widget childWidget in container.AllChildren) |
38 { | 38 { |
39 TranslateWidget(childWidget, cascade); | 39 TranslateWidget(childWidget, cascade); |
40 } | 40 } |
41 | |
42 if (container is ITranslatableWithActions) | |
43 { | |
44 TranslateActions((ITranslatableWithActions)container); | |
45 } | |
41 } | 46 } |
42 | 47 |
48 private static void TranslateActions(ITranslatableWithActions actionContainer) | |
49 { | |
50 foreach (Action action in actionContainer.Actions) | |
51 { | |
52 if (action is ITranslatable) | |
53 { | |
54 Translation.Translate((ITranslatable)action); | |
55 } | |
56 } | |
57 } | |
43 } | 58 } |
44 } | 59 } |
45 | 60 |