multilanguage site

Discussion in 'C#' started by ktsirig, Sep 21, 2007.

  1. #1
    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!
     
    ktsirig, Sep 21, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For .Net there is native support via cultureinfo and localisation and a google will bring up a lot of good tutorials

    For classic ASP the easiest way is to simply set either a session variable or cookie containing their preferred language and pick it up on each page load to determine which language to show.
     
    AstarothSolutions, Sep 21, 2007 IP
  3. turksweb

    turksweb Peon

    Messages:
    354
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I think cookie is better, you can use cookie next day also. if session, close and open window, you must select language again. so..
     
    turksweb, Feb 18, 2008 IP
  4. jimrthy

    jimrthy Guest

    Messages:
    283
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I have plenty of friends who refuse to visit sites that even try to store cookies. Personally, I block any cookies that aren't set to expire with this browser session.

    And there are the people who are using cookie-less browsers. Why exclude them if you don't have to?

    The asp.net cultureinfo is a much better way to go. If you're still using classic asp...you might want to think about switching to asp.net. Classic ASP's been dead for, what, 7 years now?

    Or not. Whatever works for you.

    p.s. Yes, I know asp.net often just magically tries to set cookies for you. But why make it any more obnoxious than you have to?
     
    jimrthy, Feb 20, 2008 IP