From 45ebf7b5c6960b444d8359a85554a2b927d08190 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 1 Aug 2025 17:47:37 +0400 Subject: [PATCH] Use separate keys for add buttons. --- Telegram/Resources/langs/lang.strings | 2 ++ .../info/peer_gifts/info_peer_gifts_widget.cpp | 10 +++++----- .../info/stories/info_stories_inner_widget.cpp | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 7290984b24..641f0b66d7 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3789,6 +3789,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_gift_collection_empty_text" = "Add some of your gifts to this collection."; "lng_gift_collection_all" = "All Gifts"; "lng_gift_collection_add_title" = "Add Gifts"; +"lng_gift_collection_add_button" = "Add Gifts"; "lng_gift_collection_share" = "Share Collection"; "lng_gift_collection_edit" = "Edit Name"; "lng_gift_collection_limit_title" = "Limit Reached"; @@ -6496,6 +6497,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_stories_album_empty_text" = "Add some of your stories to this album."; "lng_stories_album_all" = "All Stories"; "lng_stories_album_add_title" = "Add Stories"; +"lng_stories_album_add_button" = "Add Stories"; "lng_stories_album_share" = "Share Album"; "lng_stories_album_edit" = "Edit Name"; "lng_stories_album_limit_title" = "Limit Reached"; diff --git a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp index 63b983337b..f89ed3b313 100644 --- a/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp +++ b/Telegram/SourceFiles/info/peer_gifts/info_peer_gifts_widget.cpp @@ -811,7 +811,7 @@ void InnerWidget::showMenuForCollection(int id) { } _menu = base::make_unique_q(this, st::popupMenuWithIcons); const auto addAction = Ui::Menu::CreateAddActionCallback(_menu); - addAction(tr::lng_gift_collection_add_title(tr::now), [=] { + addAction(tr::lng_gift_collection_add_button(tr::now), [=] { editCollectionGifts(id); }, &st::menuIconGiftPremium); if (const auto username = _peer->username(); !username.isEmpty()) { @@ -1003,7 +1003,7 @@ void InnerWidget::refreshAbout() { rpl::single(QString()), st::collectionEmptyButton)), st::collectionEmptyAddMargin)->entity(); - button->setText(tr::lng_gift_collection_add_title( + button->setText(tr::lng_gift_collection_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); })); @@ -1108,7 +1108,7 @@ void InnerWidget::editCollectionGifts(int id) { auto text = state->changes.value( ) | rpl::map([=](const Data::GiftsUpdate &update) { return (!update.added.empty() && update.removed.empty()) - ? tr::lng_gift_collection_add_title() + ? tr::lng_gift_collection_add_button() : tr::lng_settings_save(); }) | rpl::flatten_latest(); box->addButton(std::move(text), [=] { @@ -1392,7 +1392,7 @@ void InnerWidget::fillMenu(const Ui::Menu::MenuCallback &addAction) { }, &st::menuIconAddToFolder); } } else if (canManage) { - addAction(tr::lng_gift_collection_add_title(tr::now), [=] { + addAction(tr::lng_gift_collection_add_button(tr::now), [=] { editCollectionGifts(collectionId); }, &st::menuIconGiftPremium); @@ -1557,7 +1557,7 @@ void Widget::setupBottomButton( rpl::single(QString()), st::collectionEditBox.button); button->setTextTransform(Ui::RoundButton::TextTransform::NoTransform); - button->setText(tr::lng_gift_collection_add_title( + button->setText(tr::lng_gift_collection_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); })); diff --git a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp index f6830d6fbf..d086c9372c 100644 --- a/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp +++ b/Telegram/SourceFiles/info/stories/info_stories_inner_widget.cpp @@ -132,7 +132,7 @@ void EditAlbumBox::prepare() { auto text = _changes.value( ) | rpl::map([=](const Data::StoryAlbumUpdate &update) { return (!update.added.empty() && update.removed.empty()) - ? tr::lng_stories_album_add_title() + ? tr::lng_stories_album_add_button() : tr::lng_settings_save(); }) | rpl::flatten_latest(); addButton(std::move(text), [=] { @@ -607,7 +607,7 @@ void InnerWidget::refreshEmpty() { rpl::single(QString()), st::collectionEmptyButton)), st::collectionEmptyAddMargin)->entity(); - button->setText(tr::lng_stories_album_add_title( + button->setText(tr::lng_stories_album_add_button( ) | rpl::map([](const QString &text) { return Ui::Text::IconEmoji(&st::collectionAddIcon).append(text); })); @@ -738,7 +738,7 @@ void InnerWidget::showMenuForAlbum(int id) { _menu = base::make_unique_q(this, st::popupMenuWithIcons); const auto addAction = Ui::Menu::CreateAddActionCallback(_menu); if (_peer->canEditStories()) { - addAction(tr::lng_stories_album_add_title(tr::now), [=] { + addAction(tr::lng_stories_album_add_button(tr::now), [=] { editAlbumStories(id); }, &st::menuIconStoriesSave); }