}
private void addTranslator(Element rootElement, Document doc, TikaConfig config) {
//TikaConfig only reads the first translator from the list,
//but it looks like it expects a list
Translator translator = config.getTranslator();
if (translator instanceof DefaultTranslator) {
Node mimeComment = doc.createComment(
"for example: "+
"<translator class=\"org.apache.tika.language.translate.GoogleTranslator\"/>");
rootElement.appendChild(mimeComment);
} else {
Element translatorElement = doc.createElement("translator");
translatorElement.setAttribute("class", translator.getClass().getCanonicalName());
rootElement.appendChild(translatorElement);
}
}