#NEWLINE# def add_view( self , request , **kwargs ) : #NEWLINE# #INDENT# kwargs [ 'form_url' ] = request . get_full_path ( ) #NEWLINE# if ( ( 'translation_of' in request . GET ) and ( 'language' in request . GET ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# original = self . model . _tree_manager . get ( pk = request . GET . get ( 'translation_of' ) ) #NEWLINE# #UNINDENT# except ( AttributeError , self . model . DoesNotExist ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# language_code = request . GET [ 'language' ] #NEWLINE# language = dict ( django_settings . LANGUAGES ) . get ( self , '' ) #NEWLINE# kwargs [ 'extra_context' ] = { #NEWLINE# #INDENT# 'adding_translation' : True , #NEWLINE# 'title' : ( _ ( 'Add %(language)s translation of "%(page)s"' ) % { #NEWLINE# #INDENT# 'language' : language , #NEWLINE# 'page' : original , #NEWLINE# #UNINDENT# } ) , #NEWLINE# 'language_name' : language , #NEWLINE# 'translation_of' : original , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# return super ( PageAdmin , self ) . add_view ( request , ** kwargs )