mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
596e482f56
commit
116ff7f81a
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue