changeset 85:bfb29a60b802

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)
author IBBoard <dev@ibboard.co.uk>
date Wed, 29 Dec 2010 16:56:55 +0000
parents 9db2112b31d7
children 9515b57ba752
files FrmNewArmy.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs gtk-gui/gui.stetic translations/en.translation
diffstat 4 files changed, 67 insertions(+), 63 deletions(-) [+]
line diff
     1.1 --- a/FrmNewArmy.cs	Wed Dec 29 16:32:15 2010 +0000
     1.2 +++ b/FrmNewArmy.cs	Wed Dec 29 16:56:55 2010 +0000
     1.3 @@ -36,7 +36,7 @@
     1.4  			raceColumn.PackStart(raceCell, true);
     1.5  			lstRaces.AppendColumn(raceColumn);
     1.6  			raceColumn.SetCellDataFunc(raceCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
     1.7 -			ControlTranslator.TranslateWidget(this);
     1.8 +			Translate();
     1.9  			
    1.10  			if (gameSystem != null)
    1.11  			{
    1.12 @@ -48,6 +48,13 @@
    1.13  			}
    1.14  		}
    1.15  
    1.16 +		protected override void Translate()
    1.17 +		{
    1.18 +			base.Translate();
    1.19 +			bttnCreate.Label = Translation.GetTranslation("bttnCreate", "create");
    1.20 +			bttnCancel.Label = Translation.GetTranslation("bttnCancel", "cancel");
    1.21 +		}
    1.22 +
    1.23  		protected virtual void OnSelectionChanged(object o, EventArgs e)
    1.24  		{
    1.25  			logger.Debug("Race selection changed");
     2.1 --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs	Wed Dec 29 16:32:15 2010 +0000
     2.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs	Wed Dec 29 16:56:55 2010 +0000
     2.3 @@ -9,10 +9,10 @@
     2.4  		private global::Gtk.TreeView lstRaces;
     2.5  		private global::Gtk.HBox hbox2;
     2.6  		private global::Gtk.SpinButton sbPointsValue;
     2.7 -		private global::Gtk.Label label1;
     2.8 -		private global::Gtk.Label label2;
     2.9 -		private global::Gtk.Label label3;
    2.10 -		private global::Gtk.Label label4;
    2.11 +		private global::Gtk.Label lblArmyName;
    2.12 +		private global::Gtk.Label lblArmySize;
    2.13 +		private global::Gtk.Label lblGameSystem;
    2.14 +		private global::Gtk.Label lblRace;
    2.15  		private global::Gtk.ComboBoxEntry systemCombo;
    2.16  		private global::Gtk.Entry txtArmyName;
    2.17  		private global::Gtk.Button bttnCancel;
    2.18 @@ -86,41 +86,41 @@
    2.19  			w5.XOptions = ((global::Gtk.AttachOptions)(4));
    2.20  			w5.YOptions = ((global::Gtk.AttachOptions)(4));
    2.21  			// Container child table1.Gtk.Table+TableChild
    2.22 -			this.label1 = new global::Gtk.Label();
    2.23 -			this.label1.Name = "label1";
    2.24 -			this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Race");
    2.25 -			this.table1.Add(this.label1);
    2.26 -			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
    2.27 -			w6.TopAttach = ((uint)(1));
    2.28 -			w6.BottomAttach = ((uint)(2));
    2.29 +			this.lblArmyName = new global::Gtk.Label();
    2.30 +			this.lblArmyName.Name = "lblArmyName";
    2.31 +			this.lblArmyName.LabelProp = global::Mono.Unix.Catalog.GetString("army name");
    2.32 +			this.table1.Add(this.lblArmyName);
    2.33 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmyName]));
    2.34 +			w6.TopAttach = ((uint)(2));
    2.35 +			w6.BottomAttach = ((uint)(3));
    2.36  			w6.XOptions = ((global::Gtk.AttachOptions)(4));
    2.37  			w6.YOptions = ((global::Gtk.AttachOptions)(4));
    2.38  			// Container child table1.Gtk.Table+TableChild
    2.39 -			this.label2 = new global::Gtk.Label();
    2.40 -			this.label2.Name = "label2";
    2.41 -			this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Army name");
    2.42 -			this.table1.Add(this.label2);
    2.43 -			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.label2]));
    2.44 -			w7.TopAttach = ((uint)(2));
    2.45 -			w7.BottomAttach = ((uint)(3));
    2.46 +			this.lblArmySize = new global::Gtk.Label();
    2.47 +			this.lblArmySize.Name = "lblArmySize";
    2.48 +			this.lblArmySize.LabelProp = global::Mono.Unix.Catalog.GetString("points value");
    2.49 +			this.table1.Add(this.lblArmySize);
    2.50 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmySize]));
    2.51 +			w7.TopAttach = ((uint)(3));
    2.52 +			w7.BottomAttach = ((uint)(4));
    2.53  			w7.XOptions = ((global::Gtk.AttachOptions)(4));
    2.54  			w7.YOptions = ((global::Gtk.AttachOptions)(4));
    2.55  			// Container child table1.Gtk.Table+TableChild
    2.56 -			this.label3 = new global::Gtk.Label();
    2.57 -			this.label3.Name = "label3";
    2.58 -			this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Points value");
    2.59 -			this.table1.Add(this.label3);
    2.60 -			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.label3]));
    2.61 -			w8.TopAttach = ((uint)(3));
    2.62 -			w8.BottomAttach = ((uint)(4));
    2.63 +			this.lblGameSystem = new global::Gtk.Label();
    2.64 +			this.lblGameSystem.Name = "lblGameSystem";
    2.65 +			this.lblGameSystem.LabelProp = global::Mono.Unix.Catalog.GetString("game system");
    2.66 +			this.table1.Add(this.lblGameSystem);
    2.67 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.lblGameSystem]));
    2.68  			w8.XOptions = ((global::Gtk.AttachOptions)(4));
    2.69  			w8.YOptions = ((global::Gtk.AttachOptions)(4));
    2.70  			// Container child table1.Gtk.Table+TableChild
    2.71 -			this.label4 = new global::Gtk.Label();
    2.72 -			this.label4.Name = "label4";
    2.73 -			this.label4.LabelProp = global::Mono.Unix.Catalog.GetString("game system");
    2.74 -			this.table1.Add(this.label4);
    2.75 -			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.label4]));
    2.76 +			this.lblRace = new global::Gtk.Label();
    2.77 +			this.lblRace.Name = "lblRace";
    2.78 +			this.lblRace.LabelProp = global::Mono.Unix.Catalog.GetString("race");
    2.79 +			this.table1.Add(this.lblRace);
    2.80 +			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.lblRace]));
    2.81 +			w9.TopAttach = ((uint)(1));
    2.82 +			w9.BottomAttach = ((uint)(2));
    2.83  			w9.XOptions = ((global::Gtk.AttachOptions)(4));
    2.84  			w9.YOptions = ((global::Gtk.AttachOptions)(4));
    2.85  			// Container child table1.Gtk.Table+TableChild
     3.1 --- a/gtk-gui/gui.stetic	Wed Dec 29 16:32:15 2010 +0000
     3.2 +++ b/gtk-gui/gui.stetic	Wed Dec 29 16:56:55 2010 +0000
     3.3 @@ -377,28 +377,9 @@
     3.4                </packing>
     3.5              </child>
     3.6              <child>
     3.7 -              <widget class="Gtk.Label" id="label1">
     3.8 +              <widget class="Gtk.Label" id="lblArmyName">
     3.9                  <property name="MemberName" />
    3.10 -                <property name="LabelProp" translatable="yes">Race</property>
    3.11 -              </widget>
    3.12 -              <packing>
    3.13 -                <property name="TopAttach">1</property>
    3.14 -                <property name="BottomAttach">2</property>
    3.15 -                <property name="AutoSize">True</property>
    3.16 -                <property name="XOptions">Fill</property>
    3.17 -                <property name="YOptions">Fill</property>
    3.18 -                <property name="XExpand">False</property>
    3.19 -                <property name="XFill">True</property>
    3.20 -                <property name="XShrink">False</property>
    3.21 -                <property name="YExpand">False</property>
    3.22 -                <property name="YFill">True</property>
    3.23 -                <property name="YShrink">False</property>
    3.24 -              </packing>
    3.25 -            </child>
    3.26 -            <child>
    3.27 -              <widget class="Gtk.Label" id="label2">
    3.28 -                <property name="MemberName" />
    3.29 -                <property name="LabelProp" translatable="yes">Army name</property>
    3.30 +                <property name="LabelProp" translatable="yes">army name</property>
    3.31                </widget>
    3.32                <packing>
    3.33                  <property name="TopAttach">2</property>
    3.34 @@ -415,9 +396,9 @@
    3.35                </packing>
    3.36              </child>
    3.37              <child>
    3.38 -              <widget class="Gtk.Label" id="label3">
    3.39 +              <widget class="Gtk.Label" id="lblArmySize">
    3.40                  <property name="MemberName" />
    3.41 -                <property name="LabelProp" translatable="yes">Points value</property>
    3.42 +                <property name="LabelProp" translatable="yes">points value</property>
    3.43                </widget>
    3.44                <packing>
    3.45                  <property name="TopAttach">3</property>
    3.46 @@ -434,7 +415,7 @@
    3.47                </packing>
    3.48              </child>
    3.49              <child>
    3.50 -              <widget class="Gtk.Label" id="label4">
    3.51 +              <widget class="Gtk.Label" id="lblGameSystem">
    3.52                  <property name="MemberName" />
    3.53                  <property name="LabelProp" translatable="yes">game system</property>
    3.54                </widget>
    3.55 @@ -451,6 +432,25 @@
    3.56                </packing>
    3.57              </child>
    3.58              <child>
    3.59 +              <widget class="Gtk.Label" id="lblRace">
    3.60 +                <property name="MemberName" />
    3.61 +                <property name="LabelProp" translatable="yes">race</property>
    3.62 +              </widget>
    3.63 +              <packing>
    3.64 +                <property name="TopAttach">1</property>
    3.65 +                <property name="BottomAttach">2</property>
    3.66 +                <property name="AutoSize">True</property>
    3.67 +                <property name="XOptions">Fill</property>
    3.68 +                <property name="YOptions">Fill</property>
    3.69 +                <property name="XExpand">False</property>
    3.70 +                <property name="XFill">True</property>
    3.71 +                <property name="XShrink">False</property>
    3.72 +                <property name="YExpand">False</property>
    3.73 +                <property name="YFill">True</property>
    3.74 +                <property name="YShrink">False</property>
    3.75 +              </packing>
    3.76 +            </child>
    3.77 +            <child>
    3.78                <widget class="Gtk.ComboBoxEntry" id="systemCombo">
    3.79                  <property name="MemberName" />
    3.80                  <property name="IsTextCombo">True</property>
     4.1 --- a/translations/en.translation	Wed Dec 29 16:32:15 2010 +0000
     4.2 +++ b/translations/en.translation	Wed Dec 29 16:56:55 2010 +0000
     4.3 @@ -26,19 +26,16 @@
     4.4  <translation id="armyCategoryColumnTitle">Army Categories</translation>
     4.5  <translation id="menuRemoveUnit">Remove Unit</translation>
     4.6  <translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation>
     4.7 -<translation id="bttnSelectRace">Create army</translation>
     4.8 +<translation id="lblGameSystem">Game systems:</translation>
     4.9 +<translation id="lblRaceList">Races:</translation>
    4.10 +<translation id="lblArmyName">Army name:</translation>
    4.11 +<translation id="lblArmySize">Army size:</translation>
    4.12 +<translation id="bttnCreate">Create army</translation>
    4.13  <translation id="bttnCancel">Cancel</translation>
    4.14  <translation id="bttnSelectUnit">Create unit</translation>
    4.15  <translation id="lblUnitList">Unit types:</translation>
    4.16 -<translation id="lblRaceList">Races:</translation>
    4.17 -<translation id="lblArmyName">Army name:</translation>
    4.18  <translation id="bttnSelectSystem">Select system</translation>
    4.19 -<translation id="lblSystemList">Game systems:</translation>
    4.20 -<translation id="FrmSelectSystem">Game system selection</translation>
    4.21 -<translation id="ArmyTree">Army tree</translation>
    4.22 -<translation id="FrmNewArmy">Create new army</translation>
    4.23  <translation id="saveArmyDialog">Save army</translation>
    4.24 -<translation id="lblArmySize">Army size:</translation>
    4.25  <translation id="defaultUnitName">Unit of {0} {1}</translation>
    4.26  <translation id="statusPanelPoints">{0} pts / {1} pts</translation>
    4.27  <translation id="IBBoard.WarFoundry.GUI.GTK.FrmNewArmy">Create Army</translation>