Click here to Skip to main content
15,890,717 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.

I want to create a windows form application on visual studio 2008.
It is my first time.

I want to have two languages (french and english) so I create resources files but I don't know how to use it.

How can I use the resources files in my code?

Thank you
Posted

In short, resource files are used to store things, from text to images. Resource files can be targeted to different locales.You would essentially have a resource file for every locale (or language) you wish to support. In your case, you'd need two, one for English and one for French.

Here's an MSDN tutorial describing the process step-by-step: http://msdn.microsoft.com/en-us/library/y99d1cd3(v=vs.100).aspx[^]
 
Share this answer
 
You actually need to create not just resources. You have to do all the development in one culture, and put all you need in resources. Resources for other cultures should be placed in the special resource-only satellite assemblies. They should be placed on subdirectories named bu cultures. This way, as soon as you change culture and UI culture of your thread, resources will be automatically (re)loaded to required culture or the nearest found culture, using the fallback process.

Start here:
http://msdn.microsoft.com/en-us/library/ff647353.aspx[^],
http://msdn.microsoft.com/en-us/library/aa292205%28v=vs.71%29.aspx[^].

See also my past answers:
globalization/localization problem in winform .net[^],
globalization in winforms[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900