How to display/set the language in Windows XP?

E

eikel

Hi

I am trying to display and set the language in XP,
therefore I wrote the following program:


using System;
using System.Globalization;
using System.Security.Permissions;
using System.Threading;

[assembly:SecurityPermission(
SecurityAction.RequestMinimum, ControlThread = true )]
public class SamplesCultureInfo
{

public static void Main()
{

// Displays the name of the
CurrentUICulture of the current thread.
Console.WriteLine( "CurrentUICulture is
{0}.", CultureInfo.CurrentUICulture.Name );

// Changes the CurrentUICulture of the
current thread to chinese
Thread.CurrentThread.CurrentUICulture =
new CultureInfo( "zh-CHS");
Console.WriteLine( "CurrentUICulture is
now {0}.", CultureInfo.CurrentUICulture.Name );

}

}

//end program

The languagebar is not updated. So the question is:
How to display/set the language in Windows XP with a C#
program?
Thanks for any help!!

Cheers E.
 
M

Morten Wennevik

You use CurrentUICulture in combination with localized resources, like
satellite resource files (used to change text on buttons, labels, etc).

You need a resource manager and resources for individual languages for this
to work.

Use CurrentCulture (no UI) to change the culture/language of the program,
though I think this only works within the app and as long as the app runs.

If you are trying to set the language for the whole system, then I don't
know how. You may need to import win32 methods and use those.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top