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 diff
     1.1 --- a/FrmMainWindow.cs	Tue Dec 28 20:20:16 2010 +0000
     1.2 +++ b/FrmMainWindow.cs	Wed Dec 29 16:10:21 2010 +0000
     1.3 @@ -636,7 +636,7 @@
     1.4  				{
     1.5  					ToolButton button = new ToolButton("gtk-add");
     1.6  					button.Label = cat.Name;
     1.7 -					button.TooltipText = "Add unit from " + cat.Name;
     1.8 +					button.TooltipText = Translation.GetTranslation("bttnCreateFromCat", "{0}", cat.Name);
     1.9  					//TODO: See if we can associate data in some way, the same as we can with SWF. For now we just use the map.
    1.10  					categoryMap.Add(button, cat);
    1.11  					button.Clicked += new System.EventHandler(OnAddUnitActivated);
    1.12 @@ -1033,10 +1033,13 @@
    1.13  
    1.14  		protected virtual void OnMiExportAsBasicHtmlActivated(object sender, System.EventArgs e)
    1.15  		{
    1.16 -			FileChooserDialog fileDialog = new FileChooserDialog("Export army", this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Export", ResponseType.Accept);
    1.17 +			string exportArmyTitle = Translation.GetTranslation("exportBasicHtmlDialogTitle", "export army");
    1.18 +			string cancelText = Translation.GetTranslation("exportBasicHtmlCancel", "cancel");
    1.19 +			string exportText = Translation.GetTranslation("exportBasicHtmlExport", "export");
    1.20 +			FileChooserDialog fileDialog = new FileChooserDialog(exportArmyTitle, this, FileChooserAction.Save, cancelText, ResponseType.Cancel, exportText, ResponseType.Accept);
    1.21  			FileFilter filter = new FileFilter();
    1.22  			filter.AddPattern("*.html");
    1.23 -			filter.Name = "HTML pages (*.html)";
    1.24 +			filter.Name = Translation.GetTranslation("exportBasicHtmlHtmlFilter", "HTML pages (*.html)");
    1.25  			fileDialog.AddFilter(filter);
    1.26  			int response = fileDialog.Run();
    1.27  			string filePath = null;
    1.28 @@ -1064,7 +1067,7 @@
    1.29  			if (selectedItem is WFObjects.Unit)
    1.30  			{
    1.31  				Menu menu = new Menu();
    1.32 -				ImageMenuItem delete = new ImageMenuItem("Remove unit");
    1.33 +				ImageMenuItem delete = new ImageMenuItem(Translation.GetTranslation("menuRemoveUnit", "remove unit"));
    1.34  				delete.Image = new Gtk.Image(Stock.Delete, IconSize.Menu);
    1.35  				delete.Activated += new EventHandler(OnUnitDelete);
    1.36  				delete.Data["unit"] = selectedItem;
     2.1 --- a/translations/en.translation	Tue Dec 28 20:20:16 2010 +0000
     2.2 +++ b/translations/en.translation	Wed Dec 29 16:10:21 2010 +0000
     2.3 @@ -22,7 +22,9 @@
     2.4  <translation id="bttnSaveArmy">Save army</translation>
     2.5  <translation id="bttnUndo">Undo</translation>
     2.6  <translation id="bttnRedo">Redo</translation>
     2.7 +<translation id="bttnCreateFromCat">Add unit from {0}</translation>
     2.8  <translation id="armyCategoryColumnTitle">Army Categories</translation>
     2.9 +<translation id="menuRemoveUnit">Remove Unit</translation>
    2.10  <translation id="armyFileFilter">WarFoundry Army Files (*.army)</translation>
    2.11  <translation id="bttnSelectRace">Create army</translation>
    2.12  <translation id="bttnCancel">Cancel</translation>
    2.13 @@ -40,5 +42,9 @@
    2.14  <translation id="defaultUnitName">Unit of {0} {1}</translation>
    2.15  <translation id="statusPanelPoints">{0} pts / {1} pts</translation>
    2.16  <translation id="FrmNewUnit">Add New {0} Choice</translation>
    2.17 -<translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>	
    2.18 +<translation id="IBBoard.WarFoundry.GUI.GTK.FrmAbout">About WarFoundry</translation>
    2.19 +<translation id="exportBasicHtmlDialogTitle">Export army</translation>
    2.20 +<translation id="exportBasicHtmlCancel">Cancel</translation>
    2.21 +<translation id="exportBasicHtmlExport">Export</translation>
    2.22 +<translation id="exportBasicHtmlHtmlFilter">HTML pages (*.html)</translation>
    2.23  </translations>
    2.24 \ No newline at end of file