Visitor System Foreign Language Detection

  Air_Man 12:46 06 Apr 05

I would like to be able to detect which language a visitor's system is using and display appropriate English/French/Russian etc. content on the home page. There will be links for the visitor to click to change language, but it would be nice to welcome the visitor in their own language from the minute the page loads. While I appreciate that the solution may not be foolproof, I am sure I should be able to do this with standard HTML and/or Javascript but have had not luck searching the web in general.

So I thought I'd consult the experts. Any advice anyone?

  harristweed 14:11 06 Apr 05

try here

click here

  Air_Man 06:13 07 Apr 05

Thx Harristweed. I'll give it a go today and let you know how I get on.

  Air_Man 08:05 09 Apr 05

the solution was a bit over complicated, so I dug around a bit more. In the end I found the navigator.userLanguage object, and since I only need to check three languages, used the code below:

function showLang(){

var lang = this.navigator.userLanguage.toLowerCase();
lang2 = lang.substring(0,2);
if(lang2 == "en"){EnglishTop()};
if(lang2 == "fr"){FrenchTop()};
if(lang2 == "it"){ItalianTop()};


Thanx for your help.

This thread is now locked and can not be replied to.

Nintendo Switch (Nintendo NX) release date, price, specs and preview trailer: Codename NX console…

1995-2015: How technology has changed the world in 20 years

8 things designers (and brands) need to know about the modern woman

How to speed up a slow Mac: 19 great tips to make an iMac, MacBook or Mac mini run faster | Speed…