diff --git a/app/src/main/java/eu/faircode/email/LanguageTool.java b/app/src/main/java/eu/faircode/email/LanguageTool.java index 1c6bd8ea24..5181d376ae 100644 --- a/app/src/main/java/eu/faircode/email/LanguageTool.java +++ b/app/src/main/java/eu/faircode/email/LanguageTool.java @@ -55,14 +55,15 @@ public class LanguageTool { "text=" + URLEncoder.encode(text.toString(), StandardCharsets.UTF_8.name()) + "&language=auto"; - // curl -X GET --header 'Accept: application/json' 'https://api.languagetool.org/v2/languages - String code = null; + // curl -X GET --header 'Accept: application/json' 'https://api.languagetool.org/v2/languages' JSONArray jlanguages; - Locale locale = Locale.getDefault(); try (InputStream is = context.getAssets().open("lt.json")) { String json = Helper.readStream(is); jlanguages = new JSONArray(json); } + + String code = null; + Locale locale = Locale.getDefault(); for (int i = 0; i < jlanguages.length(); i++) { JSONObject jlanguage = jlanguages.getJSONObject(i); String c = jlanguage.optString("longCode");