@Override
    public String translate(String text, String targetLanguage) throws TikaException, IOException {
        if (!this.isAvailable) {
            return text;
        }

        String sourceLanguage = detectLanguage(text).getLanguage();
        return translate(text, sourceLanguage, targetLanguage);
    }
An implementation of a REST client to the <a
href="https://www.googleapis.com/language/translate/v2">Google Translate v2
API</a>. Based on the <a
href="http://hayageek.com/google-translate-api-tutorial/">great tutorial</a>
from <a href="http://hayageek.com">hayageek.com</a>. Set your API key in
translator.google.properties.
tika-translate/src/main/java/org/apache/tika/language/translate/impl/GoogleTranslator.java