DeepL: experimental

pull/199/head
M66B 3 years ago
parent 4031b3d671
commit 2f399d1809

@ -2992,6 +2992,10 @@ The bounce address (=*Return-Path* header) is mostly very specific, so the email
For some background, see for [this Wikipedia article](https://en.wikipedia.org/wiki/Bounce_message).
*Translate button (version 1.1600+)*
Please see [this FAQ](#user-content-faq167) about how to configure DeepL.
<br />
<a name="faq126"></a>

@ -155,6 +155,12 @@ public class DeepL {
}
}
public static boolean isAvailable(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean experiments = prefs.getBoolean("experiments", false);
return (experiments && !BuildConfig.PLAY_STORE_RELEASE);
}
public static boolean canTranslate(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String deepl_key = prefs.getString("deepl_key", null);

@ -1027,7 +1027,8 @@ public class FragmentCompose extends FragmentBase {
grpAttachments.setVisibility(View.GONE);
tvNoInternet.setVisibility(View.GONE);
grpBody.setVisibility(View.GONE);
ibTranslate.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
ibTranslate.setVisibility(
DeepL.isAvailable(getContext()) ? View.VISIBLE : View.GONE);
grpSignature.setVisibility(View.GONE);
grpReferenceHint.setVisibility(View.GONE);
ibReferenceEdit.setVisibility(View.GONE);

Loading…
Cancel
Save