From c3195cfcbe46ecfdff6655ec040e3274f8f856cb Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 22 Jan 2025 13:19:23 +0400 Subject: [PATCH] Improve convert-to-stars message in channel gift. --- Telegram/Resources/langs/lang.strings | 2 ++ .../view/media/history_view_premium_gift.cpp | 4 +++- .../settings/settings_credits_graphics.cpp | 16 ++++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 4e6603885..f88a2cfc4 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3343,6 +3343,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_gift_display_done_hide_channel" = "The gift is now hidden from channel's Gifts."; "lng_gift_got_stars#one" = "You got **{count} Star** for this gift."; "lng_gift_got_stars#other" = "You got **{count} Stars** for this gift."; +"lng_gift_channel_got#one" = "Channel got **{count} Star** for this gift."; +"lng_gift_channel_got#other" = "Channel got **{count} Stars** for this gift."; "lng_gift_sold_out_title" = "Sold Out!"; "lng_gift_sold_out_text#one" = "All {count} gift was already sold."; "lng_gift_sold_out_text#other" = "All {count} gifts were already sold."; diff --git a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp index 033f7ec5e..3321dab5b 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_premium_gift.cpp @@ -140,7 +140,9 @@ TextWithEntities PremiumGift::subtitle() { tr::now, Ui::Text::RichLangValue) : (_data.converted - ? tr::lng_gift_got_stars + ? (toChannel + ? tr::lng_gift_channel_got + : tr::lng_gift_got_stars) : _parent->history()->peer->isSelf() ? tr::lng_action_gift_self_about : toChannel diff --git a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp index 481fc8f2d..632610299 100644 --- a/Telegram/SourceFiles/settings/settings_credits_graphics.cpp +++ b/Telegram/SourceFiles/settings/settings_credits_graphics.cpp @@ -254,11 +254,13 @@ void ConvertStarGift( window->showSettings(Settings::CreditsId()); } } - show->showToast(tr::lng_gift_got_stars( - tr::now, - lt_count, - stars, - Ui::Text::RichLangValue)); + show->showToast((savedId.chat() + ? tr::lng_gift_channel_got + : tr::lng_gift_got_stars)( + tr::now, + lt_count, + stars, + Ui::Text::RichLangValue)); done(true); }).fail([=](const MTP::Error &error) { show->showToast(error.type()); @@ -1344,7 +1346,9 @@ void GenericCreditsEntryBox( : giftToChannelCanTransfer ? tr::lng_action_gift_channel_about : tr::lng_action_gift_got_stars_text) - : tr::lng_gift_got_stars)( + : (giftToChannel + ? tr::lng_gift_channel_got + : tr::lng_gift_got_stars))( lt_count, rpl::single(e.starsConverted * 1.), Ui::Text::RichLangValue),