On 24 Dec 2004, at 13:08, Octavian Rasnita wrote:

Hi,

Does Template-Toolkit have a method of getting the list of languages
preffered by the browser in order to be able to serve the content in one of
those languages?
I would like to check if the first prefered language is available on my site
and if it is not, try the second and so on, until I find the prefered
language for which I have a content translation, or if I don't have for any
of those languages, use a default language.


I have done a script that does something like this, but I would like to know
if there is a better done way.

I have a handler that does this, on the theory that setting the charset in the header is better than using meta tags.

Thinking about it, isn't the list of accepted languages part of the
environment anyway? env.HTTP ACCEPT LANGUAGE ?

Oh, and one more experience thing - we found that many people get upset at
your presumption that they want their native language by default!



-- Dave Hodgkinson CTO, Rockit Factory Ltd. http://www.rockitfactory.com/ Web sites for rock bands


_______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to