changeset 82:fb16ca1cb52b

Re #308: Make GTK# UI translatable * Match button names to WinForms for consistency * Translate army column title
author IBBoard <dev@ibboard.co.uk>
date Tue, 28 Dec 2010 20:20:16 +0000
parents 3ff8e10de45a
children 678e9a0392fc
files FrmMainWindow.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs gtk-gui/gui.stetic translations/en.translation
diffstat 4 files changed, 54 insertions(+), 54 deletions(-) [+]
line diff
     1.1 --- a/FrmMainWindow.cs	Tue Dec 28 19:58:00 2010 +0000
     1.2 +++ b/FrmMainWindow.cs	Tue Dec 28 20:20:16 2010 +0000
     1.3 @@ -106,14 +106,12 @@
     1.4  			Build();
     1.5  			//Replace the undo/redo buttons with menu versions, which Monodevelop's GUI editor doesn't currently support
     1.6  			redoMenuButton = new MenuToolButton("gtk-redo");
     1.7 -			redoMenuButton.Label = "Redo";
     1.8 -			redoMenuButton.TooltipText = "Redo";
     1.9 +			redoMenuButton.Name = "bttnRedo";
    1.10  			redoMenuButton.Clicked += redoTBButtonActivated;
    1.11  			redoMenuButton.Sensitive = false;
    1.12  			toolbar.Insert(redoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX);
    1.13  			undoMenuButton = new MenuToolButton("gtk-undo");
    1.14 -			undoMenuButton.Label = "Undo";
    1.15 -			undoMenuButton.TooltipText = "Undo";
    1.16 +			undoMenuButton.Name = "bttnUndo";
    1.17  			undoMenuButton.Clicked += undoTBButtonActivated;
    1.18  			undoMenuButton.Sensitive = false;
    1.19  			toolbar.Insert(undoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX);
    1.20 @@ -121,9 +119,7 @@
    1.21  			toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX - 2]);
    1.22  			toolbar.ShowAll();
    1.23  
    1.24 -			Title = AppTitle;
    1.25  			TreeViewColumn mainColumn = new TreeViewColumn();
    1.26 -			mainColumn.Title = "Army Categories";
    1.27  			CellRendererText mainCell = new CellRendererText();
    1.28  			mainColumn.PackStart(mainCell, true);
    1.29  			treeUnits.AppendColumn(mainColumn);
    1.30 @@ -227,6 +223,7 @@
    1.31  		{
    1.32  			ControlTranslator.TranslateWidget(this);
    1.33  			SetAppTitle();
    1.34 +			treeUnits.GetColumn(0).Title = Translation.GetTranslation("armyCategoryColumnTitle", "categories");
    1.35  		}
    1.36  
    1.37  		private void FileLoadingFinished(List<FileLoadFailure> failures)
    1.38 @@ -563,7 +560,7 @@
    1.39  			loadedArmyPath = null;
    1.40  			//New army has no changes, so we can't save it
    1.41  			miSaveArmy.Sensitive = false;
    1.42 -			saveArmyButton.Sensitive = false;
    1.43 +			bttnSaveArmy.Sensitive = false;
    1.44  
    1.45  			CommandStack.Reset();
    1.46  			SetPointsPanelText();
    1.47 @@ -727,7 +724,7 @@
    1.48  				undoMenuButton.Menu = null;
    1.49  			}
    1.50  
    1.51 -			saveArmyButton.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null;
    1.52 +			bttnSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null;
    1.53  			miSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null;
    1.54  		}
    1.55  
    1.56 @@ -875,7 +872,7 @@
    1.57  				if (WarFoundrySaver.GetSaver().Save(WarFoundryCore.CurrentArmy, filePath))
    1.58  				{
    1.59  					miSaveArmy.Sensitive = false;
    1.60 -					saveArmyButton.Sensitive = false;
    1.61 +					bttnSaveArmy.Sensitive = false;
    1.62  					CommandStack.setCleanMark();
    1.63  					loadedArmyPath = filePath;
    1.64  					success = true;
     2.1 --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs	Tue Dec 28 19:58:00 2010 +0000
     2.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs	Tue Dec 28 20:20:16 2010 +0000
     2.3 @@ -11,7 +11,7 @@
     2.4  		private global::Gtk.Action miSaveArmy;
     2.5  		private global::Gtk.Action miSaveArmyAs;
     2.6  		private global::Gtk.Action miCloseArmy;
     2.7 -		private global::Gtk.Action refreshAction;
     2.8 +		private global::Gtk.Action miReloadFiles;
     2.9  		private global::Gtk.Action miExit;
    2.10  		private global::Gtk.Action menuEdit;
    2.11  		private global::Gtk.Action miUndo;
    2.12 @@ -19,11 +19,11 @@
    2.13  		private global::Gtk.Action menuHelp;
    2.14  		private global::Gtk.Action miAbout;
    2.15  		private global::Gtk.Action miDebugInformation;
    2.16 -		private global::Gtk.Action newArmyButton;
    2.17 -		private global::Gtk.Action openArmyButton;
    2.18 -		private global::Gtk.Action saveArmyButton;
    2.19 -		private global::Gtk.Action undoActionButton;
    2.20 -		private global::Gtk.Action redoActionButton;
    2.21 +		private global::Gtk.Action bttnNewArmy;
    2.22 +		private global::Gtk.Action bttnOpenArmy;
    2.23 +		private global::Gtk.Action bttnSaveArmy;
    2.24 +		private global::Gtk.Action bttnUndo;
    2.25 +		private global::Gtk.Action bttnRedo;
    2.26  		private global::Gtk.Action goDown;
    2.27  		private global::Gtk.Action add;
    2.28  		private global::Gtk.Action miExportArmyAs;
    2.29 @@ -63,9 +63,9 @@
    2.30  			this.miCloseArmy.Sensitive = false;
    2.31  			this.miCloseArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Close army");
    2.32  			w1.Add(this.miCloseArmy, null);
    2.33 -			this.refreshAction = new global::Gtk.Action("refreshAction", global::Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh");
    2.34 -			this.refreshAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Reload files");
    2.35 -			w1.Add(this.refreshAction, null);
    2.36 +			this.miReloadFiles = new global::Gtk.Action("miReloadFiles", global::Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh");
    2.37 +			this.miReloadFiles.ShortLabel = global::Mono.Unix.Catalog.GetString("Reload files");
    2.38 +			w1.Add(this.miReloadFiles, null);
    2.39  			this.miExit = new global::Gtk.Action("miExit", global::Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit");
    2.40  			this.miExit.ShortLabel = global::Mono.Unix.Catalog.GetString("Exit");
    2.41  			w1.Add(this.miExit, null);
    2.42 @@ -89,19 +89,19 @@
    2.43  			this.miDebugInformation = new global::Gtk.Action("miDebugInformation", global::Mono.Unix.Catalog.GetString("Debug Information"), null, null);
    2.44  			this.miDebugInformation.ShortLabel = global::Mono.Unix.Catalog.GetString("Debug Information");
    2.45  			w1.Add(this.miDebugInformation, null);
    2.46 -			this.newArmyButton = new global::Gtk.Action("newArmyButton", null, null, "gtk-new");
    2.47 -			w1.Add(this.newArmyButton, null);
    2.48 -			this.openArmyButton = new global::Gtk.Action("openArmyButton", null, null, "gtk-open");
    2.49 -			w1.Add(this.openArmyButton, null);
    2.50 -			this.saveArmyButton = new global::Gtk.Action("saveArmyButton", null, null, "gtk-save");
    2.51 -			this.saveArmyButton.Sensitive = false;
    2.52 -			w1.Add(this.saveArmyButton, null);
    2.53 -			this.undoActionButton = new global::Gtk.Action("undoActionButton", null, null, "gtk-undo");
    2.54 -			this.undoActionButton.Sensitive = false;
    2.55 -			w1.Add(this.undoActionButton, null);
    2.56 -			this.redoActionButton = new global::Gtk.Action("redoActionButton", null, null, "gtk-redo");
    2.57 -			this.redoActionButton.Sensitive = false;
    2.58 -			w1.Add(this.redoActionButton, null);
    2.59 +			this.bttnNewArmy = new global::Gtk.Action("bttnNewArmy", null, null, "gtk-new");
    2.60 +			w1.Add(this.bttnNewArmy, null);
    2.61 +			this.bttnOpenArmy = new global::Gtk.Action("bttnOpenArmy", null, null, "gtk-open");
    2.62 +			w1.Add(this.bttnOpenArmy, null);
    2.63 +			this.bttnSaveArmy = new global::Gtk.Action("bttnSaveArmy", null, null, "gtk-save");
    2.64 +			this.bttnSaveArmy.Sensitive = false;
    2.65 +			w1.Add(this.bttnSaveArmy, null);
    2.66 +			this.bttnUndo = new global::Gtk.Action("bttnUndo", null, null, "gtk-undo");
    2.67 +			this.bttnUndo.Sensitive = false;
    2.68 +			w1.Add(this.bttnUndo, null);
    2.69 +			this.bttnRedo = new global::Gtk.Action("bttnRedo", null, null, "gtk-redo");
    2.70 +			this.bttnRedo.Sensitive = false;
    2.71 +			w1.Add(this.bttnRedo, null);
    2.72  			this.goDown = new global::Gtk.Action("goDown", null, null, null);
    2.73  			w1.Add(this.goDown, null);
    2.74  			this.add = new global::Gtk.Action("add", null, null, "gtk-add");
    2.75 @@ -122,7 +122,7 @@
    2.76  			this.vbox1 = new global::Gtk.VBox();
    2.77  			this.vbox1.Name = "vbox1";
    2.78  			// Container child vbox1.Gtk.Box+BoxChild
    2.79 -			this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='menuFile' action='menuFile'><menuitem name='miNewArmy' action='miNewArmy'/><menuitem name='miOpenArmy' action='miOpenArmy'/><menuitem name='miSaveArmy' action='miSaveArmy'/><menuitem name='miSaveArmyAs' action='miSaveArmyAs'/><menu name='miExportArmyAs' action='miExportArmyAs'><menuitem name='miExportAsBasicHtml' action='miExportAsBasicHtml'/></menu><menuitem name='miCloseArmy' action='miCloseArmy'/><separator/><menuitem name='refreshAction' action='refreshAction'/><separator/><menuitem name='miExit' action='miExit'/></menu><menu name='menuEdit' action='menuEdit'><menuitem name='miUndo' action='miUndo'/><menuitem name='miRedo' action='miRedo'/></menu><menu name='menuHelp' action='menuHelp'><menuitem name='miAbout' action='miAbout'/></menu></menubar></ui>");
    2.80 +			this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='menuFile' action='menuFile'><menuitem name='miNewArmy' action='miNewArmy'/><menuitem name='miOpenArmy' action='miOpenArmy'/><menuitem name='miSaveArmy' action='miSaveArmy'/><menuitem name='miSaveArmyAs' action='miSaveArmyAs'/><menu name='miExportArmyAs' action='miExportArmyAs'><menuitem name='miExportAsBasicHtml' action='miExportAsBasicHtml'/></menu><menuitem name='miCloseArmy' action='miCloseArmy'/><separator/><menuitem name='miReloadFiles' action='miReloadFiles'/><separator/><menuitem name='miExit' action='miExit'/></menu><menu name='menuEdit' action='menuEdit'><menuitem name='miUndo' action='miUndo'/><menuitem name='miRedo' action='miRedo'/></menu><menu name='menuHelp' action='menuHelp'><menuitem name='miAbout' action='miAbout'/></menu></menubar></ui>");
    2.81  			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
    2.82  			this.menubar1.Name = "menubar1";
    2.83  			this.vbox1.Add(this.menubar1);
    2.84 @@ -131,7 +131,7 @@
    2.85  			w2.Expand = false;
    2.86  			w2.Fill = false;
    2.87  			// Container child vbox1.Gtk.Box+BoxChild
    2.88 -			this.UIManager.AddUiFromString("<ui><toolbar name='toolbar'><toolitem name='newArmyButton' action='newArmyButton'/><toolitem name='openArmyButton' action='openArmyButton'/><toolitem name='saveArmyButton' action='saveArmyButton'/><separator/><toolitem name='undoActionButton' action='undoActionButton'/><toolitem name='redoActionButton' action='redoActionButton'/><separator/></toolbar></ui>");
    2.89 +			this.UIManager.AddUiFromString("<ui><toolbar name='toolbar'><toolitem name='bttnNewArmy' action='bttnNewArmy'/><toolitem name='bttnOpenArmy' action='bttnOpenArmy'/><toolitem name='bttnSaveArmy' action='bttnSaveArmy'/><separator/><toolitem name='bttnUndo' action='bttnUndo'/><toolitem name='bttnRedo' action='bttnRedo'/><separator/></toolbar></ui>");
    2.90  			this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar")));
    2.91  			this.toolbar.HeightRequest = 36;
    2.92  			this.toolbar.Name = "toolbar";
    2.93 @@ -188,14 +188,14 @@
    2.94  			this.miSaveArmy.Activated += new global::System.EventHandler(this.OnSaveArmyActivated);
    2.95  			this.miSaveArmyAs.Activated += new global::System.EventHandler(this.OnSaveArmyAsActivated);
    2.96  			this.miCloseArmy.Activated += new global::System.EventHandler(this.OnCloseArmyActivated);
    2.97 -			this.refreshAction.Activated += new global::System.EventHandler(this.OnReloadFilesActivated);
    2.98 +			this.miReloadFiles.Activated += new global::System.EventHandler(this.OnReloadFilesActivated);
    2.99  			this.miExit.Activated += new global::System.EventHandler(this.OnExitActivated);
   2.100  			this.miAbout.Activated += new global::System.EventHandler(this.HelpAboutActivated);
   2.101 -			this.newArmyButton.Activated += new global::System.EventHandler(this.newTBButtonActivated);
   2.102 -			this.openArmyButton.Activated += new global::System.EventHandler(this.openTBButtonActivated);
   2.103 -			this.saveArmyButton.Activated += new global::System.EventHandler(this.saveTBButtonActivated);
   2.104 -			this.undoActionButton.Activated += new global::System.EventHandler(this.undoTBButtonActivated);
   2.105 -			this.redoActionButton.Activated += new global::System.EventHandler(this.redoTBButtonActivated);
   2.106 +			this.bttnNewArmy.Activated += new global::System.EventHandler(this.newTBButtonActivated);
   2.107 +			this.bttnOpenArmy.Activated += new global::System.EventHandler(this.openTBButtonActivated);
   2.108 +			this.bttnSaveArmy.Activated += new global::System.EventHandler(this.saveTBButtonActivated);
   2.109 +			this.bttnUndo.Activated += new global::System.EventHandler(this.undoTBButtonActivated);
   2.110 +			this.bttnRedo.Activated += new global::System.EventHandler(this.redoTBButtonActivated);
   2.111  			this.miExportAsBasicHtml.Activated += new global::System.EventHandler(this.OnMiExportAsBasicHtmlActivated);
   2.112  			this.treeUnits.RowActivated += new global::Gtk.RowActivatedHandler(this.ArmyRowActivated);
   2.113  			this.treeUnits.PopupMenu += new global::Gtk.PopupMenuHandler(this.OnTreeUnitsPopupMenu);
     3.1 --- a/gtk-gui/gui.stetic	Tue Dec 28 19:58:00 2010 +0000
     3.2 +++ b/gtk-gui/gui.stetic	Tue Dec 28 20:20:16 2010 +0000
     3.3 @@ -53,7 +53,7 @@
     3.4          <property name="StockId">gtk-close</property>
     3.5          <signal name="Activated" handler="OnCloseArmyActivated" />
     3.6        </action>
     3.7 -      <action id="refreshAction">
     3.8 +      <action id="miReloadFiles">
     3.9          <property name="Type">Action</property>
    3.10          <property name="Label" translatable="yes">Reload files</property>
    3.11          <property name="ShortLabel" translatable="yes">Reload files</property>
    3.12 @@ -103,33 +103,33 @@
    3.13          <property name="Label" translatable="yes">Debug Information</property>
    3.14          <property name="ShortLabel" translatable="yes">Debug Information</property>
    3.15        </action>
    3.16 -      <action id="newArmyButton">
    3.17 +      <action id="bttnNewArmy">
    3.18          <property name="Type">Action</property>
    3.19          <property name="Label" translatable="yes" />
    3.20          <property name="StockId">gtk-new</property>
    3.21          <signal name="Activated" handler="newTBButtonActivated" />
    3.22        </action>
    3.23 -      <action id="openArmyButton">
    3.24 +      <action id="bttnOpenArmy">
    3.25          <property name="Type">Action</property>
    3.26          <property name="Label" translatable="yes" />
    3.27          <property name="StockId">gtk-open</property>
    3.28          <signal name="Activated" handler="openTBButtonActivated" />
    3.29        </action>
    3.30 -      <action id="saveArmyButton">
    3.31 +      <action id="bttnSaveArmy">
    3.32          <property name="Type">Action</property>
    3.33          <property name="Label" translatable="yes" />
    3.34          <property name="Sensitive">False</property>
    3.35          <property name="StockId">gtk-save</property>
    3.36          <signal name="Activated" handler="saveTBButtonActivated" />
    3.37        </action>
    3.38 -      <action id="undoActionButton">
    3.39 +      <action id="bttnUndo">
    3.40          <property name="Type">Action</property>
    3.41          <property name="Label" translatable="yes" />
    3.42          <property name="Sensitive">False</property>
    3.43          <property name="StockId">gtk-undo</property>
    3.44          <signal name="Activated" handler="undoTBButtonActivated" />
    3.45        </action>
    3.46 -      <action id="redoActionButton">
    3.47 +      <action id="bttnRedo">
    3.48          <property name="Type">Action</property>
    3.49          <property name="Label" translatable="yes" />
    3.50          <property name="Sensitive">False</property>
    3.51 @@ -179,7 +179,7 @@
    3.52                  </node>
    3.53                  <node type="Menuitem" action="miCloseArmy" />
    3.54                  <node type="Separator" />
    3.55 -                <node type="Menuitem" action="refreshAction" />
    3.56 +                <node type="Menuitem" action="miReloadFiles" />
    3.57                  <node type="Separator" />
    3.58                  <node type="Menuitem" action="miExit" />
    3.59                </node>
    3.60 @@ -207,12 +207,12 @@
    3.61              <property name="ButtonStyle">Icons</property>
    3.62              <property name="IconSize">LargeToolbar</property>
    3.63              <node name="toolbar" type="Toolbar">
    3.64 -              <node type="Toolitem" action="newArmyButton" />
    3.65 -              <node type="Toolitem" action="openArmyButton" />
    3.66 -              <node type="Toolitem" action="saveArmyButton" />
    3.67 +              <node type="Toolitem" action="bttnNewArmy" />
    3.68 +              <node type="Toolitem" action="bttnOpenArmy" />
    3.69 +              <node type="Toolitem" action="bttnSaveArmy" />
    3.70                <node type="Separator" />
    3.71 -              <node type="Toolitem" action="undoActionButton" />
    3.72 -              <node type="Toolitem" action="redoActionButton" />
    3.73 +              <node type="Toolitem" action="bttnUndo" />
    3.74 +              <node type="Toolitem" action="bttnRedo" />
    3.75                <node type="Separator" />
    3.76              </node>
    3.77            </widget>
     4.1 --- a/translations/en.translation	Tue Dec 28 19:58:00 2010 +0000
     4.2 +++ b/translations/en.translation	Tue Dec 28 20:20:16 2010 +0000
     4.3 @@ -17,6 +17,12 @@
     4.4  <translation id="miUndo">_Undo</translation>
     4.5  <translation id="miRedo">_Redo</translation>
     4.6  <translation id="miAbout">_About</translation>
     4.7 +<translation id="bttnNewArmy">Create new army</translation>
     4.8 +<translation id="bttnOpenArmy">Open army</translation>
     4.9 +<translation id="bttnSaveArmy">Save army</translation>
    4.10 +<translation id="bttnUndo">Undo</translation>
    4.11 +<translation id="bttnRedo">Redo</translation>
    4.12 +<translation id="armyCategoryColumnTitle">Army Categories</translation>
    4.13  <translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation>
    4.14  <translation id="bttnSelectRace">Create army</translation>
    4.15  <translation id="bttnCancel">Cancel</translation>
    4.16 @@ -32,9 +38,6 @@
    4.17  <translation id="saveArmyDialog">Save army</translation>
    4.18  <translation id="lblArmySize">Army size:</translation>
    4.19  <translation id="defaultUnitName">Unit of {0} {1}</translation>
    4.20 -<translation id="bttnNewArmy">Create army</translation>
    4.21 -<translation id="bttnOpenArmy">Open army</translation>
    4.22 -<translation id="bttnSaveArmy">Save army</translation>
    4.23  <translation id="statusPanelPoints">{0} pts / {1} pts</translation>
    4.24  <translation id="FrmNewUnit">Add New {0} Choice</translation>
    4.25  <translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>