public static void CheckTranslationRequests(Dispatcher dispatcher) { try { string cultureName = App.CurrentCulture.Name; if (!cultureName.StartsWith("en", StringComparison.OrdinalIgnoreCase)) { SettingsStringCache checkedVersion = DialogAbout.TranslationRequestVersion(); if (!Version.TryParse(checkedVersion.Value, out Version version) || version < DialogAbout.CurrentVersion()) { string text = null; using (WebClient client = new WebClient()) { client.UseDefaultCredentials = true; text = client.DownloadString(new Uri("https://www.LogicCircuit.org/TranslationRequests.txt")); } if (!string.IsNullOrWhiteSpace(text) && text.Contains(cultureName)) { dispatcher.BeginInvoke( new Action(() => App.Mainframe.InformationMessage( "If you can help translating this program to any language you are fluent in please contact me at:\n" + "<Hyperlink NavigateUri=\"https://www.logiccircuit.org/contact.html\">https://www.logiccircuit.org/contact.html</Hyperlink>" )), DispatcherPriority.ApplicationIdle ); } checkedVersion.Value = DialogAbout.CurrentVersion().ToString(); } } } catch (Exception exception) { Tracer.Report("DialogAbout.CheckTranslationRequests", exception); // ignore all exception here } }
public static void ResetTranslationRequestVersion() { SettingsStringCache checkedVersion = DialogAbout.TranslationRequestVersion(); checkedVersion.Value = null; }