#NEWLINE# def fix( self , path ) : #NEWLINE# #INDENT# path = path . lstrip ( '/' ) #NEWLINE# url_parts = [ self . request . META [ 'SCRIPT_NAME' ] ] #NEWLINE# first_part = path . partition ( '/' ) [ 0 ] #NEWLINE# if ( ( first_part not in settings . SUPPORTED_NONLOCALES ) and ( first_part not in settings . LANGUAGE_URL_MAP ) ) : #NEWLINE# #INDENT# locale = ( self . locale if self . locale else self . get_language ( ) ) #NEWLINE# url_parts . append ( locale ) #NEWLINE# #UNINDENT# url_parts . append ( path ) #NEWLINE# return '/' . join ( url_parts )