[thelist] Site language selection

Bill Moseley moseley at hank.org
Wed Sep 9 09:26:25 CDT 2009


I've used a number of ways to determine which language to return to a user,
including looking at Accept-Language header, a url prefix (
http://example.com/en/index.html) and a user-preference selected on the
sited and stored in cookie or session.
I'm thinking that for any method of detection/selection that I should
redirect to the url prefix approach so that the language is included in the
URL.  The reason is for caching -- if a page is cached and the user changes
language they need to fetch the new version and not the cached version in
their old language.

Typically, /foo, /es/foo, /de/foo all return the same content, just in
different languages.

Do you agree that redirecting to include the language in the URL makes
sense?

I've also have avoided using a query parameter to specify the language (
?lang=es ).  I remember some issues with caching-proxies not caching any
content with a query string (although I suspect that's not a issue anymore).

I have not had different css for different languages, but we do have some
images used as backgrounds that have text, but I can see that being an
issue.
Probably the easiest approach there is to add a language class to the <body>
and use css to select different images based on the class.





-- 
Bill Moseley
moseley at hank.org



More information about the thelist mailing list