views:

262

answers:

2

I'm trying to make my application support multiple languages. I've made some satellite assemblies and now I want to test what the app will look like when run on a French machine, for example.

In [Control Panel->Regional And Language Options] I can select French (France) in the Regional Options tab, and I can select French (France) in the Advanced tab.

But this is not enough to make my application think it's French.

If I add this code to the start of my main function,

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
    CultureInfo^ ci1 = Thread::CurrentThread->CurrentCulture;
    CultureInfo^ ci2 = Thread::CurrentThread->CurrentUICulture;

then ci1->Name is fr-FR but ci2->Name is en-US.

And unfortunately for me, for the French satellite assembly to be used, the CurrentUICulture is the one that needs to be fr-FR.

I don't want to set the CurrentUICulture to the same one as the CurrentCulture in code - I want to change the default one using the Control Panel or something.

I've seen many posts on t'internet about how to detect an event when the CurrentUICulture is changed, just nothing that tells me how to change it!

+2  A: 

This may or may not be possible, depending on your Windows installation. See the "Implicitly Setting the CurrentUICulture Property" section at http://msdn.microsoft.com/en-us/library/441487wx.aspx for details. For additional information concerning the behaviour on various Windows versions, see http://msdn.microsoft.com/en-us/library/dd374098%28VS.85%29.aspx.

Nicole Calinoiu
+1  A: 

Please see How To Change the language used to display menus and dialogs in MUI:

Windows MUI makes it easy for users to change the user interface (menus and dialogs) into the language that best suits them. Up to 33 different languages can be installed on the machine by an administrator (any user with administrative privileges) using the muisetup.exe program.

.NET's CurrentUICulture reflects this setting.

Andrew Hare
Hmm OK, looks like I need to install some MUI packs. I ran muisetup.exe and could only select English.
demoncodemonkey