#NEWLINE# def satchmo_language_selection_form( context ) : #NEWLINE# #INDENT# '\n    Display the set language form, if enabled in shop settings.\n    ' #NEWLINE# request = threadlocals . get_current_request ( ) #NEWLINE# enabled = get_l10n_setting ( 'allow_translation_choice' ) #NEWLINE# languages = [ ] #NEWLINE# if enabled : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# url = urlresolvers . reverse ( 'satchmo_set_language' ) #NEWLINE# languages = settings . LANGUAGES #NEWLINE# #UNINDENT# except urlresolvers . NoReverseMatch : #NEWLINE# #INDENT# url = '' #NEWLINE# log . warning ( 'No url found for satchmo_set_language (OK if running tests)' ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# url = '' #NEWLINE# #UNINDENT# media_url = context . get ( 'media_url' , None ) #NEWLINE# return { #NEWLINE# #INDENT# 'enabled' : enabled , #NEWLINE# 'set_language_url' : url , #NEWLINE# 'languages' : languages , #NEWLINE# 'media_url' : media_url , #NEWLINE# 'django_language' : request . session . get ( 'django_language' , 'en' ) , #NEWLINE# #UNINDENT# }