private void okButton_Click(object sender, EventArgs e) { string oldLocale = Localization.currentLocale; string languageCode = Localization.languageCodes[comboBox1.SelectedIndex]; if (languageCode != oldLocale) { Localization.currentLocale = languageCode; if (AppContext.notifyIcon == null) // Has UI been loaded yet? { Localization.LoadLocaleFromFile(); } JsonConfig.settings.language = languageCode; JsonConfig.settings.poeditorApiToken = null; if (AppContext.notifyIcon != null) { DialogResult result = MessageDialog.ShowQuestion(_("WinDynamicDesktop needs to restart for the " + "language to change. Do you want to restart the app now?"), _("Question")); if (result == DialogResult.Yes) { JsonConfig.ReloadConfig(); } } } this.Close(); }
private static void OnReloadConfigFileClick(object sender, EventArgs e) { JsonConfig.ReloadConfig(); }