2 Languages!

Discussion in 'HTML & Website Design' started by Thiagoo, Nov 5, 2006.

  1. #1
    Well i have a website in portuguese and i want people that don't know english go to "english.html", anyone knows how to do it? Thanks!
     
    Thiagoo, Nov 5, 2006 IP
  2. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Put a link to english.html. ;)
     
    YIAM, Nov 5, 2006 IP
  3. pinky24

    pinky24 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    and maybe put a little union jack, so that it draws peoples eyes to it.
     
    pinky24, Nov 5, 2006 IP
  4. massimastudios

    massimastudios Peon

    Messages:
    123
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Actualy there's a script that you can insert into your header and it will redirect visitors based on their system language.

    i.e. if one visitor has the language set to English (EN) will be redirected to english.html or if is Spanish (ES) will be redirected to spanish.html

    I found this script but I did not test it yet. Let me know if it works.

    <script language="JavaScript">
    /*
    Browser Language Redirect script- By JavaScript Kit
    For this and over 400+ free scripts, visit http://www.javascriptkit.com
    This notice must stay intact
    */
    
    //Enter ISO 639-2 letter Language codes to detect (see: http://www.w3.org/WAI/ER/IG/ert/iso639.htm):
    var langcodes=new Array("en", "fr", "es", "ja", "zh", "default")
    
    //Enter corresponding redirect URLs (last one is for default URL):
    var langredirects=new Array("index.htm", "french.htm", "spanish.htm", "japan.htm", "chinese.htm", "index.htm")
    
    var languageinfo=navigator.language? navigator.language : navigator.userLanguage
    var gotodefault=1
    
    function redirectpage(dest){
    if (window.location.replace)
    window.location.replace(dest)
    else
    window.location=dest
    }
    
    for (i=0;i<langcodes.length-1;i++){
    if (languageinfo.substr(0,2)==langcodes[i]){
    redirectpage(langredirects[i])
    gotodefault=0
    break
    }
    }
    
    if (gotodefault)
    redirectpage(langredirects[langcodes.length-1])
    </script>
    Code (markup):
     
    massimastudios, Nov 5, 2006 IP