# HG changeset patch # User IBBoard # Date 1257023350 0 # Node ID 4c5c8f91937ad48bccdf3162e484ec4089ab5a86 # Parent a9d80b4984bc03e434a8791ed175d09eb8cb247c Re #179: Make sure that translations are used throughout UI * Translate context menu on army tree * Translate warning messages in main form * Add translation strings diff -r a9d80b4984bc -r 4c5c8f91937a FrmArmyTree.cs --- a/FrmArmyTree.cs Sat Oct 31 20:57:20 2009 +0000 +++ b/FrmArmyTree.cs Sat Oct 31 21:09:10 2009 +0000 @@ -26,8 +26,8 @@ private IContainer components; private Dictionary nodes; private System.Windows.Forms.ContextMenu contextMenu; - private IBBMenuItem miDelete; - private IBBMenuItem miEdit; + private IBBMenuItem miDeleteUnit; + private IBBMenuItem miEditUnit; private ObjectAddDelegate UnitAddedMethod; private ObjectRemoveDelegate UnitRemovedMethod; @@ -92,8 +92,8 @@ this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmArmyTree)); this.contextMenu = new System.Windows.Forms.ContextMenu(); - this.miEdit = new IBBoard.Windows.Forms.IBBMenuItem(); - this.miDelete = new IBBoard.Windows.Forms.IBBMenuItem(); + this.miEditUnit = new IBBoard.Windows.Forms.IBBMenuItem(); + this.miDeleteUnit = new IBBoard.Windows.Forms.IBBMenuItem(); this.imageList = new System.Windows.Forms.ImageList(this.components); this.toolBar = new System.Windows.Forms.ToolBar(); this.bttnEdit = new IBBoard.Windows.Forms.IBBToolBarButton(); @@ -104,21 +104,23 @@ // contextMenu // this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.miEdit, - this.miDelete}); + this.miEditUnit, + this.miDeleteUnit}); this.contextMenu.Popup += new System.EventHandler(this.contextMenu_Popup); // // miEdit // - this.miEdit.Index = 0; - this.miEdit.Text = "&edit unit"; - this.miEdit.Click += new System.EventHandler(this.miEdit_Click); + this.miEditUnit.Index = 0; + this.miEditUnit.Text = "&edit unit"; + this.miEditUnit.Click += new System.EventHandler(this.miEdit_Click); + this.miEditUnit.Name = "miEditUnit"; // // miDelete // - this.miDelete.Index = 1; - this.miDelete.Text = "&delete unit"; - this.miDelete.Click += new System.EventHandler(this.miDelete_Click); + this.miDeleteUnit.Index = 1; + this.miDeleteUnit.Text = "&delete unit"; + this.miDeleteUnit.Click += new System.EventHandler(this.miDelete_Click); + this.miDeleteUnit.Name = "miDeleteUnit"; // // imageList // diff -r a9d80b4984bc -r 4c5c8f91937a FrmMain.cs --- a/FrmMain.cs Sat Oct 31 20:57:20 2009 +0000 +++ b/FrmMain.cs Sat Oct 31 21:09:10 2009 +0000 @@ -580,11 +580,11 @@ } catch (RequiredDataMissingException ex) { - MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (InvalidFileException ex) { - MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); } } } @@ -623,13 +623,13 @@ catch (RequiredDataMissingException ex) { log.Error(ex); - MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidFileBoxTitle", "Invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } catch (InvalidFileException ex) { log.Error(ex); - MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidFileBoxTitle", "Invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } } @@ -652,7 +652,9 @@ if (CommandStack.IsDirty()) { - DialogResult dr = MessageBox.Show(this, "The army \""+CurrentArmy.Name+"\" has been modified.\r\nSave changes before closing army?", "Unsaved changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3); + string saveChanges = Translation.GetTranslation("SaveChangesQuestion", "the army \"{0}\" has been modified\r\nsave changes before closing army?", CurrentArmy.Name); + string saveChangesTitle = Translation.GetTranslation("SaveChangesTitle", "unsaved changes"); + DialogResult dr = MessageBox.Show(this, saveChanges, saveChangesTitle, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3); if (dr == DialogResult.Yes) { @@ -749,7 +751,7 @@ } else { - MessageBox.Show(this, Translation.GetTranslation("SaveFailed"), Translation.GetTranslation("SaveFailedTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, Translation.GetTranslation("SaveFailed", "file save failed - check log for details"), Translation.GetTranslation("SaveFailedTitle", "file save failed"), MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } } diff -r a9d80b4984bc -r 4c5c8f91937a translations/en.translation --- a/translations/en.translation Sat Oct 31 20:57:20 2009 +0000 +++ b/translations/en.translation Sat Oct 31 21:09:10 2009 +0000 @@ -21,6 +21,8 @@ Open army Save army Army Tree + &Delete unit + &Edit unit Open Army Save Army WarFoundry Army Files (*.army) @@ -58,4 +60,11 @@ Remove Replace Edit + Invalid race file + Invalid army file + The army "{0}" has been modified. +Save changes before closing army? + Unsaved changes + WarFoundry was unable to save the file. Please check the log for more details + File save failed \ No newline at end of file