tags:

views:

19

answers:

2

Hi,

I have a website which currently uses EN-US and I also have resource file for french. what code should I need to write to make the application use the french version of the resource file.

The site is a commerce server and share point site that uses .NET

Any code examples would be great.

A: 

You have a couple of options. Option one is at the application level. You could do this in the system.web section of the web.config:

<globalization culture="fr-FR" uiCulture="fr-FR" />

Another option is on the page:

<%@Page Culture="fr-FR" Language="C#" %>

or by thread:

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

See http://support.microsoft.com/kb/306162 for more info.

Mike
A: 

I consider the main resource file's feature as the ability to retrieve localized strings according to the culture specified in the url through code such as:

localresourcestring = (String)GetLocalResourceObject("username")  
//will retrieve the localized string for username from your resx (according to the resx's name)!  

Here's a great place to start, including a Walkthrough and such..

Oren A