FIX: Include resolved locale in anonymous cache key (PR #10289)

This only applies when allow_user_locale is enabled

GitHub

Very nice.

Is there a specific error we’re expecting here? I usually try and avoid a blank rescue since things like a typo will go unnoticed.

I just copied/pasted the code as-is from ApplicationController#locale_from_header

But I do agree with you. Based on the comment, I think the rescue is there to cope with a missing header. I’ll add a check for that, and remove the rescue :+1:

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/variable-default-interface-language-for-new-users/33741/45

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/is-there-a-way-to-set-default-language-based-on-browser-settings/151032/4

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/switch-language-via-url/28937/20