From 29b0055e39e71d274f0eb6bb9e45989369a816ac Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 18 Dec 2024 10:58:38 +0300 Subject: [PATCH] Slightly improved some phrases on error while add participant to chat. --- Telegram/Resources/langs/lang.strings | 5 +++++ Telegram/SourceFiles/boxes/add_contact_box.cpp | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 1bc6933bf..7977c29f2 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -289,6 +289,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_error_cant_add_member" = "Sorry, you can't add the bot to this group. Ask a group admin to do it."; "lng_error_cant_add_bot" = "Sorry, this bot can't be added to groups."; "lng_error_cant_add_admin_invite" = "You can't add this user as an admin because they are not a member of this group and you are not allowed to add them."; +"lng_error_you_blocked_user" = "Sorry, you can't add this user or bot to groups because you've blocked them. Please unblock to proceed."; +"lng_error_add_admin_not_member" = "You can't add this user as an admin because they are not a member of this group and you are not allowed to add them."; +"lng_error_user_admin_invalid" = "You can't ban this user because they are an admin in this group and you are not allowed to demote them."; +"lng_error_channel_bots_too_much" = "Sorry, this channel has too many bots."; +"lng_error_group_bots_too_much" = "There are too many bots in this group. Please remove some of the bots you're not using first."; "lng_error_cant_add_admin_unban" = "Sorry, you can't add this user as an admin because they are in the Removed Users list and you can't unban them."; "lng_error_cant_ban_admin" = "You can't ban this user because they are an admin in this group and you are not allowed to demote them."; "lng_error_cant_reply_other" = "This message can't be replied in another chat."; diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index 0aba9b6a5..020550774 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -262,10 +262,16 @@ void ShowAddParticipantsError( return tr::lng_bot_already_in_group(tr::now); } else if (error == u"BOT_GROUPS_BLOCKED"_q) { return tr::lng_error_cant_add_bot(tr::now); - } else if (error == u"ADMINS_TOO_MUCH"_q) { - return ((chat->isChat() || chat->isMegagroup()) - ? tr::lng_error_admin_limit - : tr::lng_error_admin_limit_channel)(tr::now); + } else if (error == u"YOU_BLOCKED_USER"_q) { + return tr::lng_error_you_blocked_user(tr::now); + } else if (error == u"CHAT_ADMIN_INVITE_REQUIRED"_q) { + return tr::lng_error_add_admin_not_member(tr::now); + } else if (error == u"USER_ADMIN_INVALID"_q) { + return tr::lng_error_user_admin_invalid(tr::now); + } else if (error == u"BOTS_TOO_MUCH"_q) { + return (chat->isChannel() + ? tr::lng_error_channel_bots_too_much + : tr::lng_error_group_bots_too_much)(tr::now); } return tr::lng_failed_add_participant(tr::now); }();