[mod_python] Language selection

Jim Gallacher jpg at jgassociates.ca
Mon May 22 10:53:37 EDT 2006


Wouter van Marle wrote:
> On Mon, 2006-05-22 at 09:53 -0400, Jim Gallacher wrote:
>> Wouter van Marle wrote:
>>> Hi all,
>>>
>>> I know it's possible through the http request for browsers to indicate
>>> preference for a language.
>>> Can anyone explain how that works? Or are there code snippets available
>>> for mod_python?
>>>
>>> My website now supports four languages (English, Dutch, Chinese
>>> Simplified, Chinese Traditional), defaulting to English. If the user
>>> wants another language, they have to select it manually. It'd be nice if
>>> I can detect there preference and default to that.
>> You want to examine the Accept-Language header, which will likely be set 
>> by the browser. See RFC-2616 at http://rfc.net/rfc2616.html#s14.4
> 
> I found that one in the meantime as well.
> Not easy - searching for "language" on google gives heaps of references
> to PROGRAMMING languages... 

Including "rfc" in your search terms will help when you are looking for 
information on internet protocols. My reaction when I first started 
reading the RFCs was, "Oh, so that's how the internet works". And of 
course your education is not complete until you've read and thoroughly 
understood RFC-1149. Implementation is left to you as an exercise. ;)

Jim


More information about the Mod_python mailing list