#NEWLINE# def render_preference_panel( self , req , panel ) : #NEWLINE# #INDENT# if ( req . method == 'POST' ) : #NEWLINE# #INDENT# if ( Locale and ( req . args . get ( 'language' ) != req . session . get ( 'language' ) ) ) : #NEWLINE# #INDENT# del req . locale #NEWLINE# deactivate ( ) #NEWLINE# make_activable ( ( lambda : req . locale ) , self . env . path ) #NEWLINE# #UNINDENT# _do_save ( req , panel , self . _form_fields ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'timezones' : all_timezones , #NEWLINE# 'timezone' : get_timezone , #NEWLINE# 'localtz' : localtz , #NEWLINE# 'has_babel' : False , #NEWLINE# #UNINDENT# } #NEWLINE# if Locale : #NEWLINE# #INDENT# locale_ids = get_available_locales ( ) #NEWLINE# locales = [ Locale . parse ( locale ) for locale in locale_ids ] #NEWLINE# languages = sorted ( ( ( id_ , languages . display_name ) for ( id_ , locale ) in zip ( locale_ids , locales ) ) ) #NEWLINE# data [ 'locales' ] = locales #NEWLINE# data [ 'languages' ] = languages #NEWLINE# data [ 'has_babel' ] = True #NEWLINE# #UNINDENT# return ( 'prefs_localization.html' , data )