|
|
@ -238,16 +238,7 @@ public class DeepL {
|
|
|
|
if (html)
|
|
|
|
if (html)
|
|
|
|
request += "&tag_handling=html";
|
|
|
|
request += "&tag_handling=html";
|
|
|
|
|
|
|
|
|
|
|
|
ensureLanguages(context);
|
|
|
|
request += "&formality=" + (formality ? "prefer_more" : "prefer_less");
|
|
|
|
for (int i = 0; i < jlanguages.length(); i++) {
|
|
|
|
|
|
|
|
JSONObject jlanguage = jlanguages.getJSONObject(i);
|
|
|
|
|
|
|
|
if (Objects.equals(target, jlanguage.getString("language"))) {
|
|
|
|
|
|
|
|
boolean supports_formality = jlanguage.optBoolean("supports_formality");
|
|
|
|
|
|
|
|
if (supports_formality)
|
|
|
|
|
|
|
|
request += "&formality=" + (formality ? "more" : "less");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
URL url = new URL(getBaseUri(key) + "translate");
|
|
|
|
URL url = new URL(getBaseUri(key) + "translate");
|
|
|
|
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
|
|
|
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
|
|
|