rox icon indicating copy to clipboard operation
rox copied to clipboard

Chosen language lost at every (non logged-in) return to the website

Open nonno opened this issue 5 years ago • 6 comments

I noticed a not perfect behaviour of language selection. When a non logged-in user choose a language, this one is kept till the logout, and re-visiting the homepage, the selected language is English again. Being an Italian translator I like to have it in Italian since the beginning. I would change the behaviour like this:

  • check the presence of a cookie for the chosen language
  • if the cookie is not present, check the accept-language array in the request's headers, using the first one available
  • when the user manually changes the language with the selector on the top left, that choice is saved in the cookie (with no expiration date)

Verified on both Chrome and Firefox (last versions). Of course it's just a low-priority misbehaviour.

nonno avatar Dec 19 '20 20:12 nonno

@nonno Is this still the case with the code currently deployed?

thisismeonmounteverest avatar Feb 21 '21 09:02 thisismeonmounteverest

@thisismeonmounteverest yep. Not only: I'm on the landing page, I set Italian as language (=> Italian), I log-in (=> Italian). If I logout I'm in English again. No big deal but it's not an optimal behaviour.

nonno avatar Feb 21 '21 13:02 nonno

What language is set in your browser? (I need the locale information.)

Firefox: image

Chrome: image

thisismeonmounteverest avatar Feb 21 '21 13:02 thisismeonmounteverest

Screenshot 2021-02-21 at 14 24 51 Screenshot 2021-02-21 at 14 26 10

nonno avatar Feb 21 '21 13:02 nonno

@nonno The current behavior I see is that accessing the page at https://beta.bewelcome.org when logged out the page is displayed in Italian as expected. After login it switches to my preferred language and on logout the Language is English. As soon as I refresh it is Italian again.

I try to figure out why it imposed the English on logout.

thisismeonmounteverest avatar Mar 06 '21 08:03 thisismeonmounteverest

@thisismeonmounteverest for what I can see both in beta and in production at the first opening of the home the page (not logged) is always in English. This even if the request has it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7,fr-FR;q=0.6,fr;q=0.5,pt-BR;q=0.4,pt-PT;q=0.3,pt;q=0.2 as Accept-Language, like in my case. In an ideal world when not logged the language selected should be always the first one available of those in that array. No big deal, but it could be little bit a barrier for someone arriving there for the first time.

nonno avatar Mar 06 '21 12:03 nonno