View Single Post
Old 12-30-2013, 07:22 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Another approach is to:
my $lang = "$ENV{'HTTP_ACCEPT_LANGUAGE'}";

that would envelope the browser language.
First of all: it is faster than a Max-Mind Geo-IP lookup -- there is no database overhead.
Secondly as an example, if you are in Montreal and using a French-Canadian language browser your HTTP_ACCEPT_LANGUAGE would be :
Accept-Language: fr-CA;q=0.5
Using Geo-IP you would assume Canada and offer the default English language version which would be in error. Say your surfer is an American travelling in Italy using a hotel wireless with an Italian IP but with his laptop's en-US language browser?

Well, you see my point ...

http://en.wikipedia.org/wiki/Content_negotiation

http://www.w3.org/International/ques...-http-and-lang
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote