[RFC] Automatic localisation of templates

David Hodgkinson davehodg at gmail.com
Thu Jan 19 15:59:40 GMT 2006

On 19 Jan 2006, at 12:22, Simon Wistow wrote:

> Obviously something like
>     [% USE CGI %]
> 	[% USE Localisation('MyTranslation',CGI.http('Accept-language')) %]
> would be very useful.
> Strings not in the lexicon are left untranslated.

Here be dragons.

Do not assume that what someone's browser says they prefer is  
actually what
they prefer.

I did this on the Deep Purple fan site and got irate messages from  
all corners
of the globe: "I'm English in a Brazilian internet cafe", "I'm  
Swedish and my
English is perfect thank you very much" etc. etc.

English/American default, then let the user choose, cookied, what  
they prefer.

Taking a flat-file approach, I just then pushed the language onto the
page search path. If it existed, it was served, otherwise it fell  
back to the
english version. That worked for page furniture too - navigation  
could be
localised if necessary for example.

More information about the london.pm mailing list