col_iri = swordCollections[colId].href,
    metadata_entry = metadataEntry,
    in_progress = True)
print "=== DEPOSIT RECEIPT ==="
print derivationDepositReceipt
print "=== /DEPOSIT RECEIPT ==="

# Do auto-translate of CNXML through Google Translate
import GoogleTranslate
sourceCnxml = GoogleTranslate.module_to_cnxml(sourceDocumentId, iUrlPrefix=sourceDocumentUrlPrefix)
version = GoogleTranslate.get_cnxml_version(sourceCnxml)
sourceLanguage = GoogleTranslate.get_cnxml_language(sourceCnxml)
url = sourceDocumentUrlPrefix + sourceDocumentId + '/' + version + '/module_export?format=plain'
print "Translating from %s to %s..."%(sourceLanguage, targetLanguage)
targetCnxml = GoogleTranslate.translate_cnxml(url, sourceLanguage, targetLanguage)
targetCnxml = GoogleTranslate.fix_cnxml_translation(sourceCnxml, targetCnxml)

with open('source.cnxml','wt') as fp:
    fp.write(sourceCnxml)
with open('target.cnxml','wt') as fp:
    fp.write(targetCnxml)

sourceCnxml = sourceCnxml.decode('latin-1')
targetCnxml = targetCnxml.decode('latin-1')

# TODO
# Present the sword:treatment to the user so they go and sign the
# license. Show the user what the authoring roles will look like and
# perhaps build in functionality to help them get this the way they
# want it. For instance, for translation sprints, it might be common
# to include the original authors on the module also.