Volkan
Volkan

Reputation: 686

Globalisation : Change language directly in program

I have 3 ressource files : AppRessources.resx, AppRessources.fr.resx, AppRessources.nl.resx.

I add to my page a ListPicker (it's a combobox) that has 3 languages (English, French and Dutch).

When an item is selected, I change the CurrentCulture and the CurrentUICulture. It works for French and Dutch but not for English...

When English is selected, I think the application doesn't load the default AppRessource...

Do you know how can I resolve this problem?

Thank you in advance,

My code :

switch (selectedIndex)
{
//French
case 0:
    Thread.CurrentThread.CurrentCulture = new CultureInfo("fr");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr");
    break;
//English
case 1:
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
    break;
//Dutch
case 2:
    Thread.CurrentThread.CurrentCulture = new CultureInfo("nl");
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("nl");
    break;
}

Upvotes: 0

Views: 189

Answers (1)

Igor Kulman
Igor Kulman

Reputation: 16361

What if you change "en" to "en-US"? I think the default locale is en-US not en.

Upvotes: 2

Related Questions