mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-19 21:58:53 +00:00
Simplification
This commit is contained in:
parent
f399facb00
commit
a41602393d
1 changed files with 1 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue