1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-19 21:58:53 +00:00

Simplification

This commit is contained in:
M66B 2024-06-16 11:07:20 +02:00
parent f399facb00
commit a41602393d

View file

@ -238,16 +238,7 @@ public class DeepL {
if (html)
request += "&tag_handling=html";
ensureLanguages(context);
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;
}
}
request += "&formality=" + (formality ? "prefer_more" : "prefer_less");
URL url = new URL(getBaseUri(key) + "translate");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();