@Override
    public String translate(String text, String sourceLanguage, String targetLanguage)
            throws TikaException, IOException {
        if (!this.isAvailable) {
            return text;
        }
        Response response = client.accept(MediaType.APPLICATION_JSON).query("user_key", userKey)
                .query("source", sourceLanguage).query("target", targetLanguage).query("q", text)
                .get();
        StringBuilder responseText = new StringBuilder();
        try (InputStreamReader inputStreamReader = new InputStreamReader(
                (InputStream) response.getEntity(), UTF_8);
                BufferedReader reader = new BufferedReader(inputStreamReader)) {
            String line;
            while ((line = reader.readLine()) != null) {
                responseText.append(line);
            }
        }

        ObjectMapper mapper = new ObjectMapper();
        JsonNode jsonResp = mapper.readTree(responseText.toString());
        if (jsonResp.findValuesAsText("errors").isEmpty()) {
            return jsonResp.findValuesAsText("translation").get(0);
        } else {
            throw new TikaException(jsonResp.findValue("errors").get(0).asText());
        }
    }
An implementation of a REST client for the
<a href="https://developer.lingo24.com/premium-machine-translation-api">Premium MT API v1</a>.
You can sign up for an access plan online on the <a href="https://developer.lingo24.com/plans">Lingo24 Developer Portal</a>
and set your Application's User Key in the <code>translator.lingo24.properties</code> file.
tika-translate/src/main/java/org/apache/tika/language/translate/impl/Lingo24Translator.java