The whole if-else could be:

var what = (_resources.length == 1) ? "'${_resources.first.name}'" : "'${_resources.length}' files";
deleteDialog.element.querySelector("#message").text =
       "Are you sure you want to delete $what from the file system?";