'Set the Preview language
Arguments:
request (Request): The incoming Django Request
context dict: The basic context for the Response
Returns:
HttpResponse: View containing the form for setting the preview lang with the status
included in the context'

def _set_preview_language(self, request, context):

    message = None
    show_refresh_message = False
    preview_lang = request.POST.get(LANGUAGE_INPUT_FIELD, '')
    if (not preview_lang.strip()):
        message = _('Language    code    not    provided')
    else:
        request.session[LANGUAGE_SESSION_KEY] = preview_lang
        auth_user = request.user
        if auth_user:
            set_user_preference(request.user, DARK_LANGUAGE_KEY, preview_lang)
        message = _('Language    set    to    language    code:    {preview_language_code}').format(preview_language_code=preview_lang)
        show_refresh_message = True
    context.update({'form_submit_message': message})
    context.update({'success': show_refresh_message})
    response = render_to_response(self.template_name, context)
    return response
