       destFile.append(fileName)
       destFile.remove(false) if destFile.exists()
     catch err
-      debug("failed to remove #{header.label}:", err)
+      debug("Translators.uninstall: failed to remove #{header.label}:", err)
     return
 
   install: (header) ->

    try
      code = Zotero.File.getContentsFromURL("resource://zotero-better-bibtex/#{header.label}.js")
    catch err
      debug('Translator.install: ', header, 'could not be loaded:', err)
      throw err

    debug('Translator.load header:', header)
    try
      fileName = Zotero.Translators.getFileNameFromLabel(header.label, header.translatorID)
      destFile = Zotero.getTranslatorsDirectory()
      destFile.append(fileName)

      existing = Zotero.Translators.get(header.translatorID)
      if existing
        if fileName != Zotero.Translators.getFileNameFromLabel(existing.label, existing.translatorID)
          msg = "Translator with ID #{header.translatorID} and label '#{header.label}' overwrites translator with label '#{existing.label}'"
          debug(msg)
          Components.utils.reportError("#{msg} in Translators.install()")

      debug("Saving translator", header.label)

      Zotero.File.putContents(destFile, code)


      debug('Translator.load', header, 'failed:', err)
      @uninstall(header.label, header.translatorID)

    return true

  translate: Zotero.Promise.coroutine((translatorID, displayOptions, items, path) ->
    items ||= { library: Zotero.Libraries.userLibraryID }
