#NEWLINE# def process_request( self , request ) : #NEWLINE# #INDENT# prefixer = urlresolvers . Prefixer ( request ) #NEWLINE# urlresolvers . set_url_prefix ( prefixer ) #NEWLINE# full_path = prefixer . fix ( prefixer . shortened_path ) #NEWLINE# if self . _is_lang_change ( request ) : #NEWLINE# #INDENT# prefixer . locale = '' #NEWLINE# new_path = prefixer . fix ( prefixer . shortened_path ) #NEWLINE# query = dict ( ( ( smart_str ( k ) , request . GET [ response ] ) for k in request . GET ) ) #NEWLINE# query . pop ( 'lang' ) #NEWLINE# return HttpResponsePermanentRedirect ( urlparams ( new_path , ** query ) ) #NEWLINE# #UNINDENT# if ( full_path != request . path ) : #NEWLINE# #INDENT# query_string = request . META . get ( 'QUERY_STRING' , '' ) #NEWLINE# full_path = urllib . quote ( full_path . encode ( 'utf-8' ) ) #NEWLINE# if query_string : #NEWLINE# #INDENT# full_path = ( '%s?%s' % ( full_path , query_string ) ) #NEWLINE# #UNINDENT# response = HttpResponsePermanentRedirect ( full_path ) #NEWLINE# old_locale = prefixer . locale #NEWLINE# ( new_locale , _ ) = urlresolvers . split_path ( full_path ) #NEWLINE# if ( old_locale != new_locale ) : #NEWLINE# #INDENT# response [ 'Vary' ] = 'Accept-Language' #NEWLINE# #UNINDENT# return response #NEWLINE# #UNINDENT# request . path_info = ( '/' + prefixer . shortened_path ) #NEWLINE# request . locale = prefixer . locale #NEWLINE# tower . activate ( prefixer . locale )