Use more simple tr::... text helpers.
This commit is contained in:
@@ -103,7 +103,7 @@ object_ptr<Ui::RpWidget> AntiSpamValidator::createButton() const {
|
||||
tr::now,
|
||||
lt_count,
|
||||
EnableAntiSpamMinMembers(channel),
|
||||
Ui::Text::RichLangValue));
|
||||
tr::rich));
|
||||
} else {
|
||||
channel->session().api().request(MTPchannels_ToggleAntiSpam(
|
||||
channel->inputChannel,
|
||||
@@ -157,11 +157,11 @@ void AntiSpamValidator::addAction(
|
||||
const auto text = tr::lng_admin_log_antispam_menu_report_toast(
|
||||
tr::now,
|
||||
lt_link,
|
||||
Ui::Text::Link(
|
||||
tr::link(
|
||||
tr::lng_admin_log_antispam_menu_report_toast_link(
|
||||
tr::now),
|
||||
"internal:show"),
|
||||
Ui::Text::RichLangValue);
|
||||
tr::rich);
|
||||
const auto showToast = [=,
|
||||
window = _controller,
|
||||
channel = _channel] {
|
||||
|
||||
@@ -102,10 +102,10 @@ void AddAction(
|
||||
: tr::lng_mediaview_saved_to)(
|
||||
tr::now,
|
||||
lt_downloads,
|
||||
Ui::Text::Link(
|
||||
tr::link(
|
||||
tr::lng_mediaview_downloads(tr::now),
|
||||
"internal:show_saved_message"),
|
||||
Ui::Text::WithEntities),
|
||||
tr::marked),
|
||||
.filter = filter,
|
||||
.st = &st::defaultToast,
|
||||
});
|
||||
|
||||
@@ -278,8 +278,8 @@ EffectPreview::EffectPreview(
|
||||
this,
|
||||
tr::lng_effect_premium(
|
||||
lt_link,
|
||||
tr::lng_effect_premium_link() | Ui::Text::ToLink(),
|
||||
Ui::Text::WithEntities),
|
||||
tr::lng_effect_premium_link(tr::link),
|
||||
tr::marked),
|
||||
st::effectPreviewPromoLabel),
|
||||
st::effectPreviewPromoPadding))
|
||||
, _bottom(_send ? ((Ui::RpWidget*)_send.get()) : _premiumPromoLabel.get())
|
||||
|
||||
@@ -149,7 +149,7 @@ void AboutBox(
|
||||
: isSearch
|
||||
? tr::lng_sponsored_revenued_info1_search_description
|
||||
: tr::lng_sponsored_revenued_info1_bot_description)(
|
||||
Ui::Text::RichLangValue),
|
||||
tr::rich),
|
||||
st::sponsoredAboutPrivacyIcon);
|
||||
if (!isSearch) {
|
||||
Ui::AddSkip(content);
|
||||
@@ -161,14 +161,14 @@ void AboutBox(
|
||||
(isChannel
|
||||
? tr::lng_sponsored_revenued_info2_description
|
||||
: tr::lng_sponsored_revenued_info2_bot_description)(
|
||||
Ui::Text::RichLangValue),
|
||||
tr::rich),
|
||||
st::sponsoredAboutSplitIcon);
|
||||
}
|
||||
Ui::AddSkip(content);
|
||||
Ui::AddSkip(content);
|
||||
auto link = tr::lng_settings_privacy_premium_link(
|
||||
) | rpl::map([](QString t) {
|
||||
return Ui::Text::Link(std::move(t), u"internal:"_q);
|
||||
return tr::link(std::move(t), u"internal:"_q);
|
||||
});
|
||||
addEntry(
|
||||
tr::lng_sponsored_revenued_info3_title(),
|
||||
@@ -178,7 +178,7 @@ void AboutBox(
|
||||
rpl::single(float64(levels)),
|
||||
lt_link,
|
||||
std::move(link),
|
||||
Ui::Text::RichLangValue)
|
||||
tr::rich)
|
||||
: isSearch
|
||||
? tr::lng_sponsored_revenued_info3_search_description(
|
||||
lt_link,
|
||||
@@ -186,18 +186,18 @@ void AboutBox(
|
||||
lt_arrow,
|
||||
rpl::single(
|
||||
Ui::Text::IconEmoji(&st::textMoreIconEmoji)),
|
||||
Ui::Text::WithEntities
|
||||
tr::marked
|
||||
) | rpl::map([](TextWithEntities &&link) {
|
||||
return Ui::Text::Wrapped(
|
||||
std::move(link),
|
||||
EntityType::CustomUrl,
|
||||
u"internal:"_q);
|
||||
}),
|
||||
Ui::Text::RichLangValue)
|
||||
tr::rich)
|
||||
: tr::lng_sponsored_revenued_info3_bot_description(
|
||||
lt_link,
|
||||
std::move(link),
|
||||
Ui::Text::RichLangValue)),
|
||||
tr::rich)),
|
||||
st::sponsoredAboutRemoveIcon)->setClickHandlerFilter([=](
|
||||
const auto &...) {
|
||||
ShowPremiumPreviewBox(show, PremiumFeature::NoAds);
|
||||
@@ -233,11 +233,11 @@ void AboutBox(
|
||||
tr::lng_channel_earn_about_link(
|
||||
lt_emoji,
|
||||
rpl::single(arrow),
|
||||
Ui::Text::RichLangValue
|
||||
tr::rich
|
||||
) | rpl::map([=](TextWithEntities t) {
|
||||
return Ui::Text::Link(std::move(t), kUrl.utf16());
|
||||
return tr::link(std::move(t), kUrl.utf16());
|
||||
}),
|
||||
Ui::Text::RichLangValue),
|
||||
tr::rich),
|
||||
st::channelEarnLearnDescription))->resizeToWidth(available);
|
||||
}
|
||||
Ui::AddSkip(content);
|
||||
@@ -305,7 +305,7 @@ void AboutBox(
|
||||
void ShowReportSponsoredBox(
|
||||
std::shared_ptr<ChatHelpers::Show> show,
|
||||
Data::SponsoredReportAction report) {
|
||||
const auto guideLink = Ui::Text::Link(
|
||||
const auto guideLink = tr::link(
|
||||
tr::lng_report_sponsored_reported_link(tr::now),
|
||||
u"https://promote.telegram.org/guidelines"_q);
|
||||
|
||||
@@ -343,7 +343,7 @@ void ShowReportSponsoredBox(
|
||||
tr::lng_report_sponsored_reported_learn(
|
||||
lt_link,
|
||||
rpl::single(guideLink),
|
||||
Ui::Text::WithEntities),
|
||||
tr::marked),
|
||||
st::boxDividerLabel),
|
||||
st::defaultBoxDividerLabelPadding));
|
||||
}
|
||||
@@ -364,7 +364,7 @@ void ShowReportSponsoredBox(
|
||||
tr::now,
|
||||
lt_link,
|
||||
guideLink,
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
show->showToast({
|
||||
.text = std::move(text),
|
||||
.duration = kToastDuration,
|
||||
|
||||
@@ -96,9 +96,9 @@ Args TTLValidator::createArgs() const {
|
||||
lt_link,
|
||||
tr::lng_ttl_edit_about2_link(
|
||||
) | rpl::map([=](const QString &s) {
|
||||
return Ui::Text::Link(s, "tg://settings/auto_delete");
|
||||
return tr::link(s, "tg://settings/auto_delete");
|
||||
}),
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
auto about = rpl::combine(
|
||||
std::move(about1),
|
||||
std::move(about2)
|
||||
|
||||
Reference in New Issue
Block a user