// InitializeLocalization Method private void InitializeLocalization() { if (ConfigurationUtil.ConfigurationJsonModel == null || ConfigurationUtil.ConfigurationJsonModel.Language == null || ConfigurationUtil.ConfigurationJsonModel.Language == String.Empty) { LoggingUtil.Warning("ConfigurationJsonModel was null, LANGUAGE was null or LANGUAGE was empty."); ConfigurationUtil.ConfigurationJsonModel = new ConfigurationJsonModel { Language = Configuration.LANGUAGES[0] // Set the default language to english. }; ConfigurationUtil.Save(); } else { ConfigurationUtil.Load(); int index = 0; foreach (var language in Configuration.LANGUAGES) { if (ConfigurationUtil.ConfigurationJsonModel.Language.Equals(language)) { Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(language); ComboBox_Language.SelectedIndex = index; break; } index++; } } }
// MainWindow Method public MainWindow() { InitializeComponent(); ConfigurationUtil.Load(); InitializeLocalization(); InitializeConfiguration(); InitializeWebspaceJsonModel(); InitializeApplication(); }