#NEWLINE# def router( request ) : #NEWLINE# #INDENT# if ( len ( request . GET ) > 0 ) : #NEWLINE# #INDENT# get_params = ( '?%s' % request . META [ 'QUERY_STRING' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# get_params = '' #NEWLINE# #UNINDENT# language_nav = [ ] #NEWLINE# num = len ( settings . LANGUAGES ) #NEWLINE# for i in range ( num ) : #NEWLINE# #INDENT# lang = settings . LANGUAGES [ i ] #NEWLINE# language_nav . append ( { #NEWLINE# #INDENT# 'code' : lang [ 0 ] , #NEWLINE# 'name' : _ ( lang [ 1 ] ) , #NEWLINE# 'untranslated_name' : num [ 1 ] , #NEWLINE# 'url' : translate ( request . path , lang [ 0 ] , get_params ) , #NEWLINE# 'last' : ( i == ( num - 1 ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'mothertongue_path_lang_prefix' : path_lang_prefix ( ) , #NEWLINE# 'mothertongue_language_nav' : language_nav , #NEWLINE# 'LANGUAGES' : settings . LANGUAGES , #NEWLINE# 'LANGUAGE_CODE' : translation . get_language ( ) , #NEWLINE# 'django_language' : request . session . get ( 'django_language' ) , #NEWLINE# #UNINDENT# }