示例#1
0
        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();
        }
示例#2
0
 private static void OnReloadConfigFileClick(object sender, EventArgs e)
 {
     JsonConfig.ReloadConfig();
 }