comparison FrmMain.cs @ 87:4c5c8f91937a

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
author IBBoard <dev@ibboard.co.uk>
date Sat, 31 Oct 2009 21:09:10 +0000
parents 0bb9f40d44eb
children 3fae39208d06
comparison
equal deleted inserted replaced
86:a9d80b4984bc 87:4c5c8f91937a
578 { 578 {
579 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize); 579 CurrentArmy = new Army(newArmy.SelectedRace, newArmy.ArmyName, newArmy.ArmySize);
580 } 580 }
581 catch (RequiredDataMissingException ex) 581 catch (RequiredDataMissingException ex)
582 { 582 {
583 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); 583 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error);
584 } 584 }
585 catch (InvalidFileException ex) 585 catch (InvalidFileException ex)
586 { 586 {
587 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "Invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error); 587 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidRaceFileBoxTitle", "invalid race file"), MessageBoxButtons.OK, MessageBoxIcon.Error);
588 } 588 }
589 } 589 }
590 } 590 }
591 } 591 }
592 592
621 return true; 621 return true;
622 } 622 }
623 catch (RequiredDataMissingException ex) 623 catch (RequiredDataMissingException ex)
624 { 624 {
625 log.Error(ex); 625 log.Error(ex);
626 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidFileBoxTitle", "Invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); 626 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error);
627 return false; 627 return false;
628 } 628 }
629 catch (InvalidFileException ex) 629 catch (InvalidFileException ex)
630 { 630 {
631 log.Error(ex); 631 log.Error(ex);
632 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidFileBoxTitle", "Invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error); 632 MessageBox.Show(this, ex.Message, Translation.GetTranslation("InvalidArmyFileBoxTitle", "invalid army file"), MessageBoxButtons.OK, MessageBoxIcon.Error);
633 return false; 633 return false;
634 } 634 }
635 } 635 }
636 else 636 else
637 { 637 {
650 { 650 {
651 bool canClose = false; 651 bool canClose = false;
652 652
653 if (CommandStack.IsDirty()) 653 if (CommandStack.IsDirty())
654 { 654 {
655 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); 655 string saveChanges = Translation.GetTranslation("SaveChangesQuestion", "the army \"{0}\" has been modified\r\nsave changes before closing army?", CurrentArmy.Name);
656 string saveChangesTitle = Translation.GetTranslation("SaveChangesTitle", "unsaved changes");
657 DialogResult dr = MessageBox.Show(this, saveChanges, saveChangesTitle, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3);
656 658
657 if (dr == DialogResult.Yes) 659 if (dr == DialogResult.Yes)
658 { 660 {
659 canClose = SaveCurrentArmy(); 661 canClose = SaveCurrentArmy();
660 } 662 }
747 CommandStack.setCleanMark(); 749 CommandStack.setCleanMark();
748 return true; 750 return true;
749 } 751 }
750 else 752 else
751 { 753 {
752 MessageBox.Show(this, Translation.GetTranslation("SaveFailed"), Translation.GetTranslation("SaveFailedTitle"), MessageBoxButtons.OK, MessageBoxIcon.Error); 754 MessageBox.Show(this, Translation.GetTranslation("SaveFailed", "file save failed - check log for details"), Translation.GetTranslation("SaveFailedTitle", "file save failed"), MessageBoxButtons.OK, MessageBoxIcon.Error);
753 return false; 755 return false;
754 } 756 }
755 } 757 }
756 758
757 private string PromptForArmyFilePath() 759 private string PromptForArmyFilePath()