mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 05:37:07 +00:00
Added comments
This commit is contained in:
parent
142366b738
commit
3fef005543
1 changed files with 2 additions and 0 deletions
|
@ -187,6 +187,7 @@ public class DeepL {
|
|||
}
|
||||
|
||||
public static Translation translate(String text, String target, Context context) throws IOException, JSONException {
|
||||
// https://www.deepl.com/docs-api/translating-text/request/
|
||||
String request =
|
||||
"text=" + URLEncoder.encode(text, StandardCharsets.UTF_8.name()) +
|
||||
"&target_lang=" + URLEncoder.encode(target, StandardCharsets.UTF_8.name());
|
||||
|
@ -242,6 +243,7 @@ public class DeepL {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String key = prefs.getString("deepl_key", null);
|
||||
|
||||
// https://www.deepl.com/docs-api/other-functions/monitoring-usage/
|
||||
URL url = new URL(getBaseUri(context) + "usage?auth_key=" + key);
|
||||
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
|
||||
connection.setReadTimeout(DEEPL_TIMEOUT * 1000);
|
||||
|
|
Loading…
Reference in a new issue