I have a window based application in C#. I am trying to do this for some another language, say arabic.
As we know there is resource file for each form. I have created a global resource file as ResouceFileName.ar-SA.resx . Now I want to change all labels dynamically when I change CultureInfo. If i write in designer file like
static class clsLocalization
{
static ResourceManager resManager = new ResourceManager(typeof(Secure_Browser_CS_Version.Properties.Resources));
public static void applyGlobalResources(Control control,string resource)
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ar-SA");
control.Text=resManager.GetString(resource);
}
}
// Resource file
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SBMainForm));//Default
//
// settingHdrLbl
//
resources.ApplyResources(this.settingHdrLbl, "settingHdrLbl");
clsLocalization.applyGlobalResources(this.settingHdrLbl, "settingHdrLbl");
this.settingHdrLbl.BackColor = System.Drawing.Color.Transparent;
this.settingHdrLbl.Name = "settingHdrLbl";
This will be reload as default whenever i change in designer file. Pl help me out