GemsTracker / gemstracker-library

GEneric Medical Survey Tracker, main library
http://gemstracker.org
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Starting a token shouldn't overwrite the current locale if the locale has already been changed #600

Closed jvangestel closed 4 years ago

jvangestel commented 4 years ago

If you go to the Site Token screen and change the language to another, and you then fill in the token, the site language will change back to the respondent set language. If you then change it back to the language you selected earlier, you get back to the token fill in screen (token was sent in a POST, so all data about it has been discarded).

So instead of changing to the Respondent Language when it isn't the same as the current language, we should also check if the current language has changed (from the default language). Mail tokens will not have a current language on arrival, so will change to the respondent language.