From c1a63164c028c7046baf372b13a1c0c936fa4be8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 23 Apr 2023 18:00:18 +0400 Subject: [PATCH] Make count-depended button texts in filter links. --- Telegram/Resources/langs/lang.strings | 6 ++++-- Telegram/SourceFiles/ui/controls/filter_link_header.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index e80949b7f..bb61f52c1 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3627,7 +3627,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_by_link_more" = "Add Chats to Folder"; "lng_filters_by_link_more_sure" = "Do you want to join chats and add them to the folder {folder}?"; "lng_filters_by_link_about" = "You can deselect the chats you don't want to join."; -"lng_filters_by_link_join_button" = "Join Chats"; +"lng_filters_by_link_and_join_button#one" = "Join Chat"; +"lng_filters_by_link_and_join_button#other" = "Join Chats"; "lng_filters_by_link_join_no" = "Do not join any chats"; "lng_filters_by_link_already" = "Folder already added"; "lng_filters_by_link_already_about" = "You have already added the folder {folder} and all its chats."; @@ -3641,7 +3642,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_filters_by_link_deselect" = "Deselect All"; "lng_filters_by_link_about_quit" = "You can deselect the chats you don't want to quit."; "lng_filters_by_link_remove_button" = "Remove Folder and Keep Chats"; -"lng_filters_by_link_quit_button" = "Remove Folder and Chats"; +"lng_filters_by_link_and_quit_button#one" = "Remove Folder and Chat"; +"lng_filters_by_link_and_quit_button#other" = "Remove Folder and Chats"; "lng_filters_added_title" = "Folder {folder} Added"; "lng_filters_added_also#one" = "You also joined {count} chat."; "lng_filters_added_also#other" = "You also joined {count} chats."; diff --git a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp index 8c60e671c..475d04ca5 100644 --- a/Telegram/SourceFiles/ui/controls/filter_link_header.cpp +++ b/Telegram/SourceFiles/ui/controls/filter_link_header.cpp @@ -372,13 +372,17 @@ object_ptr FilterLinkProcessButton( case FilterLinkHeaderType::AddingChats: return badge.isEmpty() ? tr::lng_filters_by_link_join_no() | with(QString()) - : tr::lng_filters_by_link_join_button() | with(badge); + : tr::lng_filters_by_link_and_join_button( + lt_count, + rpl::single(float64(count))) | with(badge); case FilterLinkHeaderType::AllAdded: return tr::lng_box_ok() | with(QString()); case FilterLinkHeaderType::Removing: return badge.isEmpty() ? tr::lng_filters_by_link_remove_button() | with(QString()) - : tr::lng_filters_by_link_quit_button() | with(badge); + : tr::lng_filters_by_link_and_quit_button( + lt_count, + rpl::single(float64(count))) | with(badge); } Unexpected("Type in FilterLinkProcessButton."); }) | rpl::flatten_latest();