public static string LoadLanguage(string language) { _languageName = language; try { _language = APICreator.Application.GlobalObjects.Languages.get_ItemByName(_languageName); return _languageName; } catch (Exception) { string message = string.Format("The language which hMailServer is configured to use {0} is not available.\r\nEnglish will be used instead.", language); MessageBox.Show(message, EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Information); try { _language = APICreator.Application.GlobalObjects.Languages.get_ItemByName("English"); return "English"; } catch (Exception) { // } } return ""; }
static public string LoadLanguage(string language) { _languageName = language; try { _language = APICreator.Application.GlobalObjects.Languages.get_ItemByName(_languageName); return(_languageName); } catch (Exception) { string message = string.Format("The language which hMailServer is configured to use {0} is not available.\r\nEnglish will be used instead.", language); MessageBox.Show(message, EnumStrings.hMailServerAdministrator, MessageBoxButtons.OK, MessageBoxIcon.Information); try { _language = APICreator.Application.GlobalObjects.Languages.get_ItemByName("English"); return("English"); } catch (Exception) { // } } return(""); }
public void TestLanguages() { hMailServer.Application application = SingletonProvider <Utilities> .Instance.GetApp(); hMailServer.Language oLanguageSwedish = application.GlobalObjects.Languages.get_ItemByName("swedish"); hMailServer.Language oLanguageEnglish = application.GlobalObjects.Languages.get_ItemByName("english"); string sSWE = oLanguageSwedish.get_String("File"); string sENG = oLanguageEnglish.get_String("File"); Assert.AreEqual(sENG, "File"); Assert.AreNotEqual(sSWE, sENG); Assert.AreNotEqual(sSWE, ""); }
public formSelectLanguage(string language) { InitializeComponent(); _language = language; new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst); Strings.Localize(this); hMailServer.Languages languages = APICreator.Application.GlobalObjects.Languages; for (int i = 0; i < languages.Count; i++) { hMailServer.Language lang = languages[i]; comboLanguage.AddItem(lang.Name, lang); } comboLanguage.Text = _language; }