From 221ef741506e6b8ebc724e585091d8c8524ea76c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 28 Mar 2022 21:57:21 +0300 Subject: [PATCH] Slightly improved phrases in clear history box. --- Telegram/Resources/langs/lang.strings | 8 ++++---- Telegram/SourceFiles/boxes/delete_messages_box.cpp | 14 +++++++++----- Telegram/SourceFiles/boxes/delete_messages_box.h | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 921b35184..6902ec66a 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1225,9 +1225,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_failed_add_not_mutual_channel" = "Sorry, if a person leaves a channel, only a mutual contact can bring them back (they need to have your phone number, and you need theirs)."; "lng_sure_delete_contact" = "Are you sure you want to delete {contact} from your contact list?"; -"lng_sure_delete_history" = "Are you sure you want to delete all message history with {contact}?\n\nThis action cannot be undone."; -"lng_sure_delete_group_history" = "Are you sure, you want to delete all message history in «{group}»?\n\nThis action cannot be undone."; -"lng_sure_delete_and_exit" = "Are you sure, you want to delete all message history and leave «{group}»?\n\nThis action cannot be undone."; +"lng_sure_delete_history" = "Are you sure you want to clear your chat history with **{contact}**?\n\nThis action cannot be undone."; +"lng_sure_delete_group_history" = "Are you sure, you want to delete all message history in **«{group}»**?\n\nThis action cannot be undone."; +"lng_sure_delete_and_exit" = "Are you sure, you want to delete all message history and leave **«{group}»**?\n\nThis action cannot be undone."; "lng_sure_leave_channel" = "Are you sure you want to leave\nthis channel?"; "lng_sure_delete_channel" = "Are you sure you want to delete this channel? All members will be removed and all messages will be lost."; "lng_sure_leave_group" = "Are you sure you want to leave this group?"; @@ -2012,7 +2012,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_selected_unsend_about_group#one" = "You can also delete the {count} message you sent from the inboxes of other group members by checking \"Unsend my messages\"."; "lng_selected_unsend_about_group#other" = "You can also delete the {count} messages you sent from the inboxes of other group members by checking \"Unsend my messages\"."; "lng_delete_for_everyone_check" = "Delete for everyone"; -"lng_delete_for_other_check" = "Also delete for {user}"; +"lng_delete_for_other_check" = "Also delete for **{user}**"; "lng_delete_for_other_my" = "Unsend my messages"; "lng_box_delete" = "Delete"; "lng_box_leave" = "Leave"; diff --git a/Telegram/SourceFiles/boxes/delete_messages_box.cpp b/Telegram/SourceFiles/boxes/delete_messages_box.cpp index 39c09647d..90d0fcc24 100644 --- a/Telegram/SourceFiles/boxes/delete_messages_box.cpp +++ b/Telegram/SourceFiles/boxes/delete_messages_box.cpp @@ -125,6 +125,7 @@ void DeleteMessagesBox::prepare() { tr::now, lt_group, peer->name); + details = Ui::Text::RichLangValue(details.text); deleteStyle = &st::attentionBoxButton; } else { details.text = peer->isSelf() @@ -136,6 +137,7 @@ void DeleteMessagesBox::prepare() { : peer->isMegagroup() ? tr::lng_sure_leave_group(tr::now) : tr::lng_sure_leave_channel(tr::now); + details = Ui::Text::RichLangValue(details.text); if (!peer->isUser()) { *deleteText = tr::lng_box_leave(); } @@ -322,11 +324,12 @@ auto DeleteMessagesBox::revokeText(not_null peer) const result.checkbox = tr::lng_delete_for_other_check( tr::now, lt_user, - user->firstName); + { user->firstName }, + Ui::Text::RichLangValue); } else if (_wipeHistoryJustClear) { return std::nullopt; } else { - result.checkbox = tr::lng_delete_for_everyone_check(tr::now); + result.checkbox.text = tr::lng_delete_for_everyone_check(tr::now); } return result; } @@ -362,13 +365,14 @@ auto DeleteMessagesBox::revokeText(not_null peer) const result.checkbox = tr::lng_delete_for_other_check( tr::now, lt_user, - user->firstName); + { user->firstName }, + Ui::Text::RichLangValue); } else { - result.checkbox = tr::lng_delete_for_everyone_check(tr::now); + result.checkbox.text = tr::lng_delete_for_everyone_check(tr::now); } return result; } else if (canRevokeOutgoingCount > 0) { - result.checkbox = tr::lng_delete_for_other_my(tr::now); + result.checkbox.text = tr::lng_delete_for_other_my(tr::now); if (const auto user = peer->asUser()) { if (canRevokeOutgoingCount == 1) { result.description = tr::lng_selected_unsend_about_user_one( diff --git a/Telegram/SourceFiles/boxes/delete_messages_box.h b/Telegram/SourceFiles/boxes/delete_messages_box.h index 61b8773e7..48a80da9d 100644 --- a/Telegram/SourceFiles/boxes/delete_messages_box.h +++ b/Telegram/SourceFiles/boxes/delete_messages_box.h @@ -48,7 +48,7 @@ protected: private: struct RevokeConfig { - QString checkbox; + TextWithEntities checkbox; TextWithEntities description; }; void deleteAndClear();