mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Simplification
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user