diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSelectionHelper.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSelectionHelper.java index 467e171434..ec580b9f75 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSelectionHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/TextSelectionHelper.java @@ -1450,7 +1450,7 @@ public boolean onPrepareActionMode(ActionMode mode, Menu menu) { private String translateFromLanguage = null; private void updateTranslateButton(Menu menu) { - menu.getItem(3).setVisible(!LanguageDetector.hasSupport() || translateFromLanguage != null && !TranslateHelper.isLanguageRestricted(translateFromLanguage)); + menu.getItem(3).setVisible(!LanguageDetector.hasSupport() || translateFromLanguage == null || !TranslateHelper.isLanguageRestricted(translateFromLanguage)); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java index f011b1fd52..d0ab601fa8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/TranslateAlert.java @@ -256,7 +256,7 @@ public TranslateAlert(BaseFragment fragment, Context context, int currentAccount this.onLinkPress = onLinkPress; this.noforwards = noforwards; this.fragment = fragment; - this.fromLanguage = /*fromLanguage != null && fromLanguage.equals("und") ? "auto" : */fromLanguage; + this.fromLanguage = fromLanguage == null || fromLanguage.equals("und") ? "auto" : fromLanguage; this.toLanguage = toLanguage; this.text = text; this.textBlocks = new ArrayList<>();