mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
DeepL: improvements
This commit is contained in:
@@ -21,6 +21,7 @@ package eu.faircode.email;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
@@ -154,6 +155,12 @@ public class DeepL {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canTranslate(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String deepl_key = prefs.getString("deepl_key", null);
|
||||
return !TextUtils.isEmpty(deepl_key);
|
||||
}
|
||||
|
||||
public static Integer[] getUsage(Context context) throws IOException, JSONException {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
String key = prefs.getString("deepl_key", null);
|
||||
|
||||
Reference in New Issue
Block a user