0

I've found many posts about programmatically forcing the culture of a .NET WinForm program (C#, .NET 4.5).

Is there a way to force the culture without code?

rgunawan
  • 314
  • 1
  • 6
  • 2
    Change your computers locale. – L.B Sep 28 '12 at 21:09
  • On win forms, and so far I'm aware, you can't force the culture to something different to local settings without adding any line of code. – Claudio Redi Sep 28 '12 at 21:09
  • Why don't you want to use code? It's just one line: `Thread.CurrentThread.CurrentCulture = new CultureInfo("pt-BR")` – D Stanley Sep 28 '12 at 21:10
  • It's a work-around for a customer before the next release. The customer is used to working with our program in English. With the new localized version, he is seeing translated text and he does not like it for some reason. – rgunawan Sep 28 '12 at 21:17

2 Answers2

4

The procedure on Windows 7 (the dialog and names have been altered many times):

  • Start + Control Panel
  • Click Region and Language
  • Click the "Administrative" tab
  • Click the "Change system locale" button
  • Pick one of the locales that starts with "English" and matches where your customer lives.

Any program you start after this will initialize with the default culture you selected in this dialog and that will exercise your satellite assemblies.

Note that changing the Thread.CurrentThread.CurrentCulture and CurrentUICulture properties, as suggested in a comment, is not a true substitute. Threadpool threads still initialize themselves to the system locale. A very nasty problem that finally got fixed in .NET 4.5 with the addition of the CultureInfo.DefaultThreadCurrentCulture and DefaultThreadCurrentUICulture properties.

Do beware that many native Windows dialogs (like MessageBox and OpenFileDialog) will still display text in the language of your operating system. You'd need to purchase a license for Windows Ultimate and install the language pack to get those to change. An MSDN subscription is a good way to get the same language specific operating system that your user boots.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0

One more strange option that may work for you is to create bootstrap exe that will set bot culture settings (CurrentCulture and CurrentUICulture) and than load your actual exe and call Main function of correct class. Has all drawbacks of only setting culture on main thread, but may be OK as stopgap measure.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179