Hi all,
I have a .NET assembly containing localizable Windows forms. I want to set .NET assembly language localization by the calling application. I use the following code in the windows form class constructor to implement it:
public MyAssemblyForm(string culture) { CultureInfo myCultureInfo = new CultureInfo(culture); Thread.CurrentThread.CurrentCulture = myCultureInfo; Thread.CurrentThread.CurrentUICulture = myCultureInfo; InitializeComponent(); }
But as a result the default language is used. I changed my project type from Assembly to Windows Application and provided some language directly (not default):
public MyAssemblyForm() { CultureInfo myCultureInfo = new CultureInfo("fr-FR"); Thread.CurrentThread.CurrentCulture = myCultureInfo; Thread.CurrentThread.CurrentUICulture = myCultureInfo; InitializeComponent(); }
I run it without additional application that calls it. That works fine and all resources having "fr-FR" suffix is used. Switching the project back to the class library type and calling MyAssemblyForm() constructor gives just default resources values.
Does anybody know how to set assembly culture? Thanks in advance!