|
Hi,
I've been exploring the Localization features of .net for some time now and noticed that I can configure the Enabled/Visible property of a control per language but when using it, it's kind of bugged. Since .net doesn't provide a way to update the UI to a new culture I'm using following method:
private void changeCulture(string culture) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(this.GetType());
foreach(Control control in this.Controls) { resources.ApplyResources(control, control.Name); } resources.ApplyResources(this, "$this"); }
Works quite well. But as soon as I change to a culture which e.g. sets the Enabled property of a control to false, changing to a culture which has it set to true doesn't enable the control again. I thought the reason for this could be, that the .resx files just include what has _changed_ compared to the fallback culture. So I tried to change to the fallback culture before changing to my desired culture. But once disabled, the control stays like this (except when I explicitly set Enabled to true again). Any ideas what the reason for this could be?
Thanks for any hint!
|