# HG changeset patch # User IBBoard # Date 1293641815 0 # Node ID bfb29a60b802eed331685b088318def54a918f30 # Parent 9db2112b31d7d9b11b8f21ee0a2827836b259e2b Re #308: Make GTK# UI translatable * Translate the bits of FrmNewArmy that can't be translated via cascade * Set up label names and translations for translating (need to get Stetic to use TranslatableLabel) diff -r 9db2112b31d7 -r bfb29a60b802 FrmNewArmy.cs --- a/FrmNewArmy.cs Wed Dec 29 16:32:15 2010 +0000 +++ b/FrmNewArmy.cs Wed Dec 29 16:56:55 2010 +0000 @@ -36,7 +36,7 @@ raceColumn.PackStart(raceCell, true); lstRaces.AppendColumn(raceColumn); raceColumn.SetCellDataFunc(raceCell, GtkWarFoundryUtil.RenderWarFoundryObjectName); - ControlTranslator.TranslateWidget(this); + Translate(); if (gameSystem != null) { @@ -48,6 +48,13 @@ } } + protected override void Translate() + { + base.Translate(); + bttnCreate.Label = Translation.GetTranslation("bttnCreate", "create"); + bttnCancel.Label = Translation.GetTranslation("bttnCancel", "cancel"); + } + protected virtual void OnSelectionChanged(object o, EventArgs e) { logger.Debug("Race selection changed"); diff -r 9db2112b31d7 -r bfb29a60b802 gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs Wed Dec 29 16:32:15 2010 +0000 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs Wed Dec 29 16:56:55 2010 +0000 @@ -9,10 +9,10 @@ private global::Gtk.TreeView lstRaces; private global::Gtk.HBox hbox2; private global::Gtk.SpinButton sbPointsValue; - private global::Gtk.Label label1; - private global::Gtk.Label label2; - private global::Gtk.Label label3; - private global::Gtk.Label label4; + private global::Gtk.Label lblArmyName; + private global::Gtk.Label lblArmySize; + private global::Gtk.Label lblGameSystem; + private global::Gtk.Label lblRace; private global::Gtk.ComboBoxEntry systemCombo; private global::Gtk.Entry txtArmyName; private global::Gtk.Button bttnCancel; @@ -86,41 +86,41 @@ w5.XOptions = ((global::Gtk.AttachOptions)(4)); w5.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label1 = new global::Gtk.Label(); - this.label1.Name = "label1"; - this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Race"); - this.table1.Add(this.label1); - global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.label1])); - w6.TopAttach = ((uint)(1)); - w6.BottomAttach = ((uint)(2)); + this.lblArmyName = new global::Gtk.Label(); + this.lblArmyName.Name = "lblArmyName"; + this.lblArmyName.LabelProp = global::Mono.Unix.Catalog.GetString("army name"); + this.table1.Add(this.lblArmyName); + global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmyName])); + w6.TopAttach = ((uint)(2)); + w6.BottomAttach = ((uint)(3)); w6.XOptions = ((global::Gtk.AttachOptions)(4)); w6.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label2 = new global::Gtk.Label(); - this.label2.Name = "label2"; - this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Army name"); - this.table1.Add(this.label2); - global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.label2])); - w7.TopAttach = ((uint)(2)); - w7.BottomAttach = ((uint)(3)); + this.lblArmySize = new global::Gtk.Label(); + this.lblArmySize.Name = "lblArmySize"; + this.lblArmySize.LabelProp = global::Mono.Unix.Catalog.GetString("points value"); + this.table1.Add(this.lblArmySize); + global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmySize])); + w7.TopAttach = ((uint)(3)); + w7.BottomAttach = ((uint)(4)); w7.XOptions = ((global::Gtk.AttachOptions)(4)); w7.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label3 = new global::Gtk.Label(); - this.label3.Name = "label3"; - this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Points value"); - this.table1.Add(this.label3); - global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.label3])); - w8.TopAttach = ((uint)(3)); - w8.BottomAttach = ((uint)(4)); + this.lblGameSystem = new global::Gtk.Label(); + this.lblGameSystem.Name = "lblGameSystem"; + this.lblGameSystem.LabelProp = global::Mono.Unix.Catalog.GetString("game system"); + this.table1.Add(this.lblGameSystem); + global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.lblGameSystem])); w8.XOptions = ((global::Gtk.AttachOptions)(4)); w8.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild - this.label4 = new global::Gtk.Label(); - this.label4.Name = "label4"; - this.label4.LabelProp = global::Mono.Unix.Catalog.GetString("game system"); - this.table1.Add(this.label4); - global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.label4])); + 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])); + w9.TopAttach = ((uint)(1)); + w9.BottomAttach = ((uint)(2)); w9.XOptions = ((global::Gtk.AttachOptions)(4)); w9.YOptions = ((global::Gtk.AttachOptions)(4)); // Container child table1.Gtk.Table+TableChild diff -r 9db2112b31d7 -r bfb29a60b802 gtk-gui/gui.stetic --- a/gtk-gui/gui.stetic Wed Dec 29 16:32:15 2010 +0000 +++ b/gtk-gui/gui.stetic Wed Dec 29 16:56:55 2010 +0000 @@ -377,28 +377,9 @@ - + - Race - - - 1 - 2 - True - Fill - Fill - False - True - False - False - True - False - - - - - - Army name + army name 2 @@ -415,9 +396,9 @@ - + - Points value + points value 3 @@ -434,7 +415,7 @@ - + game system @@ -451,6 +432,25 @@ + + + race + + + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + + True diff -r 9db2112b31d7 -r bfb29a60b802 translations/en.translation --- a/translations/en.translation Wed Dec 29 16:32:15 2010 +0000 +++ b/translations/en.translation Wed Dec 29 16:56:55 2010 +0000 @@ -26,19 +26,16 @@ Army Categories Remove Unit WarFoundry Army Files (*.army) -Create army +Game systems: +Races: +Army name: +Army size: +Create army Cancel Create unit Unit types: -Races: -Army name: Select system -Game systems: -Game system selection -Army tree -Create new army Save army -Army size: Unit of {0} {1} {0} pts / {1} pts Create Army