Refactoring

This commit is contained in:
M66B 2022-09-04 17:51:33 +02:00
parent 596e482f56
commit 116ff7f81a
1 changed files with 4 additions and 3 deletions

View File

@ -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");