Preconditions:
- course discovery enabled
STR:
- log in
- choose any language with different date format (e.g. ukrainian)
- check date format changed on the /courses page
- logout and go to /courses again
AR:
- date format is english on /courses, but stays the same as for logged in
user on the main page
ER:
- date format stays the same as for logged in user
When side-wide language is set via LANGUAGE_CODE site configuration,
some elements of legacy UI still use the language set in user
preferences (or None, which fallsback to 'en' if nothing is set in
preferences). The expectation is that everything should be translated to
the language which is set in the site configuration.
In legacy UI (i.e. templates) the code of the current language sometimes
is needed, and in these cases `user_language` variable from the context
is used. The value for that variable is inserted via context processor,
which takes the value from the user preferences.
The solution modifies the context processor to check if there is a
language set in site configuration, and if there is, send that value,
instead of whatever value there was in user peferences.