# HG changeset patch # User IBBoard # Date 1293567616 0 # Node ID fb16ca1cb52bdd973f997a88af71e3c1d043d802 # Parent 3ff8e10de45a86605c9d95152eecbebf06486b18 Re #308: Make GTK# UI translatable * Match button names to WinForms for consistency * Translate army column title diff -r 3ff8e10de45a -r fb16ca1cb52b FrmMainWindow.cs --- a/FrmMainWindow.cs Tue Dec 28 19:58:00 2010 +0000 +++ b/FrmMainWindow.cs Tue Dec 28 20:20:16 2010 +0000 @@ -106,14 +106,12 @@ Build(); //Replace the undo/redo buttons with menu versions, which Monodevelop's GUI editor doesn't currently support redoMenuButton = new MenuToolButton("gtk-redo"); - redoMenuButton.Label = "Redo"; - redoMenuButton.TooltipText = "Redo"; + redoMenuButton.Name = "bttnRedo"; redoMenuButton.Clicked += redoTBButtonActivated; redoMenuButton.Sensitive = false; toolbar.Insert(redoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX); undoMenuButton = new MenuToolButton("gtk-undo"); - undoMenuButton.Label = "Undo"; - undoMenuButton.TooltipText = "Undo"; + undoMenuButton.Name = "bttnUndo"; undoMenuButton.Clicked += undoTBButtonActivated; undoMenuButton.Sensitive = false; toolbar.Insert(undoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX); @@ -121,9 +119,7 @@ toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX - 2]); toolbar.ShowAll(); - Title = AppTitle; TreeViewColumn mainColumn = new TreeViewColumn(); - mainColumn.Title = "Army Categories"; CellRendererText mainCell = new CellRendererText(); mainColumn.PackStart(mainCell, true); treeUnits.AppendColumn(mainColumn); @@ -227,6 +223,7 @@ { ControlTranslator.TranslateWidget(this); SetAppTitle(); + treeUnits.GetColumn(0).Title = Translation.GetTranslation("armyCategoryColumnTitle", "categories"); } private void FileLoadingFinished(List failures) @@ -563,7 +560,7 @@ loadedArmyPath = null; //New army has no changes, so we can't save it miSaveArmy.Sensitive = false; - saveArmyButton.Sensitive = false; + bttnSaveArmy.Sensitive = false; CommandStack.Reset(); SetPointsPanelText(); @@ -727,7 +724,7 @@ undoMenuButton.Menu = null; } - saveArmyButton.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null; + bttnSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null; miSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null; } @@ -875,7 +872,7 @@ if (WarFoundrySaver.GetSaver().Save(WarFoundryCore.CurrentArmy, filePath)) { miSaveArmy.Sensitive = false; - saveArmyButton.Sensitive = false; + bttnSaveArmy.Sensitive = false; CommandStack.setCleanMark(); loadedArmyPath = filePath; success = true; diff -r 3ff8e10de45a -r fb16ca1cb52b gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs Tue Dec 28 19:58:00 2010 +0000 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs Tue Dec 28 20:20:16 2010 +0000 @@ -11,7 +11,7 @@ private global::Gtk.Action miSaveArmy; private global::Gtk.Action miSaveArmyAs; private global::Gtk.Action miCloseArmy; - private global::Gtk.Action refreshAction; + private global::Gtk.Action miReloadFiles; private global::Gtk.Action miExit; private global::Gtk.Action menuEdit; private global::Gtk.Action miUndo; @@ -19,11 +19,11 @@ private global::Gtk.Action menuHelp; private global::Gtk.Action miAbout; private global::Gtk.Action miDebugInformation; - private global::Gtk.Action newArmyButton; - private global::Gtk.Action openArmyButton; - private global::Gtk.Action saveArmyButton; - private global::Gtk.Action undoActionButton; - private global::Gtk.Action redoActionButton; + private global::Gtk.Action bttnNewArmy; + private global::Gtk.Action bttnOpenArmy; + private global::Gtk.Action bttnSaveArmy; + private global::Gtk.Action bttnUndo; + private global::Gtk.Action bttnRedo; private global::Gtk.Action goDown; private global::Gtk.Action add; private global::Gtk.Action miExportArmyAs; @@ -63,9 +63,9 @@ this.miCloseArmy.Sensitive = false; this.miCloseArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Close army"); w1.Add(this.miCloseArmy, null); - this.refreshAction = new global::Gtk.Action("refreshAction", global::Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh"); - this.refreshAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Reload files"); - w1.Add(this.refreshAction, null); + this.miReloadFiles = new global::Gtk.Action("miReloadFiles", global::Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh"); + this.miReloadFiles.ShortLabel = global::Mono.Unix.Catalog.GetString("Reload files"); + w1.Add(this.miReloadFiles, null); this.miExit = new global::Gtk.Action("miExit", global::Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit"); this.miExit.ShortLabel = global::Mono.Unix.Catalog.GetString("Exit"); w1.Add(this.miExit, null); @@ -89,19 +89,19 @@ this.miDebugInformation = new global::Gtk.Action("miDebugInformation", global::Mono.Unix.Catalog.GetString("Debug Information"), null, null); this.miDebugInformation.ShortLabel = global::Mono.Unix.Catalog.GetString("Debug Information"); w1.Add(this.miDebugInformation, null); - this.newArmyButton = new global::Gtk.Action("newArmyButton", null, null, "gtk-new"); - w1.Add(this.newArmyButton, null); - this.openArmyButton = new global::Gtk.Action("openArmyButton", null, null, "gtk-open"); - w1.Add(this.openArmyButton, null); - this.saveArmyButton = new global::Gtk.Action("saveArmyButton", null, null, "gtk-save"); - this.saveArmyButton.Sensitive = false; - w1.Add(this.saveArmyButton, null); - this.undoActionButton = new global::Gtk.Action("undoActionButton", null, null, "gtk-undo"); - this.undoActionButton.Sensitive = false; - w1.Add(this.undoActionButton, null); - this.redoActionButton = new global::Gtk.Action("redoActionButton", null, null, "gtk-redo"); - this.redoActionButton.Sensitive = false; - w1.Add(this.redoActionButton, null); + this.bttnNewArmy = new global::Gtk.Action("bttnNewArmy", null, null, "gtk-new"); + w1.Add(this.bttnNewArmy, null); + this.bttnOpenArmy = new global::Gtk.Action("bttnOpenArmy", null, null, "gtk-open"); + w1.Add(this.bttnOpenArmy, null); + this.bttnSaveArmy = new global::Gtk.Action("bttnSaveArmy", null, null, "gtk-save"); + this.bttnSaveArmy.Sensitive = false; + w1.Add(this.bttnSaveArmy, null); + this.bttnUndo = new global::Gtk.Action("bttnUndo", null, null, "gtk-undo"); + this.bttnUndo.Sensitive = false; + w1.Add(this.bttnUndo, null); + this.bttnRedo = new global::Gtk.Action("bttnRedo", null, null, "gtk-redo"); + this.bttnRedo.Sensitive = false; + w1.Add(this.bttnRedo, null); this.goDown = new global::Gtk.Action("goDown", null, null, null); w1.Add(this.goDown, null); this.add = new global::Gtk.Action("add", null, null, "gtk-add"); @@ -122,7 +122,7 @@ this.vbox1 = new global::Gtk.VBox(); this.vbox1.Name = "vbox1"; // Container child vbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString(""); + this.UIManager.AddUiFromString(""); this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1"))); this.menubar1.Name = "menubar1"; this.vbox1.Add(this.menubar1); @@ -131,7 +131,7 @@ w2.Expand = false; w2.Fill = false; // Container child vbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString(""); + this.UIManager.AddUiFromString(""); this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar"))); this.toolbar.HeightRequest = 36; this.toolbar.Name = "toolbar"; @@ -188,14 +188,14 @@ this.miSaveArmy.Activated += new global::System.EventHandler(this.OnSaveArmyActivated); this.miSaveArmyAs.Activated += new global::System.EventHandler(this.OnSaveArmyAsActivated); this.miCloseArmy.Activated += new global::System.EventHandler(this.OnCloseArmyActivated); - this.refreshAction.Activated += new global::System.EventHandler(this.OnReloadFilesActivated); + this.miReloadFiles.Activated += new global::System.EventHandler(this.OnReloadFilesActivated); this.miExit.Activated += new global::System.EventHandler(this.OnExitActivated); this.miAbout.Activated += new global::System.EventHandler(this.HelpAboutActivated); - this.newArmyButton.Activated += new global::System.EventHandler(this.newTBButtonActivated); - this.openArmyButton.Activated += new global::System.EventHandler(this.openTBButtonActivated); - this.saveArmyButton.Activated += new global::System.EventHandler(this.saveTBButtonActivated); - this.undoActionButton.Activated += new global::System.EventHandler(this.undoTBButtonActivated); - this.redoActionButton.Activated += new global::System.EventHandler(this.redoTBButtonActivated); + this.bttnNewArmy.Activated += new global::System.EventHandler(this.newTBButtonActivated); + this.bttnOpenArmy.Activated += new global::System.EventHandler(this.openTBButtonActivated); + this.bttnSaveArmy.Activated += new global::System.EventHandler(this.saveTBButtonActivated); + this.bttnUndo.Activated += new global::System.EventHandler(this.undoTBButtonActivated); + this.bttnRedo.Activated += new global::System.EventHandler(this.redoTBButtonActivated); this.miExportAsBasicHtml.Activated += new global::System.EventHandler(this.OnMiExportAsBasicHtmlActivated); this.treeUnits.RowActivated += new global::Gtk.RowActivatedHandler(this.ArmyRowActivated); this.treeUnits.PopupMenu += new global::Gtk.PopupMenuHandler(this.OnTreeUnitsPopupMenu); diff -r 3ff8e10de45a -r fb16ca1cb52b gtk-gui/gui.stetic --- a/gtk-gui/gui.stetic Tue Dec 28 19:58:00 2010 +0000 +++ b/gtk-gui/gui.stetic Tue Dec 28 20:20:16 2010 +0000 @@ -53,7 +53,7 @@ gtk-close - + Action Reload files Reload files @@ -103,33 +103,33 @@ Debug Information Debug Information - + Action gtk-new - + Action gtk-open - + Action False gtk-save - + Action False gtk-undo - + Action False @@ -179,7 +179,7 @@ - + @@ -207,12 +207,12 @@ Icons LargeToolbar - - - + + + - - + + diff -r 3ff8e10de45a -r fb16ca1cb52b translations/en.translation --- a/translations/en.translation Tue Dec 28 19:58:00 2010 +0000 +++ b/translations/en.translation Tue Dec 28 20:20:16 2010 +0000 @@ -17,6 +17,12 @@ _Undo _Redo _About +Create new army +Open army +Save army +Undo +Redo +Army Categories WarFoundry Army Files (*.army) Create army Cancel @@ -32,9 +38,6 @@ Save army Army size: Unit of {0} {1} -Create army -Open army -Save army {0} pts / {1} pts Add New {0} Choice About WarFoundry