i18n - Internationalization

Joined
Feb 14, 2007
Messages
1
Reaction score
0
Hi,

I am trying to make 2 buttons on my aspx page to change the language. One for english and other for dutch.


this is an example of how i tried to solve it but didn't work. When i press the english flag it will goto following code

protected void btnEnFlag_Click(object sender, ImageClickEventArgs e)
{
Session["i18n"] = "en-GB";
InitializeCulture();
// This will only work if i reload the page and that's what i don't want to do
Response.Redirect("PAGE.aspx");
}

protected override void InitializeCulture()
{
String selectedLanguage;
if (Session["i18n"] != null)
{
selectedLanguage = Session["i18n"].ToString();
}
else //standard is english
{
selectedLanguage = "en-GB";
}
UICulture = selectedLanguage ;
Culture = selectedLanguage ;

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);

base.InitializeCulture();
}

Anyone has tips or link with tutorial on how to do it?

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top