Compare commits

..

No commits in common. "67ffa810d300c803edcb1b8d40775324500fd12e" and "d471336994e6a3f17ad9c7653f0504a76a440038" have entirely different histories.

3 changed files with 15 additions and 10 deletions

View file

@ -105,9 +105,14 @@ namespace ServiceLib.Handler
if (Utils.IsNullOrEmpty(config.UiItem.CurrentLanguage)) if (Utils.IsNullOrEmpty(config.UiItem.CurrentLanguage))
{ {
config.UiItem.CurrentLanguage = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName.Equals("zh", StringComparison.CurrentCultureIgnoreCase) if (Thread.CurrentThread.CurrentCulture.Name.Equals("zh-cn", StringComparison.CurrentCultureIgnoreCase))
? Global.Languages.First() {
: Global.Languages[2]; config.UiItem.CurrentLanguage = Global.Languages.First();
}
else
{
config.UiItem.CurrentLanguage = Global.Languages[2];
}
} }
config.ConstItem ??= new ConstItem(); config.ConstItem ??= new ConstItem();

View file

@ -243,7 +243,7 @@ namespace ServiceLib.Services
_updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo")); _updateFunc?.Invoke(true, string.Format(ResUI.MsgDownloadGeoFileSuccessfully, "geo"));
} }
public async Task<string> RunAvailabilityCheck() public async Task RunAvailabilityCheck(Action<bool, string> updateFunc)
{ {
var downloadHandle = new DownloadService(); var downloadHandle = new DownloadService();
var time = await downloadHandle.RunAvailabilityCheck(null); var time = await downloadHandle.RunAvailabilityCheck(null);
@ -255,7 +255,7 @@ namespace ServiceLib.Services
ip = $"({ipInfo?.country_code}) {ipInfo?.ip}"; ip = $"({ipInfo?.country_code}) {ipInfo?.ip}";
} }
return string.Format(ResUI.TestMeOutput, time, ip); updateFunc?.Invoke(false, string.Format(ResUI.TestMeOutput, time, ip));
} }
#region CheckUpdate private #region CheckUpdate private

View file

@ -311,11 +311,11 @@ namespace ServiceLib.ViewModels
{ {
return; return;
} }
await (new UpdateService()).RunAvailabilityCheck(async (bool success, string msg) =>
var msg = await (new UpdateService()).RunAvailabilityCheck(); {
NoticeHandler.Instance.SendMessageEx(msg);
NoticeHandler.Instance.SendMessageEx(msg); _updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg);
_updateView?.Invoke(EViewAction.DispatcherServerAvailability, msg); });
} }
public void TestServerAvailabilityResult(string msg) public void TestServerAvailabilityResult(string msg)