Move set culture method to DS4Form class

This commit is contained in:
Korney Czukowski 2017-12-16 13:24:57 +01:00
parent 8297f4cd75
commit 847e0bd6b9
2 changed files with 11 additions and 11 deletions

View File

@ -89,7 +89,7 @@ namespace DS4Windows
public DS4Form(string[] args)
{
Global.Load();
Program.SetCulture(UseLang);
this.setCulture(UseLang);
InitializeComponent();
ThemeUtil.SetTheme(lvDebug);
@ -430,6 +430,16 @@ namespace DS4Windows
}
}
private void setCulture(string culture)
{
try
{
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo(culture);
}
catch { /* Skip setting culture that we cannot set */ }
}
private void populateHoverTextDict()
{
hoverTextDict.Clear();

View File

@ -120,16 +120,6 @@ namespace DS4Windows
threadComEvent.Close();
}
public static void SetCulture(string culture)
{
try
{
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(culture);
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo(culture);
}
catch { /* Skip setting culture that we cannot set */ }
}
private static void createControlService()
{
controlThread = new Thread(() => { rootHub = new ControlService(); });