views:

162

answers:

2

Is it possible to use resx files for different languages in a windows forms application, the same way as in a web project?

I think that you can set the culture of the thread and it should read from the correct file.

The problem I am having is how to create the files for each language in visual studio 2008, feel like there is something very simple that I am missing.

Thanks

Shiraz

+1  A: 

Just add a resource file and change its name to have the language short name. For example, if the default is Resources.resx, for a resource for Hebrew, the resource will be named Resources.he.resx and for German it will be named Resources.de.resx.

Shay Friedman
+1  A: 

This blog post goes into the process in some detail.

The name of the resource file needs to include both the country code and language, for example:

  • Resources.fr-FR.resx for French (in France)
  • Resources.fr-CA.resx for French (in Canada)
  • Resources.es-ES.resx for Spanish (in Spain)
  • Resources.es-MX.resx for Spanish (in Mexico)

See here for a list of culture codes.

NOTE: I've not had a chance to verify the code, but it looks complete.

ChrisF