diff --git a/I18N Commander/Processor/AppSettings.cs b/I18N Commander/Processor/AppSettings.cs index 8987196..401be31 100644 --- a/I18N Commander/Processor/AppSettings.cs +++ b/I18N Commander/Processor/AppSettings.cs @@ -168,7 +168,11 @@ public static class AppSettings #region DeepL Mode - public static async Task SetDeepLMode(SettingDeepLMode mode) => await AppSettings.SetSetting(SettingNames.DEEPL_MODE, mode); + public static async Task SetDeepLMode(SettingDeepLMode mode) + { + DeepL.ResetState(); + await AppSettings.SetSetting(SettingNames.DEEPL_MODE, mode); + } public static async Task GetDeepLMode() => await AppSettings.GetSetting(SettingNames.DEEPL_MODE, SettingDeepLMode.DISABLED); @@ -176,7 +180,11 @@ public static class AppSettings #region DeepL API Key - public static async Task SetDeepLAPIKey(string apiKey) => await AppSettings.SetSetting(SettingNames.DEEPL_API_KEY, apiKey); + public static async Task SetDeepLAPIKey(string apiKey) + { + DeepL.ResetState(); + await AppSettings.SetSetting(SettingNames.DEEPL_API_KEY, apiKey); + } public static async Task GetDeepLAPIKey() => await AppSettings.GetSetting(SettingNames.DEEPL_API_KEY, string.Empty); diff --git a/I18N Commander/Processor/DeepL.cs b/I18N Commander/Processor/DeepL.cs index d942e9c..5ec72bd 100644 --- a/I18N Commander/Processor/DeepL.cs +++ b/I18N Commander/Processor/DeepL.cs @@ -76,4 +76,6 @@ public static class DeepL return string.Empty; } } + + public static void ResetState() => DEEPL_NOT_AVAILABLE = false; } \ No newline at end of file diff --git a/I18N Commander/Processor/Version.cs b/I18N Commander/Processor/Version.cs index 6de87ef..d02d278 100644 --- a/I18N Commander/Processor/Version.cs +++ b/I18N Commander/Processor/Version.cs @@ -2,5 +2,5 @@ public static class Version { - public static string Text => $"v0.8.3 (2023-02-11), .NET {Environment.Version}"; + public static string Text => $"v0.8.4 (2023-02-12), .NET {Environment.Version}"; } \ No newline at end of file diff --git a/I18N Commander/UI WinForms/Program.cs b/I18N Commander/UI WinForms/Program.cs index 68f2106..2b74052 100644 --- a/I18N Commander/UI WinForms/Program.cs +++ b/I18N Commander/UI WinForms/Program.cs @@ -79,6 +79,7 @@ internal static class Program // Start the app: do { + Processor.DeepL.ResetState(); Application.Run(new Main()); } while (Program.RestartMainApp); }