public void changelanguage(CultureInfo ci)
{
log.Info("change lang to " + ci.ToString() + " current " + Thread.CurrentThread.CurrentUICulture.ToString());
if (ci != null && !Thread.CurrentThread.CurrentUICulture.Equals(ci))
{
Thread.CurrentThread.CurrentUICulture = ci;
Settings.Instance["language"] = ci.Name;
//System.Threading.Thread.CurrentThread.CurrentCulture = ci;
HashSet<Control> views = new HashSet<Control> {this, FlightData, FlightPlanner, Simulation};
foreach (Control view in MyView.Controls)
views.Add(view);
foreach (Control view in views)
{
if (view != null)
{
ComponentResourceManager rm = new ComponentResourceManager(view.GetType());
foreach (Control ctrl in view.Controls)
{
rm.ApplyResource(ctrl);
}
rm.ApplyResources(view, "$this");
}
}
}
}