Use more simple tr::... text helpers.
This commit is contained in:
@@ -1108,7 +1108,7 @@ TextWithEntities Manager::ComposeReactionNotification(
|
||||
tr::now,
|
||||
lt_reaction,
|
||||
reactionWithEntities,
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
};
|
||||
if (hideContent) {
|
||||
return simple(tr::lng_reaction_notext);
|
||||
@@ -1121,7 +1121,7 @@ TextWithEntities Manager::ComposeReactionNotification(
|
||||
reactionWithEntities,
|
||||
lt_text,
|
||||
item->notificationText(),
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
};
|
||||
if (!media || media->webpage()) {
|
||||
return text();
|
||||
@@ -1142,8 +1142,8 @@ TextWithEntities Manager::ComposeReactionNotification(
|
||||
lt_reaction,
|
||||
reactionWithEntities,
|
||||
lt_emoji,
|
||||
Ui::Text::WithEntities(sticker->alt),
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked(sticker->alt),
|
||||
tr::marked);
|
||||
}
|
||||
return simple(tr::lng_reaction_document);
|
||||
} else if (const auto contact = media->sharedContact()) {
|
||||
@@ -1162,8 +1162,8 @@ TextWithEntities Manager::ComposeReactionNotification(
|
||||
lt_reaction,
|
||||
reactionWithEntities,
|
||||
lt_name,
|
||||
Ui::Text::WithEntities(name),
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked(name),
|
||||
tr::marked);
|
||||
} else if (media->location()) {
|
||||
return simple(tr::lng_reaction_location);
|
||||
// lng_reaction_live_location not used right now :(
|
||||
@@ -1176,7 +1176,7 @@ TextWithEntities Manager::ComposeReactionNotification(
|
||||
reactionWithEntities,
|
||||
lt_title,
|
||||
poll->question,
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
} else if (media->game()) {
|
||||
return simple(tr::lng_reaction_game);
|
||||
} else if (media->invoice()) {
|
||||
|
||||
@@ -1003,7 +1003,7 @@ void Notification::updateNotifyDisplay() {
|
||||
auto title = options.hideNameAndPhoto
|
||||
? TextWithEntities{ u"Telegram Desktop"_q }
|
||||
: reminder
|
||||
? tr::lng_notification_reminder(tr::now, Ui::Text::WithEntities)
|
||||
? tr::lng_notification_reminder(tr::now, tr::marked)
|
||||
: topicWithChat();
|
||||
const auto fullTitle = manager()->addTargetAccountName(
|
||||
std::move(title),
|
||||
|
||||
@@ -665,8 +665,8 @@ void CreateForExistingBox(
|
||||
const auto amCreator = window->account().sessionExists()
|
||||
&& (window->account().session().userId() == cloud.createdBy);
|
||||
box->setTitle(amCreator
|
||||
? (rpl::single(cloud.title) | Ui::Text::ToWithEntities())
|
||||
: tr::lng_theme_editor_create_title(Ui::Text::WithEntities));
|
||||
? (rpl::single(cloud.title) | rpl::map(tr::marked))
|
||||
: tr::lng_theme_editor_create_title(tr::marked));
|
||||
|
||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
||||
box,
|
||||
@@ -790,7 +790,7 @@ void SaveThemeBox(
|
||||
? GenerateName(collected.accent)
|
||||
: cloud.title;
|
||||
|
||||
box->setTitle(tr::lng_theme_editor_save_title(Ui::Text::WithEntities));
|
||||
box->setTitle(tr::lng_theme_editor_save_title(tr::marked));
|
||||
|
||||
const auto name = box->addRow(object_ptr<Ui::InputField>(
|
||||
box,
|
||||
|
||||
@@ -108,7 +108,7 @@ constexpr auto kPlayStatusLimit = 2;
|
||||
return !!self->emojiStatusId();
|
||||
}) | rpl::distinct_until_changed() | rpl::map([](bool has) {
|
||||
const auto makeLink = [](const QString &text) {
|
||||
return Ui::Text::Link(text);
|
||||
return tr::link(text);
|
||||
};
|
||||
return (has
|
||||
? tr::lng_menu_change_status
|
||||
@@ -382,12 +382,12 @@ MainMenu::MainMenu(
|
||||
|
||||
parentResized();
|
||||
|
||||
_telegram->setMarkedText(Ui::Text::Link(
|
||||
_telegram->setMarkedText(tr::link(
|
||||
u"Telegram Desktop"_q,
|
||||
u"https://desktop.telegram.org"_q));
|
||||
_telegram->setLinksTrusted();
|
||||
_version->setMarkedText(
|
||||
Ui::Text::Link(
|
||||
tr::link(
|
||||
tr::lng_settings_current_version(
|
||||
tr::now,
|
||||
lt_version,
|
||||
@@ -396,7 +396,7 @@ MainMenu::MainMenu(
|
||||
.append(QChar(' '))
|
||||
.append(QChar(8211))
|
||||
.append(QChar(' '))
|
||||
.append(Ui::Text::Link(tr::lng_menu_about(tr::now), 2))); // Link 2.
|
||||
.append(tr::link(tr::lng_menu_about(tr::now), 2))); // Link 2.
|
||||
_version->setLink(
|
||||
1,
|
||||
std::make_shared<UrlClickHandler>(Core::App().changelogLink()));
|
||||
|
||||
@@ -1719,7 +1719,7 @@ void Filler::addToggleFee() {
|
||||
tr::now,
|
||||
lt_name,
|
||||
TextWithEntities{ user->shortName() },
|
||||
Ui::Text::WithEntities)
|
||||
tr::marked)
|
||||
: tr::lng_context_fee_now(
|
||||
tr::now,
|
||||
lt_name,
|
||||
@@ -1730,7 +1730,7 @@ void Filler::addToggleFee() {
|
||||
).append(Lang::FormatCountDecimal(
|
||||
user->owner().commonStarsPerMessage(parent)
|
||||
)),
|
||||
Ui::Text::WithEntities);
|
||||
tr::marked);
|
||||
const auto action = new QAction(actionParent);
|
||||
action->setDisabled(true);
|
||||
auto result = base::make_unique_q<Ui::Menu::Action>(
|
||||
@@ -1811,7 +1811,7 @@ void PeerMenuDeleteContact(
|
||||
st::mainMenuUserpic),
|
||||
Ui::CreateChild<Ui::FlatLabel>(
|
||||
box,
|
||||
tr::lng_info_delete_contact() | Ui::Text::ToBold(),
|
||||
tr::lng_info_delete_contact(tr::bold),
|
||||
box->getDelegate()->style().title));
|
||||
Ui::ConfirmBox(box, {
|
||||
.text = text,
|
||||
@@ -2073,8 +2073,8 @@ void PeerMenuTodoWantsPremium(TodoWantsPremium type) {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const auto link = Ui::Text::Link(
|
||||
Ui::Text::Semibold(tr::lng_todo_premium_link(tr::now)));
|
||||
const auto link = tr::link(
|
||||
tr::semibold(tr::lng_todo_premium_link(tr::now)));
|
||||
const auto text = [&] {
|
||||
switch (type) {
|
||||
case TodoWantsPremium::Create: return tr::lng_todo_create_premium;
|
||||
@@ -2089,7 +2089,7 @@ void PeerMenuTodoWantsPremium(TodoWantsPremium type) {
|
||||
tr::now,
|
||||
lt_link,
|
||||
link,
|
||||
Ui::Text::WithEntities),
|
||||
tr::marked),
|
||||
.filter = filter,
|
||||
.duration = kToastDuration,
|
||||
});
|
||||
@@ -2256,8 +2256,8 @@ void PeerMenuBlockUserBox(
|
||||
box,
|
||||
tr::lng_blocked_list_confirm_text(
|
||||
lt_name,
|
||||
rpl::single(Ui::Text::Bold(name)),
|
||||
Ui::Text::WithEntities),
|
||||
rpl::single(tr::bold(name)),
|
||||
tr::marked),
|
||||
st::blockUserConfirmation));
|
||||
|
||||
box->addSkip(st::boxMediumSkip);
|
||||
@@ -2296,8 +2296,8 @@ void PeerMenuBlockUserBox(
|
||||
tr::lng_delete_all_from_user(
|
||||
tr::now,
|
||||
lt_user,
|
||||
Ui::Text::Bold(peer->name()),
|
||||
Ui::Text::WithEntities),
|
||||
tr::bold(peer->name()),
|
||||
tr::marked),
|
||||
true,
|
||||
st::defaultBoxCheckbox))
|
||||
: nullptr;
|
||||
@@ -3545,7 +3545,7 @@ void MenuAddMarkAsReadAllChatsAction(
|
||||
auto text = rpl::combine(
|
||||
tr::lng_context_mark_read_all_sure(),
|
||||
tr::lng_context_mark_read_all_sure_2(
|
||||
Ui::Text::RichLangValue)
|
||||
tr::rich)
|
||||
) | rpl::map([](QString t1, TextWithEntities t2) {
|
||||
return TextWithEntities()
|
||||
.append(std::move(t1))
|
||||
@@ -3888,8 +3888,8 @@ void PeerMenuConfirmToggleFee(
|
||||
.text = tr::lng_payment_refund_text(
|
||||
tr::now,
|
||||
lt_name,
|
||||
Ui::Text::Bold(user->shortName()),
|
||||
Ui::Text::WithEntities),
|
||||
tr::bold(user->shortName()),
|
||||
tr::marked),
|
||||
.confirmed = [=](Fn<void()> close) {
|
||||
exception(*refund && (*refund)->checked());
|
||||
close();
|
||||
|
||||
@@ -1725,7 +1725,7 @@ void SessionController::suggestArchiveAndMute() {
|
||||
box->setTitle(tr::lng_suggest_hide_new_title());
|
||||
box->addRow(object_ptr<Ui::FlatLabel>(
|
||||
box,
|
||||
tr::lng_suggest_hide_new_about(Ui::Text::RichLangValue),
|
||||
tr::lng_suggest_hide_new_about(tr::rich),
|
||||
st::boxLabel));
|
||||
box->addButton(tr::lng_suggest_hide_new_to_settings(), [=] {
|
||||
showSettings(Settings::PrivacySecurity::Id());
|
||||
|
||||
Reference in New Issue
Block a user