mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 05:15:13 +02:00
DeepL: comments
This commit is contained in:
@@ -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()) +
|
||||
|
||||
Reference in New Issue
Block a user