def translate_tmpl(prefix, lng):
 src = open((EMAIL_DIR + ('/%s-en.tmpl' % prefix)), 'r')
 data = src.read().decode('utf-8')
 src.close()
 data = _(data).encode('utf-8')
 fp = open(('email/%s-%s.tmpl' % (prefix, lng)), 'wb')
 if (not ((-1) < data.find('UTF-8') < 30)):
  fp.write('#encoding UTF-8\n')
 fp.write(data)
 fp.close()

def translate_tmpl ( prefix , lng ) : src = open ( ( EMAIL_DIR + ( '/%s-en.tmpl' % prefix ) ) , 'r' ) data = src . read ( ) . decode ( 'utf-8' ) src . close ( ) data = _ ( data ) . encode ( 'utf-8' ) fp = open ( ( 'email/%s-%s.tmpl' % ( prefix , lng ) ) , 'wb' ) if ( not ( ( - 1 ) < data . find ( 'UTF-8' ) < 30 ) ) : fp . write ( '#encoding UTF-8\n' ) fp . write ( data ) fp . close ( )
translate template prefix into language lng .