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

**URL:** <https://meta.discourse.org/t/when-user-locale-is-default-should-use-http-accept-language/70770>\
**Category:** Feature\
**Created:** [Setembro 26, 2017, 2:25am UTC](https://meta.discourse.org/t/when-user-locale-is-default-should-use-http-accept-language/70770 "2017-09-26T02:25:31Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [Setembro 26, 2017, 2:25am UTC](https://meta.discourse.org/t/when-user-locale-is-default-should-use-http-accept-language/70770/1 "2017-09-26T02:25:31Z")

</div>

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

> <https://github.com/discourse/discourse/blob/main/app/controllers/application_controller.rb#L212-L223>

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.

---

_[View the full topic](https://meta.discourse.org/t/when-user-locale-is-default-should-use-http-accept-language/70770)._
