DeepL: comments

This commit is contained in:
M66B 2021-05-19 19:29:50 +02:00
parent 2473059950
commit e363d5bb34
1 changed files with 5 additions and 0 deletions

View File

@ -37,8 +37,13 @@ import java.nio.charset.StandardCharsets;
import javax.net.ssl.HttpsURLConnection;
public class DeepL {
// https://www.deepl.com/docs-api/
private static final int DEEPL_TIMEOUT = 20; // seconds
// curl https://api-free.deepl.com/v2/languages \
// -d auth_key=42c191db-21ba-9b96-2464-47a9a5e81b4a:fx \
// -d type=target
public static String translate(String text, String target, Context context) throws IOException, JSONException {
String request =
"text=" + URLEncoder.encode(text, StandardCharsets.UTF_8.name()) +