[ale] Can I identify the country of origin?

Denny Chambers dchambers at snapserver.com
Wed Sep 25 11:50:03 EDT 2002


Your correct that the  Accept-Language will not guarantee the REAL 
country where the user resides, But if all you want to know is what 
language the user preferes, the Accept-Language will give you that. The 
language codes will take the form LANGUAGE-CODE_COUNTRY-CODE_VARIANT. 
Examples: "en", or "en_US", or (not Likely) "en_US_GA". You can look at 
ISO-639 for standard language codes, ISO-3166 for standard country 
codes. This way if you want to have a locale version of your web page 
for Spanish (Spain) versus Spanish (Mexico), you can use the 
Accept-Language to figure that out.

I would also look at http://www.w3.org/International/, there is some 
good info here.

Denny

Jim wrote:

>On Wednesday 25 September 2002 11:05 am, Matt Smith wrote:
>  
>
>>If I'm not mistaken, Apache already has this functionality.  It's not based
>>on the IP's country of origin, but the language settings of the browser
>>which are sent with the request.
>>
>>If you've ever noticed the default homepage(s) that come with Apache,
>>there's one for basically many languages, and apache will auto-select the
>>page and display it automatically.  I'd provide a good link, but I can't
>>get to apache.org right now for some reason. :/
>>
>>I would go down that path before trying to roll your own.  (Assuming you're
>>using Apache, of course)
>>
>>If you're not using apache, you can analyze your server logs using
>>webalizer and it does a rough estimation of country of origin - it even
>>generates a pretty pie chart. :)
>>
>>
>>--Matt
>>    
>>
>
>I am looking at my documentation for Apache now. There are three fields in the 
>header being sent by the browser that relate to locale:
>
>Accept-Language
>Accept-Encoding
>Accept-Charset
>
>This can get complicated fast, due to the messy way we use ASCII to render 
>non-Roman characters. For Russian--which I use often--Apache uses no less 
>than seven different encodings. Some of these may also render Ukrainian and 
>Byelorussian. But if you peg everything on,say, the Accept-Language header, 
>that only tells you the user's preference, not the country 
>he lives in.
>
>---
>This message has been sent through the ALE general discussion list.
>See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
>sent to listmaster at ale dot org.
>
>  
>



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list