changeset 83:678e9a0392fc

Re #308: Make GTK# UI translatable * Translate category buttons * Translate HTML export * Translate removing units
author IBBoard <dev@ibboard.co.uk>
date Wed, 29 Dec 2010 16:10:21 +0000
parents fb16ca1cb52b
children 9db2112b31d7
files FrmMainWindow.cs translations/en.translation
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/FrmMainWindow.cs	Tue Dec 28 20:20:16 2010 +0000
+++ b/FrmMainWindow.cs	Wed Dec 29 16:10:21 2010 +0000
@@ -636,7 +636,7 @@
 				{
 					ToolButton button = new ToolButton("gtk-add");
 					button.Label = cat.Name;
-					button.TooltipText = "Add unit from " + cat.Name;
+					button.TooltipText = Translation.GetTranslation("bttnCreateFromCat", "{0}", cat.Name);
 					//TODO: See if we can associate data in some way, the same as we can with SWF. For now we just use the map.
 					categoryMap.Add(button, cat);
 					button.Clicked += new System.EventHandler(OnAddUnitActivated);
@@ -1033,10 +1033,13 @@
 
 		protected virtual void OnMiExportAsBasicHtmlActivated(object sender, System.EventArgs e)
 		{
-			FileChooserDialog fileDialog = new FileChooserDialog("Export army", this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Export", ResponseType.Accept);
+			string exportArmyTitle = Translation.GetTranslation("exportBasicHtmlDialogTitle", "export army");
+			string cancelText = Translation.GetTranslation("exportBasicHtmlCancel", "cancel");
+			string exportText = Translation.GetTranslation("exportBasicHtmlExport", "export");
+			FileChooserDialog fileDialog = new FileChooserDialog(exportArmyTitle, this, FileChooserAction.Save, cancelText, ResponseType.Cancel, exportText, ResponseType.Accept);
 			FileFilter filter = new FileFilter();
 			filter.AddPattern("*.html");
-			filter.Name = "HTML pages (*.html)";
+			filter.Name = Translation.GetTranslation("exportBasicHtmlHtmlFilter", "HTML pages (*.html)");
 			fileDialog.AddFilter(filter);
 			int response = fileDialog.Run();
 			string filePath = null;
@@ -1064,7 +1067,7 @@
 			if (selectedItem is WFObjects.Unit)
 			{
 				Menu menu = new Menu();
-				ImageMenuItem delete = new ImageMenuItem("Remove unit");
+				ImageMenuItem delete = new ImageMenuItem(Translation.GetTranslation("menuRemoveUnit", "remove unit"));
 				delete.Image = new Gtk.Image(Stock.Delete, IconSize.Menu);
 				delete.Activated += new EventHandler(OnUnitDelete);
 				delete.Data["unit"] = selectedItem;
--- a/translations/en.translation	Tue Dec 28 20:20:16 2010 +0000
+++ b/translations/en.translation	Wed Dec 29 16:10:21 2010 +0000
@@ -22,7 +22,9 @@
 <translation id="bttnSaveArmy">Save army</translation>
 <translation id="bttnUndo">Undo</translation>
 <translation id="bttnRedo">Redo</translation>
+<translation id="bttnCreateFromCat">Add unit from {0}</translation>
 <translation id="armyCategoryColumnTitle">Army Categories</translation>
+<translation id="menuRemoveUnit">Remove Unit</translation>
 <translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation>
 <translation id="bttnSelectRace">Create army</translation>
 <translation id="bttnCancel">Cancel</translation>
@@ -40,5 +42,9 @@
 <translation id="defaultUnitName">Unit of {0} {1}</translation>
 <translation id="statusPanelPoints">{0} pts / {1} pts</translation>
 <translation id="FrmNewUnit">Add New {0} Choice</translation>
-<translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>	
+<translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>
+<translation id="exportBasicHtmlDialogTitle">Export army</translation>
+<translation id="exportBasicHtmlCancel">Cancel</translation>
+<translation id="exportBasicHtmlExport">Export</translation>
+<translation id="exportBasicHtmlHtmlFilter">HTML pages (*.html)</translation>
 </translations>
\ No newline at end of file