diff FrmMain.cs @ 13:f7f65d80951e

Closes #38 - Stop missing translation being fatal * Catch exception from translation initialisation and display dialog box
author IBBoard <dev@ibboard.co.uk>
date Tue, 19 May 2009 19:24:26 +0000
parents 19bdbb80999c
children 76a15df10fa6
line wrap: on
line diff
--- a/FrmMain.cs	Tue May 19 19:10:14 2009 +0000
+++ b/FrmMain.cs	Tue May 19 19:24:26 2009 +0000
@@ -100,8 +100,16 @@
 
 			InitializeComponent();
 
-			Preferences = new Preferences("WarFoundry");
-			Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString());
+			Preferences = new Preferences("WarFoundry");
+			try
+			{
+				Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString());
+			}
+			catch (TranslationLoadException ex)
+			{
+				logger.Error(ex);
+				MessageBox.Show(this, "Translation loading failed for language " + Preferences["language"].ToString(), "Translation failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
+			}
 
 			//pnlRight.Left = ClientSize.Width - pnlRight.Width - 2;
 			//pnlRight.Top = toolBar.Height + 5;