From 5196982c98b4d6bf8370c16c53cc30375ffd2b6f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 31 Aug 2024 09:28:34 +0300 Subject: [PATCH] Improved phrases in box for information of giveaway with credits. --- Telegram/Resources/langs/lang.strings | 4 ++ .../SourceFiles/boxes/gift_premium_box.cpp | 39 +++++++++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 99568c16b..dec9df44f 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -2883,6 +2883,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_prizes_admins#other" = "the admins of {channel}, who aquired **{count} Telegram Premium** subscriptions {duration} for its followers"; "lng_prizes_admins_group#one" = "the admins of {channel}, who aquired **{count} Telegram Premium** subscription {duration} for its members"; "lng_prizes_admins_group#other" = "the admins of {channel}, who aquired **{count} Telegram Premium** subscriptions {duration} for its members"; +"lng_prizes_credits_admins" = "the admins of {channel}, who aquired **{amount}** for its followers"; +"lng_prizes_credits_admins_group" = "the admins of {channel}, who aquired **{amount}** for its members"; +"lng_prizes_credits_admins_amount#one" = "{count} Star"; +"lng_prizes_credits_admins_amount#other" = "{count} Stars"; "lng_prizes_additional_added#one" = "{channel} also included **{count} {prize}** in the prize. Admins of the channel are responsible for delivering this prize."; "lng_prizes_additional_added#other" = "{channel} also included **{count} {prize}** in the prizes. Admins of the channel are responsible for delivering these prizes."; "lng_prizes_additional_added_group#one" = "{channel} also included **{count} {prize}** in the prize. Admins of the group are responsible for delivering this prize."; diff --git a/Telegram/SourceFiles/boxes/gift_premium_box.cpp b/Telegram/SourceFiles/boxes/gift_premium_box.cpp index 8685b04c5..5dd160e38 100644 --- a/Telegram/SourceFiles/boxes/gift_premium_box.cpp +++ b/Telegram/SourceFiles/boxes/gift_premium_box.cpp @@ -1442,22 +1442,39 @@ void GiveawayInfoBox( ? results->channel->isMegagroup() : (!start->channels.empty() && start->channels.front()->isMegagroup()); + const auto credits = start + ? start->credits + : (results ? results->credits : 0); text.append((finished ? tr::lng_prizes_end_text : tr::lng_prizes_how_text)( tr::now, lt_admins, - (group - ? tr::lng_prizes_admins_group - : tr::lng_prizes_admins)( - tr::now, - lt_count, - quantity, - lt_channel, - Ui::Text::Bold(first), - lt_duration, - TextWithEntities{ GiftDuration(months) }, - Ui::Text::RichLangValue), + credits + ? (group + ? tr::lng_prizes_credits_admins_group + : tr::lng_prizes_credits_admins)( + tr::now, + lt_channel, + Ui::Text::Bold(first), + lt_amount, + tr::lng_prizes_credits_admins_amount( + tr::now, + lt_count_decimal, + float64(credits), + Ui::Text::Bold), + Ui::Text::RichLangValue) + : (group + ? tr::lng_prizes_admins_group + : tr::lng_prizes_admins)( + tr::now, + lt_count, + quantity, + lt_channel, + Ui::Text::Bold(first), + lt_duration, + TextWithEntities{ GiftDuration(months) }, + Ui::Text::RichLangValue), Ui::Text::RichLangValue)); const auto many = start ? (start->channels.size() > 1)