Randy
Randy

Reputation: 1287

Why does my Localizable WinForm only show the English view?

I have a WinForm where I have enabled Localizable. I changed the Language to en-US and saved. Then I changed the Language to es-MX changed all my Labels, Column Headers, and Button text to Spanish and saved that. I can now switch back and forth between the two Forms.

I ran the program and the English view came up just fine. I edited the code-behind of that form and put the following line in at the end of the form constructor:

Thread.CurrentThread.CurrentCulture = new CultureInfo("es-MX");

I ran the program again and still the English view came up. I have a Debug statement in my OnLoad method that writes the current culture and it shows es-MX. What step have I missed?

Upvotes: 1

Views: 79

Answers (1)

LucaMus
LucaMus

Reputation: 731

To change UI culture you have to set:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-MX");

I think this should correct your issue.

For more information, read this page in MSDN.

Upvotes: 4

Related Questions