From 4c911705ab52b47f09c99470d027d7420f56944b Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 11 Dec 2023 17:35:20 +0100 Subject: [PATCH] fix issue #995 - Don't display translate popup if there is only one choice --- .../fedilab/android/mastodon/helper/TranslateHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/mastodon/helper/TranslateHelper.java b/app/src/main/java/app/fedilab/android/mastodon/helper/TranslateHelper.java index 3e7e0da8..0f159528 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/helper/TranslateHelper.java +++ b/app/src/main/java/app/fedilab/android/mastodon/helper/TranslateHelper.java @@ -79,8 +79,13 @@ public class TranslateHelper { Set translates = sharedpreferences.getStringSet(context.getString(R.string.SET_LIVE_TRANSLATE_MULTIPLE), null); String translate; - if (translates == null || translates.size() == 0) { + if (translates == null || translates.size() <= 1) { translate = MyTransL.getLocale(); + if(translates != null && translates.size() == 1 ) { + for (String val : translates) { + translate = val; + } + } myTransL.translate(statusToTranslate, translate, params, new Results() { @Override public void onSuccess(com.github.stom79.mytransl.translate.Translate translate) {