homepage Welcome to WebmasterWorld Guest from 50.16.165.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
How to build a multilanguage site?
ktsirig




msg:3456868
 11:08 am on Sep 21, 2007 (gmt 0)

Hello all!

I want to construct a multi-language site. I have my data stored in a database and I wanted to know if there is a way of me knowing which language the user sees. Imagine having a little flag on top of the page and when tha users presses it, he/she will see the data in english or in german or in greek etc... How can I keep track of the language though? If, for example, tha user selects ENGLISH in index.html, and then browses through the entire site, how can I know in every page, that I must retrieve the english data from my database?

Thank you!

 

encyclo




msg:3458314
 1:21 am on Sep 23, 2007 (gmt 0)

The simplest answer is that you set a language-preference cookie when the user makes a choice. You should also look at the possibilities of content negotiation, that is parsing the browser's language preferences and displaying the content according to the choice of the user.

jaytee




msg:3459026
 8:31 am on Sep 24, 2007 (gmt 0)

If you are using c#/vb .net, you can determine the browser's default language settings with:-

System.Threading.Thread.CurrentThread.CurrentCulture =
new System.Globalization.CultureInfo(Lang);

As per the previous respondent, if they choose another language, cookie the choice and if appropriate store the setting in a preferences table.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved