<s> from django . conf import settings <EOL> from django . template import loader , RequestContext <EOL> from xadmin . sites import site <EOL> from xadmin . views import BaseAdminPlugin , CommAdminView <EOL> class SetLangNavPlugin ( BaseAdminPlugin ) : <EOL> def block_top_navmenu ( self , context , nodes ) : <EOL> nodes . append ( <EOL> loader . render_to_string ( '<STR_LIT>' , { <EOL> '<STR_LIT>' : self . request . get_full_path ( ) , <EOL> } ) ) <EOL> if settings . LANGUAGES and '<STR_LIT>' in settings . MIDDLEWARE_CLASSES : <EOL> site . register_plugin ( SetLangNavPlugin , CommAdminView ) <EOL> site . register_view ( r'<STR_LIT>' , lambda site : '<STR_LIT>' , '<STR_LIT>' ) </s>
