mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve gifts phrases.
This commit is contained in:
parent
da426ae03b
commit
1cc5988c40
2 changed files with 62 additions and 27 deletions
|
@ -2026,13 +2026,19 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_action_gift_unique_sent" = "You sent a unique collectible item";
|
"lng_action_gift_unique_sent" = "You sent a unique collectible item";
|
||||||
"lng_action_gift_upgraded" = "{user} turned the gift from you into a unique collectible";
|
"lng_action_gift_upgraded" = "{user} turned the gift from you into a unique collectible";
|
||||||
"lng_action_gift_upgraded_channel" = "{user} turned this gift to {channel} into a unique collectible";
|
"lng_action_gift_upgraded_channel" = "{user} turned this gift to {channel} into a unique collectible";
|
||||||
|
"lng_action_gift_upgraded_self_channel" = "You turned this gift to {channel} into a unique collectible";
|
||||||
"lng_action_gift_upgraded_mine" = "You turned the gift from {user} into a unique collectible";
|
"lng_action_gift_upgraded_mine" = "You turned the gift from {user} into a unique collectible";
|
||||||
"lng_action_gift_upgraded_self" = "You turned this gift into a unique collectible";
|
"lng_action_gift_upgraded_self" = "You turned this gift into a unique collectible";
|
||||||
"lng_action_gift_transferred" = "{user} transferred you a gift";
|
"lng_action_gift_transferred" = "{user} transferred you a gift";
|
||||||
"lng_action_gift_transferred_channel" = "{user} transferred a gift to {channel}";
|
"lng_action_gift_transferred_channel" = "{user} transferred a gift to {channel}";
|
||||||
|
"lng_action_gift_transferred_unknown" = "Someone transferred you a gift";
|
||||||
|
"lng_action_gift_transferred_unknown_channel" = "Someone transferred a gift to {channel}";
|
||||||
|
"lng_action_gift_transferred_self" = "You transferred a unique collectible";
|
||||||
|
"lng_action_gift_transferred_self_channel" = "You transferred a gift to {channel}";
|
||||||
"lng_action_gift_transferred_mine" = "You transferred a gift to {user}";
|
"lng_action_gift_transferred_mine" = "You transferred a gift to {user}";
|
||||||
"lng_action_gift_received_anonymous" = "Unknown user sent you a gift for {cost}";
|
"lng_action_gift_received_anonymous" = "Unknown user sent you a gift for {cost}";
|
||||||
"lng_action_gift_sent_channel" = "{user} sent a gift to {name} for {cost}";
|
"lng_action_gift_sent_channel" = "{user} sent a gift to {name} for {cost}";
|
||||||
|
"lng_action_gift_sent_self_channel" = "You sent a gift to {name} for {cost}";
|
||||||
"lng_action_gift_self_bought" = "You bought a gift for {cost}";
|
"lng_action_gift_self_bought" = "You bought a gift for {cost}";
|
||||||
"lng_action_gift_self_subtitle" = "Saved Gift";
|
"lng_action_gift_self_subtitle" = "Saved Gift";
|
||||||
"lng_action_gift_self_about#one" = "Display this gift on your page or convert it to **{count}** Star.";
|
"lng_action_gift_self_about#one" = "Display this gift on your page or convert it to **{count}** Star.";
|
||||||
|
|
|
@ -5456,17 +5456,28 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
const auto from = fromId ? peer->owner().peer(fromId) : peer;
|
const auto from = fromId ? peer->owner().peer(fromId) : peer;
|
||||||
const auto channel = peer->owner().channel(
|
const auto channel = peer->owner().channel(
|
||||||
peerToChannel(giftPeer));
|
peerToChannel(giftPeer));
|
||||||
result.links.push_back(from->createOpenLink());
|
if (from->isSelf()) {
|
||||||
result.links.push_back(channel->createOpenLink());
|
result.links.push_back(channel->createOpenLink());
|
||||||
result.text = tr::lng_action_gift_sent_channel(
|
result.text = tr::lng_action_gift_sent_self_channel(
|
||||||
tr::now,
|
tr::now,
|
||||||
lt_user,
|
lt_name,
|
||||||
Ui::Text::Link(from->shortName(), 1),
|
Ui::Text::Link(channel->name(), 1),
|
||||||
lt_name,
|
lt_cost,
|
||||||
Ui::Text::Link(channel->name(), 2),
|
cost,
|
||||||
lt_cost,
|
Ui::Text::WithEntities);
|
||||||
cost,
|
} else {
|
||||||
Ui::Text::WithEntities);
|
result.links.push_back(from->createOpenLink());
|
||||||
|
result.links.push_back(channel->createOpenLink());
|
||||||
|
result.text = tr::lng_action_gift_sent_channel(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
Ui::Text::Link(from->shortName(), 1),
|
||||||
|
lt_name,
|
||||||
|
Ui::Text::Link(channel->name(), 2),
|
||||||
|
lt_cost,
|
||||||
|
cost,
|
||||||
|
Ui::Text::WithEntities);
|
||||||
|
}
|
||||||
} else if (anonymous || _history->peer->isSelf()) {
|
} else if (anonymous || _history->peer->isSelf()) {
|
||||||
result.text = (anonymous
|
result.text = (anonymous
|
||||||
? tr::lng_action_gift_received_anonymous
|
? tr::lng_action_gift_received_anonymous
|
||||||
|
@ -5512,24 +5523,33 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
if (toChannel) {
|
if (toChannel) {
|
||||||
const auto channel = peer->owner().channel(
|
const auto channel = peer->owner().channel(
|
||||||
peerToChannel(giftPeer));
|
peerToChannel(giftPeer));
|
||||||
result.links.push_back(from->createOpenLink());
|
if (!from->isServiceUser() && !from->isSelf()) {
|
||||||
|
result.links.push_back(from->createOpenLink());
|
||||||
|
result.text = (action.is_upgrade()
|
||||||
|
? tr::lng_action_gift_upgraded_channel
|
||||||
|
: tr::lng_action_gift_transferred_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
Ui::Text::Link(from->shortName(), 1),
|
||||||
|
lt_channel,
|
||||||
|
Ui::Text::Link(channel->name(), 2),
|
||||||
|
Ui::Text::WithEntities);
|
||||||
|
} else {
|
||||||
|
result.text = (from->isServiceUser()
|
||||||
|
? tr::lng_action_gift_transferred_unknown_channel
|
||||||
|
: action.is_upgrade()
|
||||||
|
? tr::lng_action_gift_upgraded_self_channel
|
||||||
|
: tr::lng_action_gift_transferred_self_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_channel,
|
||||||
|
Ui::Text::Link(channel->name(), 1),
|
||||||
|
Ui::Text::WithEntities);
|
||||||
|
}
|
||||||
result.links.push_back(channel->createOpenLink());
|
result.links.push_back(channel->createOpenLink());
|
||||||
result.text = (action.is_upgrade()
|
|
||||||
? tr::lng_action_gift_upgraded_channel
|
|
||||||
: tr::lng_action_gift_transferred_channel)(
|
|
||||||
tr::now,
|
|
||||||
lt_user,
|
|
||||||
Ui::Text::Link(from->shortName(), 1),
|
|
||||||
lt_channel,
|
|
||||||
Ui::Text::Link(channel->name(), 2),
|
|
||||||
Ui::Text::WithEntities);
|
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(peer->createOpenLink());
|
if (!from->isServiceUser() && !_history->peer->isSelf()) {
|
||||||
result.text = _history->peer->isSelf()
|
result.links.push_back(from->createOpenLink());
|
||||||
? tr::lng_action_gift_upgraded_self(
|
result.text = (action.is_upgrade()
|
||||||
tr::now,
|
|
||||||
Ui::Text::WithEntities)
|
|
||||||
: (action.is_upgrade()
|
|
||||||
? (isSelf
|
? (isSelf
|
||||||
? tr::lng_action_gift_upgraded_mine
|
? tr::lng_action_gift_upgraded_mine
|
||||||
: tr::lng_action_gift_upgraded)
|
: tr::lng_action_gift_upgraded)
|
||||||
|
@ -5540,6 +5560,15 @@ void HistoryItem::setServiceMessageByAction(const MTPmessageAction &action) {
|
||||||
lt_user,
|
lt_user,
|
||||||
Ui::Text::Link(from->shortName(), 1), // Link 1.
|
Ui::Text::Link(from->shortName(), 1), // Link 1.
|
||||||
Ui::Text::WithEntities);
|
Ui::Text::WithEntities);
|
||||||
|
} else {
|
||||||
|
result.text = (from->isServiceUser()
|
||||||
|
? tr::lng_action_gift_transferred_unknown
|
||||||
|
: action.is_upgrade()
|
||||||
|
? tr::lng_action_gift_upgraded_self
|
||||||
|
: tr::lng_action_gift_transferred_self)(
|
||||||
|
tr::now,
|
||||||
|
Ui::Text::WithEntities);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue