Groups | Blog | Home
all groups > dotnet internationalization > december 2004 >

dotnet internationalization : Localisating the Interface with ASPX


Sylvain Lafontaine
12/13/2004 12:40:49 PM
http://www.openmymind.net/localization/index.html

S. L.

[quoted text, click to view]

Neil Penn
12/13/2004 3:54:58 PM
I have been reading about localising the interface in .NET with windows
forms and resource files.

Can anyone confirm if this functionality is available with aspx
applications? Does it work the same way? If we are designing an aspx
application is there anything we need to include in the design to allow it
to support globalization?

Elsam
12/18/2004 9:49:01 PM
Hi,
The link contains nice things. But I ust want to share my own experience
about internationalising a web application for french (France = fr-FR) and
english (America = en-US) cultures.
I have done this way:
- Creating a session variable named culture used to store the culture
information once and set up into the Page_Load event like this:

if (Session["culture"] != null)
{
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo
(Session["culture"].ToString(),true);

Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture;

rm = System.Resources.ResourceManager.CreateFileBasedResourceManager
("detailsEmployes",Server.MapPath("..\\..\\resources"),null);

}
else
{

Session["culture"] = Thread.CurrentThread.CurrentCulture.Name ;

Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

rm = System.Resources.ResourceManager.CreateFileBasedResourceManager
("detailsEmployes",Server.MapPath("..\\..\\resources"),null);

}
Then I call a method named miseEnPage() once to define labels and other
culture based parameters.

private void miseEnPage()
{
ViewState["msgDemandeConfirmation"] = rm.GetString

("msgDemandeConfirmation");

ViewState["msgSuccesSuppression"] = rm.GetString("msgSuccesSuppression");

}

It works well. The default culture is fr-FR, and we don't use culture bases
application paths like www.myApp/fr-FR/gestionRH/salaries.aspx
but just www.myApp/gestionRH/salaries.aspx

In fact the user can choose the culture on the logon page.
[quoted text, click to view]
AddThis Social Bookmark Button