Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Localization - how to set a language?

I've localized my ExportForm into German (de) and Russian (ru) as you can see below:

If my CultureInfo is German (Austrian-de-AT) then all is OK, I see the format translated into German:

string specCult = "de-AT";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);

But I see the English UI with the Russian (ru-RU) CultureInfo

string specCult = "ru-RU";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);

Although if I use "ru" instead of the "ru-RU" to create the CultureInfo it works:

string specCult = "ru";
Thread.CurrentThread.CurrentUICulture = new CultureInfo(specCult);

Could you please help me what might invoke be the problem? Or please point me a direction to investigate the problem.

like image 786
Murat from Daminion Software Avatar asked May 18 '12 11:05

Murat from Daminion Software


1 Answers

I've determined the problem: ru-RU was selected as a neutral language in my main project assembly settings.

MSDN: The NeutralResourcesLanguage attribute informs the ResourceManager of the language that was used to display the resources of the neutral culture for an assembly. When it looks up resources in the same culture as the neutral resources language, the ResourceManager automatically uses the resources that are located in the main assembly. It does this instead of searching for a satellite assembly that has the current user interface culture for the current thread. This improves lookup performance for the first resource that you load and can reduce your working set.

http://msdn.microsoft.com/en-us/library/bb385967.aspx

like image 173
Murat from Daminion Software Avatar answered Nov 11 '22 02:11

Murat from Daminion Software