Fix setting UI culture for other threads

This commit is contained in:
Korney Czukowski 2017-12-14 19:40:44 +01:00
parent a794d2c718
commit 60916e1080

View File

@ -122,14 +122,12 @@ namespace DS4Windows
public static void SetCulture(string culture)
{
foreach (Thread t in new Thread[] { Thread.CurrentThread, controlThread })
try
{
if (t != null && !t.CurrentUICulture.Equals(culture))
{
try { t.CurrentUICulture = CultureInfo.GetCultureInfo(culture); }
catch { /* Skip setting culture that we cannot set */ }
}
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo(culture);
}
catch { /* Skip setting culture that we cannot set */ }
}
private static void createControlService()