• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 482
  • Last Modified:

How to force WPF application to look for language specific resources?

I try to set the WPF application to display spoecified language, such as fr-FR, fr-CA and en-US.

However, No matter how I tried, it always displays in English. Here are what I tried:

MyApp.Resources.JobView.Culture = new CultureInfo("fr-FR");

System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("fr-FR");
 MyApp.Resources.JobView.Culture = new System.Globalization.CultureInfo("fr-FR");

The culture is set to fr-FR. But when I called:
            System.Resources.ResourceSet r =            MyApp.Resources.JobView.ResourceManager.GetResourceSet(new System.Globalization.CultureInfo("fr-FR"), false, false);

it returns English version.

On the window, it always display in en-US. I have double checked the bin\debug\en-US, fr-Ca and fr-FR. I can find the resource files there.

Anyone may help me ?

Thanks a lot.
1 Solution
Easwaran ParamasivamCommented:
Provide second parameter as true:

MyApp.Resources.JobView.ResourceManager.GetResourceSet(new System.Globalization.CultureInfo("fr-FR"), true, false);
chuang4630Author Commented:
How do I force WPF app to run on specific language?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now