diff --git a/openedx/core/djangoapps/lang_pref/middleware.py b/openedx/core/djangoapps/lang_pref/middleware.py index d0a787c5daa..a480c2577ed 100644 --- a/openedx/core/djangoapps/lang_pref/middleware.py +++ b/openedx/core/djangoapps/lang_pref/middleware.py @@ -66,6 +66,8 @@ def process_response(self, request, response): # lint-amnesty, pylint: disable= # DarkLangMiddleware has already set this cookie if DarkLangConfig.current().enabled and get_user_preference(current_user, DARK_LANGUAGE_KEY): + new_lang = get_user_preference(current_user, DARK_LANGUAGE_KEY) + lang_pref_helpers.set_language_cookie(request, response, new_lang) return response anonymous_cookie_lang = getattr(request, '_anonymous_user_cookie_lang', None)