'Check the user\'s dark language setting in the session and apply it'

def _activate_preview_language(self, request):

    auth_user = request.user.is_authenticated()
    preview_lang = None
    if auth_user:
        preview_lang = get_user_preference(request.user, DARK_LANGUAGE_KEY)
    if (not preview_lang):
        return
    request.session[LANGUAGE_SESSION_KEY] = preview_lang
