Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
changeset 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 | fb55f9f0865e |
children | 8379fa964dd3 |
files | FrmMain.cs |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
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;