When user locale is `default`, should use HTTP `accept-language`

(Stephen Chung) #1

Currently, if a user is anonymous, the locale is take from the HTTP accept-language:

This does not happen for logged in users.

For new users who first came to the site, their language is set to the site default. This may not be optimal, as the user can be from any world region.

It would be nice to detect whether user.effective_locale is default, and if so set it to locale_from_header. This way, new users will automatically see the site from his/her own language.

They can, of course, change it themselves in their profile, but not every new user knows how to do this, they being “new”. And language is such a significant part of the user experience.

(Jeff Atwood) #2

The rules are different for anon because it becomes a caching nightmare that ruins performance. I believe @sam has a topic on that he can point you to.

(Stephen Chung) #3

I suspected that it is something similar…

However, if the site is going to have multi-lingual users, then eventually many locales are going to be hit, and you mind as well bite the bullet on day one…

What I’m bringing up is first-impression user experience. A Spanish user these days will expect to surf to a site and see a Spanish version (if available) automatically. He/she won’t expect to need to go into the profile to set language.

(Jeff Atwood) #4

It is quite difficult. Feel free to submit a pull request if you feel this is something that needs to be done.

(Stephen Chung) #5

This one:

Should have searched more before jumping in and creating a new topic. :sweat_smile:

(Jeff Atwood) #6