Skip to content

Commit

Permalink
Improve convert-to-stars message in channel gift.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jan 22, 2025
1 parent 51661a8 commit c3195cf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions Telegram/SourceFiles/settings/settings_credits_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit c3195cf

Please sign in to comment.