def perform_translation(unit, form, request):
 oldchecks = set(unit.active_checks().values_list(u'check', flat=True))
 if (not unit.translation.is_template()):
  (new_target, fixups) = fix_target(form.cleaned_data[u'target'], unit)
 else:
  new_target = form.cleaned_data[u'target']
  fixups = []
 saved = unit.translate(request, new_target, form.cleaned_data[u'fuzzy'])
 if (len(fixups) > 0):
  messages.info(request, (_(u'Following fixups were applied to translation: %s') % u', '.join([force_text(f) for f in fixups])))
 newchecks = set(unit.active_checks().values_list(u'check', flat=True))
 if (saved and (newchecks > oldchecks)):
  messages.error(request, _(u'Some checks have failed on your translation: {0}').format(u', '.join([force_text(CHECKS[check].name) for check in newchecks])))
  return False
 return True

def perform_translation ( unit , form , request ) : oldchecks = set ( unit . active_checks ( ) . values_list ( u'check' , flat = True ) ) if ( not unit . translation . is_template ( ) ) : ( new_target , fixups ) = fix_target ( form . cleaned_data [ u'target' ] , unit ) else : new_target = form . cleaned_data [ u'target' ] fixups = [ ] saved = unit . translate ( request , new_target , form . cleaned_data [ u'fuzzy' ] ) if ( len ( fixups ) > 0 ) : messages . info ( request , ( _ ( u'Following fixups were applied to translation: %s' ) % u', ' . join ( [ force_text ( f ) for f in fixups ] ) ) ) newchecks = set ( unit . active_checks ( ) . values_list ( u'check' , flat = True ) ) if ( saved and ( newchecks > oldchecks ) ) : messages . error ( request , _ ( u'Some checks have failed on your translation: {0}' ) . format ( u', ' . join ( [ force_text ( CHECKS [ check ] . name ) for check in newchecks ] ) ) ) return False return True
handles translation and stores it to a backend .