diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index ac109399c..da5bcd182 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -15332,16 +15332,17 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setMessage(LocaleController.getString("TranslateFailed", R.string.TranslateFailed)); builder.setNeutralButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> showDialog(NekoSettingsActivity.getTranslationProviderAlert(getParentActivity()))); - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); - builder.show(); + builder.setPositiveButton(LocaleController.getString("Retry", R.string.Retry), (dialog, which) -> processSelectedOption(option)); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); + showDialog(builder.create()); } @Override public void onUnsupported() { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); builder.setMessage(LocaleController.getString("TranslateApiUnsupported", R.string.TranslateApiUnsupported)); - builder.setNeutralButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> showDialog(NekoSettingsActivity.getTranslationProviderAlert(getParentActivity()))); - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); + builder.setPositiveButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> showDialog(NekoSettingsActivity.getTranslationProviderAlert(getParentActivity()))); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); showDialog(builder.create()); } }); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java index 3999985dd..2dbdf41b8 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java @@ -73,7 +73,8 @@ public class MessageHelper extends BaseController { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(LocaleController.getString("TranslateFailed", R.string.TranslateFailed)); builder.setNeutralButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> NekoSettingsActivity.getTranslationProviderAlert(context).show()); - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); + builder.setPositiveButton(LocaleController.getString("Retry", R.string.Retry), (dialog, which) -> showTranslateDialog(context, query)); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); builder.show(); } @@ -84,8 +85,8 @@ public class MessageHelper extends BaseController { } AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setMessage(LocaleController.getString("TranslateApiUnsupported", R.string.TranslateApiUnsupported)); - builder.setNeutralButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> NekoSettingsActivity.getTranslationProviderAlert(context).show()); - builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null); + builder.setPositiveButton(LocaleController.getString("TranslationProvider", R.string.TranslationProvider), (dialog, which) -> NekoSettingsActivity.getTranslationProviderAlert(context).show()); + builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null); builder.show(); } });