user7494002
user7494002

Reputation:

How to use Multi language in C#

I'm trying to prepare an application with more languages available. I prepared the simplest example to learn it, I done a lot of tentative but I'm not able to do it.

CultureInfo cul = new CultureInfo("de-De");           
Resources.Culture = new System.Globalization.CultureInfo("de-De");

label1.Text = TestLanguages.Properties.Resources.Saluto;

In my application I have two resources different resources , one for Italian language, one for German.

Resources

But I can't use the German one. How can I do it?

Upvotes: 1

Views: 3601

Answers (1)

Igor
Igor

Reputation: 62318

You have to change the UI culture of the currently executing thread.

System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-De");
label1.Text = TestLanguages.Properties.Resources.Saluto;

See the documentation for Thread.CurrentUICulture

Gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time.

Upvotes: 5

Related Questions