• 11-09-2006, 15:09:28
    #1
    Bir sitenin index sayfasını browser diline göre açtırmak mümkün mü?

    mesela ;

    ../en/index.html
    ../tr/index.html


    browser ı türkçe olan ziyaretciler için
    ../tr/index.html

    browser ı ingilizce olan ziyaretciler için
    ../en/index.html


    Bir zamanlar bir script bulmuştım ama bir kaç gündür arıyorum bulamadım. Bilgisi olan var mı bu konuda...
  • 11-09-2006, 16:21:44
    #2
    Üyeliği durduruldu
    <script>
    var type=navigator.appName
    if (type=="Netscape")
    var lang = navigator.language
    else
    var lang = navigator.userLanguage
    
    //cut down to first 2 chars of country code
    var lang = lang.substr(0,2)
    
    // italian
    if (lang == "it")
    window.location.replace('giris4.html')
    
    // english
    if (lang == "en")
    window.location.replace('giris4-eng.html')
    
    // french
    if (lang == "fr")
    window.location.replace('giris4.html')
    
    // german
    else if (lang == "de")
    window.location.replace('giris4.html')
    
    // turkish
    else if (lang == "tr")
    window.location.replace('giriss.html')
    
    // spanish (add or remove copies of 2 lines below as needed)
    else if (lang == "es")
    window.location.replace('giris4.html')
    
    // if none of above (default to English or any other)
    else
    window.location.replace('giris4.html')
    </script>
  • 11-09-2006, 17:04:31
    #3
    Teşekkür ettim kolay gelsin hepinize