#NEWLINE# def get_i18n_block( inifile_or_dict , key ) : #NEWLINE# #INDENT# 'Extracts an i18n block from an ini file or dictionary for a given\n    key.\n    ' #NEWLINE# rv = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , v ) in inifile_or_dict . iteritems ( ) : #NEWLINE# #INDENT# if ( k == key ) : #NEWLINE# #INDENT# rv [ 'en' ] = k #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if k . startswith ( ( key + '[' ) ) : #NEWLINE# #INDENT# rv [ k [ ( len ( key ) + 1 ) : ( - 1 ) ] ] = v #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return rv