# HG changeset patch # User IBBoard # Date 1293651711 0 # Node ID 9515b57ba7526f744000b0b62f827256540e0796 # Parent bfb29a60b802eed331685b088318def54a918f30 Re #308: Make GTK# UI translatable * Make form buttons translatable using new method * Swap "Create" button to a stock "OK" so that we don't lose the image on translation diff -r bfb29a60b802 -r 9515b57ba752 FrmNewArmy.cs --- a/FrmNewArmy.cs Wed Dec 29 16:56:55 2010 +0000 +++ b/FrmNewArmy.cs Wed Dec 29 19:41:51 2010 +0000 @@ -51,8 +51,7 @@ protected override void Translate() { base.Translate(); - bttnCreate.Label = Translation.GetTranslation("bttnCreate", "create"); - bttnCancel.Label = Translation.GetTranslation("bttnCancel", "cancel"); + ControlTranslator.TranslateButtons(bttnCreate, bttnCancel); } protected virtual void OnSelectionChanged(object o, EventArgs e) diff -r bfb29a60b802 -r 9515b57ba752 gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs Wed Dec 29 16:56:55 2010 +0000 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs Wed Dec 29 19:41:51 2010 +0000 @@ -12,7 +12,7 @@ private global::Gtk.Label lblArmyName; private global::Gtk.Label lblArmySize; private global::Gtk.Label lblGameSystem; - private global::Gtk.Label lblRace; + private global::Gtk.Label lblRaceList; private global::Gtk.ComboBoxEntry systemCombo; private global::Gtk.Entry txtArmyName; private global::Gtk.Button bttnCancel; @@ -114,11 +114,11 @@ w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.lblRace = new global::Gtk.Label(); - this.lblRace.Name = "lblRace"; - this.lblRace.LabelProp = global::Mono.Unix.Catalog.GetString("race"); - this.table1.Add(this.lblRace); - global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.lblRace])); + this.lblRaceList = new global::Gtk.Label(); + this.lblRaceList.Name = "lblRaceList"; + this.lblRaceList.LabelProp = global::Mono.Unix.Catalog.GetString("race"); + this.table1.Add(this.lblRaceList); + global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.lblRaceList])); w9.TopAttach = ((uint)(1)); w9.BottomAttach = ((uint)(2)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); @@ -176,28 +176,14 @@ this.bttnCreate.CanDefault = true; this.bttnCreate.CanFocus = true; this.bttnCreate.Name = "bttnCreate"; + this.bttnCreate.UseStock = true; this.bttnCreate.UseUnderline = true; - // Container child bttnCreate.Gtk.Container+ContainerChild - global::Gtk.Alignment w15 = new global::Gtk.Alignment(0.5F, 0.5F, 0F, 0F); - // Container child GtkAlignment.Gtk.Container+ContainerChild - global::Gtk.HBox w16 = new global::Gtk.HBox(); - w16.Spacing = 2; - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Image w17 = new global::Gtk.Image(); - w17.Pixbuf = global::Stetic.IconLoader.LoadIcon(this, "gtk-ok", global::Gtk.IconSize.Menu); - w16.Add(w17); - // Container child GtkHBox.Gtk.Container+ContainerChild - global::Gtk.Label w19 = new global::Gtk.Label(); - w19.LabelProp = global::Mono.Unix.Catalog.GetString("C_reate"); - w19.UseUnderline = true; - w16.Add(w19); - w15.Add(w16); - this.bttnCreate.Add(w15); + this.bttnCreate.Label = "gtk-ok"; this.AddActionWidget(this.bttnCreate, -5); - global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate])); - w23.Position = 1; - w23.Expand = false; - w23.Fill = false; + global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate])); + w15.Position = 1; + w15.Expand = false; + w15.Fill = false; if ((this.Child != null)) { this.Child.ShowAll(); diff -r bfb29a60b802 -r 9515b57ba752 gtk-gui/gui.stetic --- a/gtk-gui/gui.stetic Wed Dec 29 16:56:55 2010 +0000 +++ b/gtk-gui/gui.stetic Wed Dec 29 19:41:51 2010 +0000 @@ -5,8 +5,8 @@ 2.12 - - + + @@ -432,7 +432,7 @@ - + race @@ -536,12 +536,12 @@ False True True - TextAndIcon - stock:gtk-ok Menu - C_reate - True + True + StockItem + gtk-ok -5 + gtk-ok 1