mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use tr:: instead of lang().
This commit is contained in:
parent
d3ca6b96a1
commit
87fc066e67
168 changed files with 1905 additions and 1744 deletions
|
@ -462,11 +462,11 @@ void ApiWrap::importChatInvite(const QString &hash) {
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
const auto &type = error.type();
|
const auto &type = error.type();
|
||||||
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_join_channel_error)));
|
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
|
||||||
} else if (error.code() == 400) {
|
} else if (error.code() == 400) {
|
||||||
Ui::show(Box<InformBox>(lang(type == qstr("USERS_TOO_MUCH")
|
Ui::show(Box<InformBox>((type == qstr("USERS_TOO_MUCH"))
|
||||||
? lng_group_invite_no_room
|
? tr::lng_group_invite_no_room(tr::now)
|
||||||
: lng_group_invite_bad_link)));
|
: tr::lng_group_invite_bad_link(tr::now)));
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
@ -550,7 +550,7 @@ void ApiWrap::sendMessageFail(const RPCError &error) {
|
||||||
} else if (error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
} else if (error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
||||||
const auto link = textcmdLink(
|
const auto link = textcmdLink(
|
||||||
Core::App().createInternalLinkFull(qsl("spambot")),
|
Core::App().createInternalLinkFull(qsl("spambot")),
|
||||||
lang(lng_cant_more_info));
|
tr::lng_cant_more_info(tr::now));
|
||||||
Ui::show(Box<InformBox>(lng_error_public_groups_denied(
|
Ui::show(Box<InformBox>(lng_error_public_groups_denied(
|
||||||
lt_more_info,
|
lt_more_info,
|
||||||
link)));
|
link)));
|
||||||
|
@ -1409,7 +1409,7 @@ void ApiWrap::migrateDone(
|
||||||
void ApiWrap::migrateFail(not_null<PeerData*> peer, const RPCError &error) {
|
void ApiWrap::migrateFail(not_null<PeerData*> peer, const RPCError &error) {
|
||||||
const auto &type = error.type();
|
const auto &type = error.type();
|
||||||
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_migrate_error)));
|
Ui::show(Box<InformBox>(tr::lng_migrate_error(tr::now)));
|
||||||
}
|
}
|
||||||
if (auto handlers = _migrateCallbacks.take(peer)) {
|
if (auto handlers = _migrateCallbacks.take(peer)) {
|
||||||
for (auto &handler : *handlers) {
|
for (auto &handler : *handlers) {
|
||||||
|
@ -2167,13 +2167,13 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
|
||||||
if (error.type() == qstr("CHANNEL_PRIVATE")
|
if (error.type() == qstr("CHANNEL_PRIVATE")
|
||||||
|| error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")
|
|| error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")
|
||||||
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
||||||
Ui::show(Box<InformBox>(lang(channel->isMegagroup()
|
Ui::show(Box<InformBox>(channel->isMegagroup()
|
||||||
? lng_group_not_accessible
|
? tr::lng_group_not_accessible(tr::now)
|
||||||
: lng_channel_not_accessible)));
|
: tr::lng_channel_not_accessible(tr::now)));
|
||||||
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_join_channel_error)));
|
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
|
||||||
} else if (error.type() == qstr("USERS_TOO_MUCH")) {
|
} else if (error.type() == qstr("USERS_TOO_MUCH")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_group_full)));
|
Ui::show(Box<InformBox>(tr::lng_group_full(tr::now)));
|
||||||
}
|
}
|
||||||
_channelAmInRequests.remove(channel);
|
_channelAmInRequests.remove(channel);
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -2826,7 +2826,7 @@ void ApiWrap::requestAttachedStickerSets(not_null<PhotoData*> photo) {
|
||||||
MTP_inputStickeredMediaPhoto(photo->mtpInput())
|
MTP_inputStickeredMediaPhoto(photo->mtpInput())
|
||||||
)).done([=](const MTPVector<MTPStickerSetCovered> &result) {
|
)).done([=](const MTPVector<MTPStickerSetCovered> &result) {
|
||||||
if (result.v.isEmpty()) {
|
if (result.v.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
return;
|
return;
|
||||||
} else if (result.v.size() > 1) {
|
} else if (result.v.size() > 1) {
|
||||||
Ui::show(Box<StickersBox>(result));
|
Ui::show(Box<StickersBox>(result));
|
||||||
|
@ -2847,7 +2847,7 @@ void ApiWrap::requestAttachedStickerSets(not_null<PhotoData*> photo) {
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3377,7 +3377,7 @@ void ApiWrap::requestRecentStickersWithHash(int32 hash) {
|
||||||
auto &d = result.c_messages_recentStickers();
|
auto &d = result.c_messages_recentStickers();
|
||||||
Stickers::SpecialSetReceived(
|
Stickers::SpecialSetReceived(
|
||||||
Stickers::CloudRecentSetId,
|
Stickers::CloudRecentSetId,
|
||||||
lang(lng_recent_stickers),
|
tr::lng_recent_stickers(tr::now),
|
||||||
d.vstickers.v,
|
d.vstickers.v,
|
||||||
d.vhash.v,
|
d.vhash.v,
|
||||||
d.vpacks.v,
|
d.vpacks.v,
|
||||||
|
@ -4864,7 +4864,7 @@ void ApiWrap::editUploadedFile(
|
||||||
item->returnSavedMedia();
|
item->returnSavedMedia();
|
||||||
_session->data().sendHistoryChangeNotifications();
|
_session->data().sendHistoryChangeNotifications();
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_edit_media_invalid_file)),
|
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
} else {
|
} else {
|
||||||
sendMessageFail(error);
|
sendMessageFail(error);
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace App {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString peerName(const PeerData *peer, bool forDialogs) {
|
QString peerName(const PeerData *peer, bool forDialogs) {
|
||||||
return peer ? ((forDialogs && peer->isUser() && !peer->asUser()->nameOrPhone.isEmpty()) ? peer->asUser()->nameOrPhone : peer->name) : lang(lng_deleted);
|
return peer ? ((forDialogs && peer->isUser() && !peer->asUser()->nameOrPhone.isEmpty()) ? peer->asUser()->nameOrPhone : peer->name) : tr::lng_deleted(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepareCorners(RoundCorners index, int32 radius, const QBrush &brush, const style::color *shadow = nullptr, QImage *cors = nullptr) {
|
void prepareCorners(RoundCorners index, int32 radius, const QBrush &brush, const style::color *shadow = nullptr, QImage *cors = nullptr) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ style::InputField CreateBioFieldStyle() {
|
||||||
QString PeerFloodErrorText(PeerFloodType type) {
|
QString PeerFloodErrorText(PeerFloodType type) {
|
||||||
auto link = textcmdLink(
|
auto link = textcmdLink(
|
||||||
Core::App().createInternalLinkFull(qsl("spambot")),
|
Core::App().createInternalLinkFull(qsl("spambot")),
|
||||||
lang(lng_cant_more_info));
|
tr::lng_cant_more_info(tr::now));
|
||||||
if (type == PeerFloodType::InviteGroup) {
|
if (type == PeerFloodType::InviteGroup) {
|
||||||
return lng_cant_invite_not_contact(lt_more_info, link);
|
return lng_cant_invite_not_contact(lt_more_info, link);
|
||||||
}
|
}
|
||||||
|
@ -107,9 +107,9 @@ void ShowAddParticipantsError(
|
||||||
};
|
};
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_cant_invite_offer_admin),
|
tr::lng_cant_invite_offer_admin(tr::now),
|
||||||
lang(lng_cant_invite_make_admin),
|
tr::lng_cant_invite_make_admin(tr::now),
|
||||||
lang(lng_cancel),
|
tr::lng_cancel(tr::now),
|
||||||
makeAdmin),
|
makeAdmin),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
|
@ -121,33 +121,32 @@ void ShowAddParticipantsError(
|
||||||
const auto hasBot = (bot != end(users));
|
const auto hasBot = (bot != end(users));
|
||||||
const auto text = [&] {
|
const auto text = [&] {
|
||||||
if (error == qstr("USER_BOT")) {
|
if (error == qstr("USER_BOT")) {
|
||||||
return lang(lng_cant_invite_bot_to_channel);
|
return tr::lng_cant_invite_bot_to_channel(tr::now);
|
||||||
} else if (error == qstr("USER_LEFT_CHAT")) {
|
} else if (error == qstr("USER_LEFT_CHAT")) {
|
||||||
// Trying to return a user who has left.
|
// Trying to return a user who has left.
|
||||||
} else if (error == qstr("USER_KICKED")) {
|
} else if (error == qstr("USER_KICKED")) {
|
||||||
// Trying to return a user who was kicked by admin.
|
// Trying to return a user who was kicked by admin.
|
||||||
return lang(lng_cant_invite_banned);
|
return tr::lng_cant_invite_banned(tr::now);
|
||||||
} else if (error == qstr("USER_PRIVACY_RESTRICTED")) {
|
} else if (error == qstr("USER_PRIVACY_RESTRICTED")) {
|
||||||
return lang(lng_cant_invite_privacy);
|
return tr::lng_cant_invite_privacy(tr::now);
|
||||||
} else if (error == qstr("USER_NOT_MUTUAL_CONTACT")) {
|
} else if (error == qstr("USER_NOT_MUTUAL_CONTACT")) {
|
||||||
// Trying to return user who does not have me in contacts.
|
// Trying to return user who does not have me in contacts.
|
||||||
return lang(lng_failed_add_not_mutual);
|
return tr::lng_failed_add_not_mutual(tr::now);
|
||||||
} else if (error == qstr("USER_ALREADY_PARTICIPANT") && hasBot) {
|
} else if (error == qstr("USER_ALREADY_PARTICIPANT") && hasBot) {
|
||||||
return lang(lng_bot_already_in_group);
|
return tr::lng_bot_already_in_group(tr::now);
|
||||||
} else if (error == qstr("BOT_GROUPS_BLOCKED")) {
|
} else if (error == qstr("BOT_GROUPS_BLOCKED")) {
|
||||||
return lang(lng_error_cant_add_bot);
|
return tr::lng_error_cant_add_bot(tr::now);
|
||||||
} else if (error == qstr("PEER_FLOOD")) {
|
} else if (error == qstr("PEER_FLOOD")) {
|
||||||
const auto isGroup = (chat->isChat() || chat->isMegagroup());
|
const auto isGroup = (chat->isChat() || chat->isMegagroup());
|
||||||
return PeerFloodErrorText(isGroup
|
return PeerFloodErrorText(isGroup
|
||||||
? PeerFloodType::InviteGroup
|
? PeerFloodType::InviteGroup
|
||||||
: PeerFloodType::InviteChannel);
|
: PeerFloodType::InviteChannel);
|
||||||
} else if (error == qstr("ADMINS_TOO_MUCH")) {
|
} else if (error == qstr("ADMINS_TOO_MUCH")) {
|
||||||
const auto isGroup = (chat->isChat() || chat->isMegagroup());
|
return ((chat->isChat() || chat->isMegagroup())
|
||||||
return lang(isGroup
|
? tr::lng_error_admin_limit
|
||||||
? lng_error_admin_limit
|
: tr::lng_error_admin_limit_channel)(tr::now);
|
||||||
: lng_error_admin_limit_channel);
|
|
||||||
}
|
}
|
||||||
return lang(lng_failed_add_participant);
|
return tr::lng_failed_add_participant(tr::now);
|
||||||
}();
|
}();
|
||||||
Ui::show(Box<InformBox>(text), LayerOption::KeepOther);
|
Ui::show(Box<InformBox>(text), LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -424,9 +423,9 @@ void GroupInfoBox::prepare() {
|
||||||
|
|
||||||
_photo.create(
|
_photo.create(
|
||||||
this,
|
this,
|
||||||
lang((_type == Type::Channel)
|
((_type == Type::Channel)
|
||||||
? lng_create_channel_crop
|
? tr::lng_create_channel_crop
|
||||||
: lng_create_group_crop),
|
: tr::lng_create_group_crop)(tr::now),
|
||||||
Ui::UserpicButton::Role::ChangePhoto,
|
Ui::UserpicButton::Role::ChangePhoto,
|
||||||
st::defaultUserpicButton);
|
st::defaultUserpicButton);
|
||||||
_title.create(
|
_title.create(
|
||||||
|
@ -582,7 +581,7 @@ void GroupInfoBox::createGroup(
|
||||||
}
|
}
|
||||||
} else if (error.type() == qstr("USERS_TOO_FEW")) {
|
} else if (error.type() == qstr("USERS_TOO_FEW")) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_cant_invite_privacy)),
|
Box<InformBox>(tr::lng_cant_invite_privacy(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
} else if (error.type() == qstr("PEER_FLOOD")) {
|
} else if (error.type() == qstr("PEER_FLOOD")) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
|
@ -591,7 +590,7 @@ void GroupInfoBox::createGroup(
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_cant_do_this)),
|
Box<InformBox>(tr::lng_cant_do_this(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -703,9 +702,9 @@ void GroupInfoBox::createChannel(const QString &title, const QString &descriptio
|
||||||
_title->setFocus();
|
_title->setFocus();
|
||||||
_title->showError();
|
_title->showError();
|
||||||
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_cant_do_this)));
|
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||||
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_cant_do_this))); // TODO
|
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now))); // TODO
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
@ -733,11 +732,37 @@ SetupChannelBox::SetupChannelBox(QWidget*, ChannelData *channel, bool existing)
|
||||||
: _channel(channel)
|
: _channel(channel)
|
||||||
, _existing(existing)
|
, _existing(existing)
|
||||||
, _privacyGroup(std::make_shared<Ui::RadioenumGroup<Privacy>>(Privacy::Public))
|
, _privacyGroup(std::make_shared<Ui::RadioenumGroup<Privacy>>(Privacy::Public))
|
||||||
, _public(this, _privacyGroup, Privacy::Public, lang(channel->isMegagroup() ? lng_create_public_group_title : lng_create_public_channel_title), st::defaultBoxCheckbox)
|
, _public(
|
||||||
, _private(this, _privacyGroup, Privacy::Private, lang(channel->isMegagroup() ? lng_create_private_group_title : lng_create_private_channel_title), st::defaultBoxCheckbox)
|
this,
|
||||||
|
_privacyGroup,
|
||||||
|
Privacy::Public,
|
||||||
|
(channel->isMegagroup()
|
||||||
|
? tr::lng_create_public_group_title
|
||||||
|
: tr::lng_create_public_channel_title)(tr::now),
|
||||||
|
st::defaultBoxCheckbox)
|
||||||
|
, _private(
|
||||||
|
this,
|
||||||
|
_privacyGroup,
|
||||||
|
Privacy::Private,
|
||||||
|
(channel->isMegagroup()
|
||||||
|
? tr::lng_create_private_group_title
|
||||||
|
: tr::lng_create_private_channel_title)(tr::now),
|
||||||
|
st::defaultBoxCheckbox)
|
||||||
, _aboutPublicWidth(st::boxWideWidth - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultRadio.diameter - st::defaultBoxCheckbox.textPosition.x())
|
, _aboutPublicWidth(st::boxWideWidth - st::boxPadding.left() - st::boxButtonPadding.right() - st::newGroupPadding.left() - st::defaultRadio.diameter - st::defaultBoxCheckbox.textPosition.x())
|
||||||
, _aboutPublic(st::defaultTextStyle, lang(channel->isMegagroup() ? lng_create_public_group_about : lng_create_public_channel_about), _defaultOptions, _aboutPublicWidth)
|
, _aboutPublic(
|
||||||
, _aboutPrivate(st::defaultTextStyle, lang(channel->isMegagroup() ? lng_create_private_group_about : lng_create_private_channel_about), _defaultOptions, _aboutPublicWidth)
|
st::defaultTextStyle,
|
||||||
|
(channel->isMegagroup()
|
||||||
|
? tr::lng_create_public_group_about
|
||||||
|
: tr::lng_create_public_channel_about)(tr::now),
|
||||||
|
_defaultOptions,
|
||||||
|
_aboutPublicWidth)
|
||||||
|
, _aboutPrivate(
|
||||||
|
st::defaultTextStyle,
|
||||||
|
(channel->isMegagroup()
|
||||||
|
? tr::lng_create_private_group_about
|
||||||
|
: tr::lng_create_private_channel_about)(tr::now),
|
||||||
|
_defaultOptions,
|
||||||
|
_aboutPublicWidth)
|
||||||
, _link(this, st::setupChannelLink, nullptr, channel->username, true) {
|
, _link(this, st::setupChannelLink, nullptr, channel->username, true) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -826,7 +851,13 @@ void SetupChannelBox::paintEvent(QPaintEvent *e) {
|
||||||
if (!_channel->isMegagroup() || !_link->isHidden()) {
|
if (!_channel->isMegagroup() || !_link->isHidden()) {
|
||||||
p.setPen(st::boxTextFg);
|
p.setPen(st::boxTextFg);
|
||||||
p.setFont(st::newGroupLinkFont);
|
p.setFont(st::newGroupLinkFont);
|
||||||
p.drawTextLeft(st::boxPadding.left() + st::newGroupPadding.left() + st::defaultInputField.textMargins.left(), _link->y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop, width(), lang(_link->isHidden() ? lng_create_group_invite_link : lng_create_group_link));
|
p.drawTextLeft(
|
||||||
|
st::boxPadding.left() + st::newGroupPadding.left() + st::defaultInputField.textMargins.left(),
|
||||||
|
_link->y() - st::newGroupLinkPadding.top() + st::newGroupLinkTop,
|
||||||
|
width(),
|
||||||
|
(_link->isHidden()
|
||||||
|
? tr::lng_create_group_invite_link
|
||||||
|
: tr::lng_create_group_link)(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_link->isHidden()) {
|
if (_link->isHidden()) {
|
||||||
|
@ -835,7 +866,7 @@ void SetupChannelBox::paintEvent(QPaintEvent *e) {
|
||||||
option.setWrapMode(QTextOption::WrapAnywhere);
|
option.setWrapMode(QTextOption::WrapAnywhere);
|
||||||
p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont);
|
p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont);
|
||||||
p.setPen(st::defaultLinkButton.color);
|
p.setPen(st::defaultLinkButton.color);
|
||||||
auto inviteLinkText = _channel->inviteLink().isEmpty() ? lang(lng_group_invite_create) : _channel->inviteLink();
|
auto inviteLinkText = _channel->inviteLink().isEmpty() ? tr::lng_group_invite_create(tr::now) : _channel->inviteLink();
|
||||||
p.drawText(_invitationLink, inviteLinkText, option);
|
p.drawText(_invitationLink, inviteLinkText, option);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -872,7 +903,7 @@ void SetupChannelBox::mousePressEvent(QMouseEvent *e) {
|
||||||
_channel->session().api().exportInviteLink(_channel);
|
_channel->session().api().exportInviteLink(_channel);
|
||||||
} else {
|
} else {
|
||||||
QGuiApplication::clipboard()->setText(_channel->inviteLink());
|
QGuiApplication::clipboard()->setText(_channel->inviteLink());
|
||||||
Ui::Toast::Show(lang(lng_create_channel_link_copied));
|
Ui::Toast::Show(tr::lng_create_channel_link_copied(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -927,8 +958,8 @@ void SetupChannelBox::handleChange() {
|
||||||
for (int32 i = 0; i < len; ++i) {
|
for (int32 i = 0; i < len; ++i) {
|
||||||
QChar ch = name.at(i);
|
QChar ch = name.at(i);
|
||||||
if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_') {
|
if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_') {
|
||||||
if (_errorText != lang(lng_create_channel_link_bad_symbols)) {
|
if (_errorText != tr::lng_create_channel_link_bad_symbols(tr::now)) {
|
||||||
_errorText = lang(lng_create_channel_link_bad_symbols);
|
_errorText = tr::lng_create_channel_link_bad_symbols(tr::now);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
_checkTimer.stop();
|
_checkTimer.stop();
|
||||||
|
@ -936,8 +967,8 @@ void SetupChannelBox::handleChange() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name.size() < kMinUsernameLength) {
|
if (name.size() < kMinUsernameLength) {
|
||||||
if (_errorText != lang(lng_create_channel_link_too_short)) {
|
if (_errorText != tr::lng_create_channel_link_too_short(tr::now)) {
|
||||||
_errorText = lang(lng_create_channel_link_too_short);
|
_errorText = tr::lng_create_channel_link_too_short(tr::now);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
_checkTimer.stop();
|
_checkTimer.stop();
|
||||||
|
@ -1008,13 +1039,13 @@ bool SetupChannelBox::onUpdateFail(const RPCError &error) {
|
||||||
} else if (err == "USERNAME_INVALID") {
|
} else if (err == "USERNAME_INVALID") {
|
||||||
_link->setFocus();
|
_link->setFocus();
|
||||||
_link->showError();
|
_link->showError();
|
||||||
_errorText = lang(lng_create_channel_link_invalid);
|
_errorText = tr::lng_create_channel_link_invalid(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
} else if (err == "USERNAME_OCCUPIED" || err == "USERNAMES_UNAVAILABLE") {
|
} else if (err == "USERNAME_OCCUPIED" || err == "USERNAMES_UNAVAILABLE") {
|
||||||
_link->setFocus();
|
_link->setFocus();
|
||||||
_link->showError();
|
_link->showError();
|
||||||
_errorText = lang(lng_create_channel_link_occupied);
|
_errorText = tr::lng_create_channel_link_occupied(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1024,8 +1055,8 @@ bool SetupChannelBox::onUpdateFail(const RPCError &error) {
|
||||||
|
|
||||||
void SetupChannelBox::onCheckDone(const MTPBool &result) {
|
void SetupChannelBox::onCheckDone(const MTPBool &result) {
|
||||||
_checkRequestId = 0;
|
_checkRequestId = 0;
|
||||||
QString newError = (mtpIsTrue(result) || _checkUsername == _channel->username) ? QString() : lang(lng_create_channel_link_occupied);
|
QString newError = (mtpIsTrue(result) || _checkUsername == _channel->username) ? QString() : tr::lng_create_channel_link_occupied(tr::now);
|
||||||
QString newGood = newError.isEmpty() ? lang(lng_create_channel_link_available) : QString();
|
QString newGood = newError.isEmpty() ? tr::lng_create_channel_link_available(tr::now) : QString();
|
||||||
if (_errorText != newError || _goodText != newGood) {
|
if (_errorText != newError || _goodText != newGood) {
|
||||||
_errorText = newError;
|
_errorText = newError;
|
||||||
_goodText = newGood;
|
_goodText = newGood;
|
||||||
|
@ -1050,11 +1081,11 @@ bool SetupChannelBox::onCheckFail(const RPCError &error) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("USERNAME_INVALID")) {
|
} else if (err == qstr("USERNAME_INVALID")) {
|
||||||
_errorText = lang(lng_create_channel_link_invalid);
|
_errorText = tr::lng_create_channel_link_invalid(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("USERNAME_OCCUPIED") && _checkUsername != _channel->username) {
|
} else if (err == qstr("USERNAME_OCCUPIED") && _checkUsername != _channel->username) {
|
||||||
_errorText = lang(lng_create_channel_link_occupied);
|
_errorText = tr::lng_create_channel_link_occupied(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1218,7 +1249,7 @@ bool EditNameBox::saveSelfFail(const RPCError &error) {
|
||||||
|
|
||||||
RevokePublicLinkBox::Inner::Inner(QWidget *parent, Fn<void()> revokeCallback) : TWidget(parent)
|
RevokePublicLinkBox::Inner::Inner(QWidget *parent, Fn<void()> revokeCallback) : TWidget(parent)
|
||||||
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
|
, _rowHeight(st::contactsPadding.top() + st::contactsPhotoSize + st::contactsPadding.bottom())
|
||||||
, _revokeWidth(st::normalFont->width(lang(lng_channels_too_much_public_revoke)))
|
, _revokeWidth(st::normalFont->width(tr::lng_channels_too_much_public_revoke(tr::now)))
|
||||||
, _revokeCallback(std::move(revokeCallback)) {
|
, _revokeCallback(std::move(revokeCallback)) {
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
||||||
|
@ -1260,7 +1291,7 @@ RevokePublicLinkBox::RevokePublicLinkBox(
|
||||||
Fn<void()> revokeCallback)
|
Fn<void()> revokeCallback)
|
||||||
: _aboutRevoke(
|
: _aboutRevoke(
|
||||||
this,
|
this,
|
||||||
lang(lng_channels_too_much_public_about),
|
tr::lng_channels_too_much_public_about(tr::now),
|
||||||
st::aboutRevokePublicLabel)
|
st::aboutRevokePublicLabel)
|
||||||
, _revokeCallback(std::move(revokeCallback)) {
|
, _revokeCallback(std::move(revokeCallback)) {
|
||||||
}
|
}
|
||||||
|
@ -1319,7 +1350,7 @@ void RevokePublicLinkBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
if (pressed && pressed == _selected) {
|
if (pressed && pressed == _selected) {
|
||||||
auto text_method = pressed->isMegagroup() ? lng_channels_too_much_public_revoke_confirm_group : lng_channels_too_much_public_revoke_confirm_channel;
|
auto text_method = pressed->isMegagroup() ? lng_channels_too_much_public_revoke_confirm_group : lng_channels_too_much_public_revoke_confirm_channel;
|
||||||
auto text = text_method(lt_link, Core::App().createInternalLink(pressed->userName()), lt_group, pressed->name);
|
auto text = text_method(lt_link, Core::App().createInternalLink(pressed->userName()), lt_group, pressed->name);
|
||||||
auto confirmText = lang(lng_channels_too_much_public_revoke);
|
auto confirmText = tr::lng_channels_too_much_public_revoke(tr::now);
|
||||||
_weakRevokeConfirmBox = Ui::show(Box<ConfirmBox>(text, confirmText, crl::guard(this, [this, pressed]() {
|
_weakRevokeConfirmBox = Ui::show(Box<ConfirmBox>(text, confirmText, crl::guard(this, [this, pressed]() {
|
||||||
if (_revokeRequestId) return;
|
if (_revokeRequestId) return;
|
||||||
_revokeRequestId = request(MTPchannels_UpdateUsername(
|
_revokeRequestId = request(MTPchannels_UpdateUsername(
|
||||||
|
@ -1370,7 +1401,7 @@ void RevokePublicLinkBox::Inner::paintChat(Painter &p, const ChatRow &row, bool
|
||||||
|
|
||||||
p.setFont(selected ? st::linkOverFont : st::linkFont);
|
p.setFont(selected ? st::linkOverFont : st::linkFont);
|
||||||
p.setPen(selected ? st::defaultLinkButton.overColor : st::defaultLinkButton.color);
|
p.setPen(selected ? st::defaultLinkButton.overColor : st::defaultLinkButton.color);
|
||||||
p.drawTextRight(st::contactsPadding.right() + st::contactsCheckPosition.x(), st::contactsPadding.top() + (st::contactsPhotoSize - st::normalFont->height) / 2, width(), lang(lng_channels_too_much_public_revoke), _revokeWidth);
|
p.drawTextRight(st::contactsPadding.right() + st::contactsCheckPosition.x(), st::contactsPadding.top() + (st::contactsPhotoSize - st::normalFont->height) / 2, width(), tr::lng_channels_too_much_public_revoke(tr::now), _revokeWidth);
|
||||||
|
|
||||||
p.setPen(st::contactsStatusFg);
|
p.setPen(st::contactsStatusFg);
|
||||||
p.setTextPalette(st::revokePublicLinkStatusPalette);
|
p.setTextPalette(st::revokePublicLinkStatusPalette);
|
||||||
|
|
|
@ -159,9 +159,9 @@ void BackgroundBox::removePaper(const Data::WallPaper &paper) {
|
||||||
};
|
};
|
||||||
*box = Ui::show(
|
*box = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_background_sure_delete),
|
tr::lng_background_sure_delete(tr::now),
|
||||||
lang(lng_selected_delete),
|
tr::lng_selected_delete(tr::now),
|
||||||
lang(lng_cancel),
|
tr::lng_cancel(tr::now),
|
||||||
remove),
|
remove),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ void BackgroundBox::Inner::paintEvent(QPaintEvent *e) {
|
||||||
if (_papers.empty()) {
|
if (_papers.empty()) {
|
||||||
p.setFont(st::noContactsFont);
|
p.setFont(st::noContactsFont);
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(QRect(0, 0, width(), st::noContactsHeight), lang(lng_contacts_loading), style::al_center);
|
p.drawText(QRect(0, 0, width(), st::noContactsHeight), tr::lng_contacts_loading(tr::now), style::al_center);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto row = 0;
|
auto row = 0;
|
||||||
|
|
|
@ -390,12 +390,12 @@ BackgroundPreviewBox::BackgroundPreviewBox(
|
||||||
: _text1(GenerateTextItem(
|
: _text1(GenerateTextItem(
|
||||||
delegate(),
|
delegate(),
|
||||||
Auth().data().history(peerFromUser(PeerData::kServiceNotificationsId)),
|
Auth().data().history(peerFromUser(PeerData::kServiceNotificationsId)),
|
||||||
lang(lng_background_text1),
|
tr::lng_background_text1(tr::now),
|
||||||
false))
|
false))
|
||||||
, _text2(GenerateTextItem(
|
, _text2(GenerateTextItem(
|
||||||
delegate(),
|
delegate(),
|
||||||
Auth().data().history(peerFromUser(PeerData::kServiceNotificationsId)),
|
Auth().data().history(peerFromUser(PeerData::kServiceNotificationsId)),
|
||||||
lang(lng_background_text2),
|
tr::lng_background_text2(tr::now),
|
||||||
true))
|
true))
|
||||||
, _paper(paper)
|
, _paper(paper)
|
||||||
, _radial([=](crl::time now) { radialAnimationCallback(now); }) {
|
, _radial([=](crl::time now) { radialAnimationCallback(now); }) {
|
||||||
|
@ -439,7 +439,7 @@ void BackgroundPreviewBox::prepare() {
|
||||||
void BackgroundPreviewBox::createBlurCheckbox() {
|
void BackgroundPreviewBox::createBlurCheckbox() {
|
||||||
_blur.create(
|
_blur.create(
|
||||||
this,
|
this,
|
||||||
lang(lng_background_blur),
|
tr::lng_background_blur(tr::now),
|
||||||
st::backgroundCheckbox,
|
st::backgroundCheckbox,
|
||||||
std::make_unique<ServiceCheck>(
|
std::make_unique<ServiceCheck>(
|
||||||
st::backgroundCheck,
|
st::backgroundCheck,
|
||||||
|
@ -492,7 +492,7 @@ void BackgroundPreviewBox::apply() {
|
||||||
|
|
||||||
void BackgroundPreviewBox::share() {
|
void BackgroundPreviewBox::share() {
|
||||||
QApplication::clipboard()->setText(_paper.shareUrl());
|
QApplication::clipboard()->setText(_paper.shareUrl());
|
||||||
Ui::Toast::Show(lang(lng_background_link_copied));
|
Ui::Toast::Show(tr::lng_background_link_copied(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BackgroundPreviewBox::paintEvent(QPaintEvent *e) {
|
void BackgroundPreviewBox::paintEvent(QPaintEvent *e) {
|
||||||
|
@ -742,13 +742,13 @@ bool BackgroundPreviewBox::Start(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!IsValidWallPaperSlug(slug)) {
|
if (!IsValidWallPaperSlug(slug)) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_background_bad_link)));
|
Ui::show(Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Auth().api().requestWallPaper(slug, [=](const Data::WallPaper &result) {
|
Auth().api().requestWallPaper(slug, [=](const Data::WallPaper &result) {
|
||||||
Ui::show(Box<BackgroundPreviewBox>(result.withUrlParams(params)));
|
Ui::show(Box<BackgroundPreviewBox>(result.withUrlParams(params)));
|
||||||
}, [](const RPCError &error) {
|
}, [](const RPCError &error) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_background_bad_link)));
|
Ui::show(Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ void ChangePhoneBox::EnterPhone::prepare() {
|
||||||
_phone->moveToLeft(st::boxPadding.left(), st::boxLittleSkip);
|
_phone->moveToLeft(st::boxPadding.left(), st::boxLittleSkip);
|
||||||
connect(_phone, &Ui::PhoneInput::submitted, [=] { submit(); });
|
connect(_phone, &Ui::PhoneInput::submitted, [=] { submit(); });
|
||||||
|
|
||||||
auto description = object_ptr<Ui::FlatLabel>(this, lang(lng_change_phone_new_description), st::changePhoneLabel);
|
auto description = object_ptr<Ui::FlatLabel>(this, tr::lng_change_phone_new_description(tr::now), st::changePhoneLabel);
|
||||||
auto errorSkip = st::boxLittleSkip + st::changePhoneError.style.font->height;
|
auto errorSkip = st::boxLittleSkip + st::changePhoneError.style.font->height;
|
||||||
description->moveToLeft(st::boxPadding.left(), _phone->y() + _phone->height() + errorSkip + st::boxLittleSkip);
|
description->moveToLeft(st::boxPadding.left(), _phone->y() + _phone->height() + errorSkip + st::boxLittleSkip);
|
||||||
|
|
||||||
|
@ -196,11 +196,11 @@ void ChangePhoneBox::EnterPhone::sendPhoneDone(const QString &phoneNumber, const
|
||||||
bool ChangePhoneBox::EnterPhone::sendPhoneFail(const QString &phoneNumber, const RPCError &error) {
|
bool ChangePhoneBox::EnterPhone::sendPhoneFail(const QString &phoneNumber, const RPCError &error) {
|
||||||
auto errorText = Lang::Hard::ServerError();
|
auto errorText = Lang::Hard::ServerError();
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errorText = lang(lng_flood_error);
|
errorText = tr::lng_flood_error(tr::now);
|
||||||
} else if (MTP::isDefaultHandledError(error)) {
|
} else if (MTP::isDefaultHandledError(error)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
|
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
|
||||||
errorText = lang(lng_bad_phone);
|
errorText = tr::lng_bad_phone(tr::now);
|
||||||
} else if (error.type() == qstr("PHONE_NUMBER_BANNED")) {
|
} else if (error.type() == qstr("PHONE_NUMBER_BANNED")) {
|
||||||
ShowPhoneBannedError(phoneNumber);
|
ShowPhoneBannedError(phoneNumber);
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
|
@ -210,7 +210,7 @@ bool ChangePhoneBox::EnterPhone::sendPhoneFail(const QString &phoneNumber, const
|
||||||
lng_change_phone_occupied(
|
lng_change_phone_occupied(
|
||||||
lt_phone,
|
lt_phone,
|
||||||
App::formatPhone(phoneNumber)),
|
App::formatPhone(phoneNumber)),
|
||||||
lang(lng_box_ok)));
|
tr::lng_box_ok(tr::now)));
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ void ChangePhoneBox::EnterCode::submit() {
|
||||||
if (weak) {
|
if (weak) {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
}
|
}
|
||||||
Ui::Toast::Show(lang(lng_change_phone_success));
|
Ui::Toast::Show(tr::lng_change_phone_success(tr::now));
|
||||||
}), rpcFail(crl::guard(this, [this](const RPCError &error) {
|
}), rpcFail(crl::guard(this, [this](const RPCError &error) {
|
||||||
return sendCodeFail(error);
|
return sendCodeFail(error);
|
||||||
})));
|
})));
|
||||||
|
@ -321,18 +321,18 @@ void ChangePhoneBox::EnterCode::showError(const QString &text) {
|
||||||
bool ChangePhoneBox::EnterCode::sendCodeFail(const RPCError &error) {
|
bool ChangePhoneBox::EnterCode::sendCodeFail(const RPCError &error) {
|
||||||
auto errorText = Lang::Hard::ServerError();
|
auto errorText = Lang::Hard::ServerError();
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errorText = lang(lng_flood_error);
|
errorText = tr::lng_flood_error(tr::now);
|
||||||
} else if (MTP::isDefaultHandledError(error)) {
|
} else if (MTP::isDefaultHandledError(error)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (error.type() == qstr("PHONE_CODE_EMPTY") || error.type() == qstr("PHONE_CODE_INVALID")) {
|
} else if (error.type() == qstr("PHONE_CODE_EMPTY") || error.type() == qstr("PHONE_CODE_INVALID")) {
|
||||||
errorText = lang(lng_bad_code);
|
errorText = tr::lng_bad_code(tr::now);
|
||||||
} else if (error.type() == qstr("PHONE_CODE_EXPIRED")
|
} else if (error.type() == qstr("PHONE_CODE_EXPIRED")
|
||||||
|| error.type() == qstr("PHONE_NUMBER_BANNED")) {
|
|| error.type() == qstr("PHONE_NUMBER_BANNED")) {
|
||||||
closeBox(); // Go back to phone input.
|
closeBox(); // Go back to phone input.
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
return true;
|
return true;
|
||||||
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
|
} else if (error.type() == qstr("PHONE_NUMBER_INVALID")) {
|
||||||
errorText = lang(lng_bad_phone);
|
errorText = tr::lng_bad_phone(tr::now);
|
||||||
}
|
}
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
showError(errorText);
|
showError(errorText);
|
||||||
|
@ -342,7 +342,7 @@ bool ChangePhoneBox::EnterCode::sendCodeFail(const RPCError &error) {
|
||||||
void ChangePhoneBox::prepare() {
|
void ChangePhoneBox::prepare() {
|
||||||
setTitle(tr::lng_change_phone_title());
|
setTitle(tr::lng_change_phone_title());
|
||||||
addButton(tr::lng_change_phone_button(), [] {
|
addButton(tr::lng_change_phone_button(), [] {
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_change_phone_warning), [] {
|
Ui::show(Box<ConfirmBox>(tr::lng_change_phone_warning(tr::now), [] {
|
||||||
Ui::show(Box<EnterPhone>());
|
Ui::show(Box<EnterPhone>());
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,8 +45,8 @@ ConfirmBox::ConfirmBox(
|
||||||
const QString &text,
|
const QString &text,
|
||||||
FnMut<void()> confirmedCallback,
|
FnMut<void()> confirmedCallback,
|
||||||
FnMut<void()> cancelledCallback)
|
FnMut<void()> cancelledCallback)
|
||||||
: _confirmText(lang(lng_box_ok))
|
: _confirmText(tr::lng_box_ok(tr::now))
|
||||||
, _cancelText(lang(lng_cancel))
|
, _cancelText(tr::lng_cancel(tr::now))
|
||||||
, _confirmStyle(st::defaultBoxButton)
|
, _confirmStyle(st::defaultBoxButton)
|
||||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||||
, _confirmedCallback(std::move(confirmedCallback))
|
, _confirmedCallback(std::move(confirmedCallback))
|
||||||
|
@ -61,7 +61,7 @@ ConfirmBox::ConfirmBox(
|
||||||
FnMut<void()> confirmedCallback,
|
FnMut<void()> confirmedCallback,
|
||||||
FnMut<void()> cancelledCallback)
|
FnMut<void()> cancelledCallback)
|
||||||
: _confirmText(confirmText)
|
: _confirmText(confirmText)
|
||||||
, _cancelText(lang(lng_cancel))
|
, _cancelText(tr::lng_cancel(tr::now))
|
||||||
, _confirmStyle(st::defaultBoxButton)
|
, _confirmStyle(st::defaultBoxButton)
|
||||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||||
, _confirmedCallback(std::move(confirmedCallback))
|
, _confirmedCallback(std::move(confirmedCallback))
|
||||||
|
@ -76,7 +76,7 @@ ConfirmBox::ConfirmBox(
|
||||||
FnMut<void()> confirmedCallback,
|
FnMut<void()> confirmedCallback,
|
||||||
FnMut<void()> cancelledCallback)
|
FnMut<void()> cancelledCallback)
|
||||||
: _confirmText(confirmText)
|
: _confirmText(confirmText)
|
||||||
, _cancelText(lang(lng_cancel))
|
, _cancelText(tr::lng_cancel(tr::now))
|
||||||
, _confirmStyle(st::defaultBoxButton)
|
, _confirmStyle(st::defaultBoxButton)
|
||||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||||
, _confirmedCallback(std::move(confirmedCallback))
|
, _confirmedCallback(std::move(confirmedCallback))
|
||||||
|
@ -92,7 +92,7 @@ ConfirmBox::ConfirmBox(
|
||||||
FnMut<void()> confirmedCallback,
|
FnMut<void()> confirmedCallback,
|
||||||
FnMut<void()> cancelledCallback)
|
FnMut<void()> cancelledCallback)
|
||||||
: _confirmText(confirmText)
|
: _confirmText(confirmText)
|
||||||
, _cancelText(lang(lng_cancel))
|
, _cancelText(tr::lng_cancel(tr::now))
|
||||||
, _confirmStyle(confirmStyle)
|
, _confirmStyle(confirmStyle)
|
||||||
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
, _text(st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right())
|
||||||
, _confirmedCallback(std::move(confirmedCallback))
|
, _confirmedCallback(std::move(confirmedCallback))
|
||||||
|
@ -301,13 +301,13 @@ void ConfirmBox::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InformBox::InformBox(QWidget*, const QString &text, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, lang(lng_box_ok), std::move(closedCallback)) {
|
InformBox::InformBox(QWidget*, const QString &text, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, tr::lng_box_ok(tr::now), std::move(closedCallback)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
InformBox::InformBox(QWidget*, const QString &text, const QString &doneText, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, doneText, std::move(closedCallback)) {
|
InformBox::InformBox(QWidget*, const QString &text, const QString &doneText, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, doneText, std::move(closedCallback)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
InformBox::InformBox(QWidget*, const TextWithEntities &text, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, lang(lng_box_ok), std::move(closedCallback)) {
|
InformBox::InformBox(QWidget*, const TextWithEntities &text, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, tr::lng_box_ok(tr::now), std::move(closedCallback)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
InformBox::InformBox(QWidget*, const TextWithEntities &text, const QString &doneText, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, doneText, std::move(closedCallback)) {
|
InformBox::InformBox(QWidget*, const TextWithEntities &text, const QString &doneText, Fn<void()> closedCallback) : ConfirmBox(ConfirmBox::InformBoxTag(), text, doneText, std::move(closedCallback)) {
|
||||||
|
@ -345,7 +345,7 @@ void MaxInviteBox::mousePressEvent(QMouseEvent *e) {
|
||||||
_channel->session().api().exportInviteLink(_channel);
|
_channel->session().api().exportInviteLink(_channel);
|
||||||
} else {
|
} else {
|
||||||
QGuiApplication::clipboard()->setText(_channel->inviteLink());
|
QGuiApplication::clipboard()->setText(_channel->inviteLink());
|
||||||
Ui::Toast::Show(lang(lng_create_channel_link_copied));
|
Ui::Toast::Show(tr::lng_create_channel_link_copied(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ void MaxInviteBox::paintEvent(QPaintEvent *e) {
|
||||||
option.setWrapMode(QTextOption::WrapAnywhere);
|
option.setWrapMode(QTextOption::WrapAnywhere);
|
||||||
p.setFont(_linkOver ? st::defaultInputField.font->underline() : st::defaultInputField.font);
|
p.setFont(_linkOver ? st::defaultInputField.font->underline() : st::defaultInputField.font);
|
||||||
p.setPen(st::defaultLinkButton.color);
|
p.setPen(st::defaultLinkButton.color);
|
||||||
auto inviteLinkText = _channel->inviteLink().isEmpty() ? lang(lng_group_invite_create) : _channel->inviteLink();
|
auto inviteLinkText = _channel->inviteLink().isEmpty() ? tr::lng_group_invite_create(tr::now) : _channel->inviteLink();
|
||||||
p.drawText(_invitationLink, inviteLinkText, option);
|
p.drawText(_invitationLink, inviteLinkText, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,7 @@ PinMessageBox::PinMessageBox(
|
||||||
MsgId msgId)
|
MsgId msgId)
|
||||||
: _peer(peer)
|
: _peer(peer)
|
||||||
, _msgId(msgId)
|
, _msgId(msgId)
|
||||||
, _text(this, lang(lng_pinned_pin_sure), st::boxLabel) {
|
, _text(this, tr::lng_pinned_pin_sure(tr::now), st::boxLabel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PinMessageBox::prepare() {
|
void PinMessageBox::prepare() {
|
||||||
|
@ -401,7 +401,7 @@ void PinMessageBox::prepare() {
|
||||||
addButton(tr::lng_cancel(), [this] { closeBox(); });
|
addButton(tr::lng_cancel(), [this] { closeBox(); });
|
||||||
|
|
||||||
if (_peer->isChat() || _peer->isMegagroup()) {
|
if (_peer->isChat() || _peer->isMegagroup()) {
|
||||||
_notify.create(this, lang(lng_pinned_notify), true, st::defaultBoxCheckbox);
|
_notify.create(this, tr::lng_pinned_notify(tr::now), true, st::defaultBoxCheckbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto height = st::boxPadding.top() + _text->height() + st::boxPadding.bottom();
|
auto height = st::boxPadding.top() + _text->height() + st::boxPadding.bottom();
|
||||||
|
@ -494,21 +494,21 @@ void DeleteMessagesBox::prepare() {
|
||||||
if (const auto peer = _wipeHistoryPeer) {
|
if (const auto peer = _wipeHistoryPeer) {
|
||||||
if (_wipeHistoryJustClear) {
|
if (_wipeHistoryJustClear) {
|
||||||
details.text = peer->isSelf()
|
details.text = peer->isSelf()
|
||||||
? lang(lng_sure_delete_saved_messages)
|
? tr::lng_sure_delete_saved_messages(tr::now)
|
||||||
: peer->isUser()
|
: peer->isUser()
|
||||||
? lng_sure_delete_history(lt_contact, peer->name)
|
? lng_sure_delete_history(lt_contact, peer->name)
|
||||||
: lng_sure_delete_group_history(lt_group, peer->name);
|
: lng_sure_delete_group_history(lt_group, peer->name);
|
||||||
deleteStyle = &st::attentionBoxButton;
|
deleteStyle = &st::attentionBoxButton;
|
||||||
} else {
|
} else {
|
||||||
details.text = peer->isSelf()
|
details.text = peer->isSelf()
|
||||||
? lang(lng_sure_delete_saved_messages)
|
? tr::lng_sure_delete_saved_messages(tr::now)
|
||||||
: peer->isUser()
|
: peer->isUser()
|
||||||
? lng_sure_delete_history(lt_contact, peer->name)
|
? tr::lng_sure_delete_history(tr::now, lt_contact, peer->name)
|
||||||
: peer->isChat()
|
: peer->isChat()
|
||||||
? lng_sure_delete_and_exit(lt_group, peer->name)
|
? tr::lng_sure_delete_and_exit(tr::now, lt_group, peer->name)
|
||||||
: lang(peer->isMegagroup()
|
: peer->isMegagroup()
|
||||||
? lng_sure_leave_group
|
? tr::lng_sure_leave_group(tr::now)
|
||||||
: lng_sure_leave_channel);
|
: tr::lng_sure_leave_channel(tr::now);
|
||||||
deleteText = _wipeHistoryPeer->isUser()
|
deleteText = _wipeHistoryPeer->isUser()
|
||||||
? tr::lng_box_delete()
|
? tr::lng_box_delete()
|
||||||
: tr::lng_box_leave();
|
: tr::lng_box_leave();
|
||||||
|
@ -523,17 +523,17 @@ void DeleteMessagesBox::prepare() {
|
||||||
} else if (_moderateFrom) {
|
} else if (_moderateFrom) {
|
||||||
Assert(_moderateInChannel != nullptr);
|
Assert(_moderateInChannel != nullptr);
|
||||||
|
|
||||||
details.text = lang(lng_selected_delete_sure_this);
|
details.text = tr::lng_selected_delete_sure_this(tr::now);
|
||||||
if (_moderateBan) {
|
if (_moderateBan) {
|
||||||
_banUser.create(this, lang(lng_ban_user), false, st::defaultBoxCheckbox);
|
_banUser.create(this, tr::lng_ban_user(tr::now), false, st::defaultBoxCheckbox);
|
||||||
}
|
}
|
||||||
_reportSpam.create(this, lang(lng_report_spam), false, st::defaultBoxCheckbox);
|
_reportSpam.create(this, tr::lng_report_spam(tr::now), false, st::defaultBoxCheckbox);
|
||||||
if (_moderateDeleteAll) {
|
if (_moderateDeleteAll) {
|
||||||
_deleteAll.create(this, lang(lng_delete_all_from), false, st::defaultBoxCheckbox);
|
_deleteAll.create(this, tr::lng_delete_all_from(tr::now), false, st::defaultBoxCheckbox);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
details.text = (_ids.size() == 1)
|
details.text = (_ids.size() == 1)
|
||||||
? lang(lng_selected_delete_sure_this)
|
? tr::lng_selected_delete_sure_this(tr::now)
|
||||||
: lng_selected_delete_sure(lt_count, _ids.size());
|
: lng_selected_delete_sure(lt_count, _ids.size());
|
||||||
if (const auto peer = checkFromSinglePeer()) {
|
if (const auto peer = checkFromSinglePeer()) {
|
||||||
auto count = int(_ids.size());
|
auto count = int(_ids.size());
|
||||||
|
@ -601,7 +601,7 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName);
|
user->firstName);
|
||||||
} else {
|
} else {
|
||||||
result.checkbox = lang(lng_delete_for_everyone_check);
|
result.checkbox = tr::lng_delete_for_everyone_check(tr::now);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -793,17 +793,13 @@ ConfirmInviteBox::ConfirmInviteBox(
|
||||||
const auto title = qs(data.vtitle);
|
const auto title = qs(data.vtitle);
|
||||||
const auto count = data.vparticipants_count.v;
|
const auto count = data.vparticipants_count.v;
|
||||||
const auto status = [&] {
|
const auto status = [&] {
|
||||||
if (_participants.empty() || _participants.size() >= count) {
|
return (!_participants.empty() && _participants.size() < count)
|
||||||
if (count > 0) {
|
? tr::lng_group_invite_members(tr::now, lt_count, count)
|
||||||
return lng_chat_status_members(lt_count_decimal, count);
|
: (count > 0)
|
||||||
} else {
|
? tr::lng_chat_status_members(tr::now, lt_count_decimal, count)
|
||||||
return lang(_isChannel
|
: _isChannel
|
||||||
? lng_channel_status
|
? tr::lng_channel_status(tr::now)
|
||||||
: lng_group_status);
|
: tr::lng_group_status(tr::now);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return lng_group_invite_members(lt_count, count);
|
|
||||||
}
|
|
||||||
}();
|
}();
|
||||||
_title->setText(title);
|
_title->setText(title);
|
||||||
_status->setText(status);
|
_status->setText(status);
|
||||||
|
|
|
@ -58,9 +58,9 @@ void ShowPhoneBannedError(const QString &phone) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*box = Ui::show(Box<ConfirmBox>(
|
*box = Ui::show(Box<ConfirmBox>(
|
||||||
lang(lng_signin_banned_text),
|
tr::lng_signin_banned_text(tr::now),
|
||||||
lang(lng_box_ok),
|
tr::lng_box_ok(tr::now),
|
||||||
lang(lng_signin_banned_help),
|
tr::lng_signin_banned_help(tr::now),
|
||||||
close,
|
close,
|
||||||
[=] { SendToBannedHelp(phone); close(); }));
|
[=] { SendToBannedHelp(phone); close(); }));
|
||||||
|
|
||||||
|
@ -185,8 +185,8 @@ QString SentCodeCall::getText() const {
|
||||||
}
|
}
|
||||||
return lng_code_call(lt_minutes, QString::number(_status.timeout / 60), lt_seconds, qsl("%1").arg(_status.timeout % 60, 2, 10, QChar('0')));
|
return lng_code_call(lt_minutes, QString::number(_status.timeout / 60), lt_seconds, qsl("%1").arg(_status.timeout % 60, 2, 10, QChar('0')));
|
||||||
} break;
|
} break;
|
||||||
case State::Calling: return lang(lng_code_calling);
|
case State::Calling: return tr::lng_code_calling(tr::now);
|
||||||
case State::Called: return lang(lng_code_called);
|
case State::Called: return tr::lng_code_called(tr::now);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -246,11 +246,11 @@ void ConfirmPhoneBox::sendCodeDone(const MTPauth_SentCode &result) {
|
||||||
bool ConfirmPhoneBox::sendCodeFail(const RPCError &error) {
|
bool ConfirmPhoneBox::sendCodeFail(const RPCError &error) {
|
||||||
auto errorText = Lang::Hard::ServerError();
|
auto errorText = Lang::Hard::ServerError();
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errorText = lang(lng_flood_error);
|
errorText = tr::lng_flood_error(tr::now);
|
||||||
} else if (MTP::isDefaultHandledError(error)) {
|
} else if (MTP::isDefaultHandledError(error)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (error.code() == 400) {
|
} else if (error.code() == 400) {
|
||||||
errorText = lang(lng_confirm_phone_link_invalid);
|
errorText = tr::lng_confirm_phone_link_invalid(tr::now);
|
||||||
}
|
}
|
||||||
_sendCodeRequestId = 0;
|
_sendCodeRequestId = 0;
|
||||||
Ui::show(Box<InformBox>(errorText));
|
Ui::show(Box<InformBox>(errorText));
|
||||||
|
@ -327,13 +327,13 @@ void ConfirmPhoneBox::confirmDone(const MTPBool &result) {
|
||||||
bool ConfirmPhoneBox::confirmFail(const RPCError &error) {
|
bool ConfirmPhoneBox::confirmFail(const RPCError &error) {
|
||||||
auto errorText = Lang::Hard::ServerError();
|
auto errorText = Lang::Hard::ServerError();
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errorText = lang(lng_flood_error);
|
errorText = tr::lng_flood_error(tr::now);
|
||||||
} else if (MTP::isDefaultHandledError(error)) {
|
} else if (MTP::isDefaultHandledError(error)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
auto &errorType = error.type();
|
auto &errorType = error.type();
|
||||||
if (errorType == qstr("PHONE_CODE_EMPTY") || errorType == qstr("PHONE_CODE_INVALID")) {
|
if (errorType == qstr("PHONE_CODE_EMPTY") || errorType == qstr("PHONE_CODE_INVALID")) {
|
||||||
errorText = lang(lng_bad_code);
|
errorText = tr::lng_bad_code(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_sendCodeRequestId = 0;
|
_sendCodeRequestId = 0;
|
||||||
|
@ -369,7 +369,7 @@ void ConfirmPhoneBox::paintEvent(QPaintEvent *e) {
|
||||||
auto errorText = _error;
|
auto errorText = _error;
|
||||||
if (errorText.isEmpty()) {
|
if (errorText.isEmpty()) {
|
||||||
p.setPen(st::usernameDefaultFg);
|
p.setPen(st::usernameDefaultFg);
|
||||||
errorText = lang(lng_confirm_phone_enter_code);
|
errorText = tr::lng_confirm_phone_enter_code(tr::now);
|
||||||
} else {
|
} else {
|
||||||
p.setPen(st::boxTextFgError);
|
p.setPen(st::boxTextFgError);
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,13 +308,13 @@ void ProxyRow::paintEvent(QPaintEvent *e) {
|
||||||
lt_ping,
|
lt_ping,
|
||||||
QString::number(_view.ping));
|
QString::number(_view.ping));
|
||||||
case State::Checking:
|
case State::Checking:
|
||||||
return lang(lng_proxy_checking);
|
return tr::lng_proxy_checking(tr::now);
|
||||||
case State::Connecting:
|
case State::Connecting:
|
||||||
return lang(lng_proxy_connecting);
|
return tr::lng_proxy_connecting(tr::now);
|
||||||
case State::Online:
|
case State::Online:
|
||||||
return lang(lng_proxy_online);
|
return tr::lng_proxy_online(tr::now);
|
||||||
case State::Unavailable:
|
case State::Unavailable:
|
||||||
return lang(lng_proxy_unavailable);
|
return tr::lng_proxy_unavailable(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("State in ProxyRow::paintEvent.");
|
Unexpected("State in ProxyRow::paintEvent.");
|
||||||
}();
|
}();
|
||||||
|
@ -409,20 +409,20 @@ void ProxyRow::showMenu() {
|
||||||
Fn<void()> callback) {
|
Fn<void()> callback) {
|
||||||
return _menu->addAction(text, std::move(callback));
|
return _menu->addAction(text, std::move(callback));
|
||||||
};
|
};
|
||||||
addAction(lang(lng_proxy_menu_edit), [=] {
|
addAction(tr::lng_proxy_menu_edit(tr::now), [=] {
|
||||||
_editClicks.fire({});
|
_editClicks.fire({});
|
||||||
});
|
});
|
||||||
if (_view.supportsShare) {
|
if (_view.supportsShare) {
|
||||||
addAction(lang(lng_proxy_edit_share), [=] {
|
addAction(tr::lng_proxy_edit_share(tr::now), [=] {
|
||||||
_shareClicks.fire({});
|
_shareClicks.fire({});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (_view.deleted) {
|
if (_view.deleted) {
|
||||||
addAction(lang(lng_proxy_menu_restore), [=] {
|
addAction(tr::lng_proxy_menu_restore(tr::now), [=] {
|
||||||
_restoreClicks.fire({});
|
_restoreClicks.fire({});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addAction(lang(lng_proxy_menu_delete), [=] {
|
addAction(tr::lng_proxy_menu_delete(tr::now), [=] {
|
||||||
_deleteClicks.fire({});
|
_deleteClicks.fire({});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,7 @@ void ProxiesBox::setupContent() {
|
||||||
_tryIPv6 = inner->add(
|
_tryIPv6 = inner->add(
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
inner,
|
inner,
|
||||||
lang(lng_connection_try_ipv6),
|
tr::lng_connection_try_ipv6(tr::now),
|
||||||
Global::TryIPv6()),
|
Global::TryIPv6()),
|
||||||
st::proxyTryIPv6Padding);
|
st::proxyTryIPv6Padding);
|
||||||
_proxySettings
|
_proxySettings
|
||||||
|
@ -494,28 +494,28 @@ void ProxiesBox::setupContent() {
|
||||||
inner,
|
inner,
|
||||||
_proxySettings,
|
_proxySettings,
|
||||||
ProxyData::Settings::Disabled,
|
ProxyData::Settings::Disabled,
|
||||||
lang(lng_proxy_disable)),
|
tr::lng_proxy_disable(tr::now)),
|
||||||
st::proxyUsePadding);
|
st::proxyUsePadding);
|
||||||
inner->add(
|
inner->add(
|
||||||
object_ptr<Ui::Radioenum<ProxyData::Settings>>(
|
object_ptr<Ui::Radioenum<ProxyData::Settings>>(
|
||||||
inner,
|
inner,
|
||||||
_proxySettings,
|
_proxySettings,
|
||||||
ProxyData::Settings::System,
|
ProxyData::Settings::System,
|
||||||
lang(lng_proxy_use_system_settings)),
|
tr::lng_proxy_use_system_settings(tr::now)),
|
||||||
st::proxyUsePadding);
|
st::proxyUsePadding);
|
||||||
inner->add(
|
inner->add(
|
||||||
object_ptr<Ui::Radioenum<ProxyData::Settings>>(
|
object_ptr<Ui::Radioenum<ProxyData::Settings>>(
|
||||||
inner,
|
inner,
|
||||||
_proxySettings,
|
_proxySettings,
|
||||||
ProxyData::Settings::Enabled,
|
ProxyData::Settings::Enabled,
|
||||||
lang(lng_proxy_use_custom)),
|
tr::lng_proxy_use_custom(tr::now)),
|
||||||
st::proxyUsePadding);
|
st::proxyUsePadding);
|
||||||
_proxyForCalls = inner->add(
|
_proxyForCalls = inner->add(
|
||||||
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
||||||
inner,
|
inner,
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
inner,
|
inner,
|
||||||
lang(lng_proxy_use_for_calls),
|
tr::lng_proxy_use_for_calls(tr::now),
|
||||||
Global::UseProxyForCalls()),
|
Global::UseProxyForCalls()),
|
||||||
style::margins(
|
style::margins(
|
||||||
0,
|
0,
|
||||||
|
@ -533,7 +533,7 @@ void ProxiesBox::setupContent() {
|
||||||
inner,
|
inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
inner,
|
inner,
|
||||||
lang(lng_proxy_about),
|
tr::lng_proxy_about(tr::now),
|
||||||
st::boxDividerLabel),
|
st::boxDividerLabel),
|
||||||
st::proxyAboutPadding),
|
st::proxyAboutPadding),
|
||||||
style::margins(0, 0, 0, st::proxyRowPadding.top()));
|
style::margins(0, 0, 0, st::proxyRowPadding.top()));
|
||||||
|
@ -650,7 +650,7 @@ void ProxiesBox::createNoRowsLabel() {
|
||||||
_noRows->height());
|
_noRows->height());
|
||||||
const auto label = Ui::CreateChild<Ui::FlatLabel>(
|
const auto label = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
_noRows.get(),
|
_noRows.get(),
|
||||||
lang(lng_proxy_description),
|
tr::lng_proxy_description(tr::now),
|
||||||
st::proxyEmptyListLabel);
|
st::proxyEmptyListLabel);
|
||||||
_noRows->widthValue(
|
_noRows->widthValue(
|
||||||
) | rpl::start_with_next([=](int width) {
|
) | rpl::start_with_next([=](int width) {
|
||||||
|
@ -777,13 +777,13 @@ void ProxyBox::setupTypes() {
|
||||||
_content,
|
_content,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_content,
|
_content,
|
||||||
lang(lng_proxy_sponsor_warning),
|
tr::lng_proxy_sponsor_warning(tr::now),
|
||||||
st::boxDividerLabel),
|
st::boxDividerLabel),
|
||||||
st::proxyAboutSponsorPadding)));
|
st::proxyAboutSponsorPadding)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProxyBox::setupSocketAddress(const ProxyData &data) {
|
void ProxyBox::setupSocketAddress(const ProxyData &data) {
|
||||||
addLabel(_content, lang(lng_proxy_address_label));
|
addLabel(_content, tr::lng_proxy_address_label(tr::now));
|
||||||
const auto address = _content->add(
|
const auto address = _content->add(
|
||||||
object_ptr<Ui::FixedHeightWidget>(
|
object_ptr<Ui::FixedHeightWidget>(
|
||||||
_content,
|
_content,
|
||||||
|
@ -815,7 +815,7 @@ void ProxyBox::setupCredentials(const ProxyData &data) {
|
||||||
_content,
|
_content,
|
||||||
object_ptr<Ui::VerticalLayout>(_content)));
|
object_ptr<Ui::VerticalLayout>(_content)));
|
||||||
const auto credentials = _credentials->entity();
|
const auto credentials = _credentials->entity();
|
||||||
addLabel(credentials, lang(lng_proxy_credentials_optional));
|
addLabel(credentials, tr::lng_proxy_credentials_optional(tr::now));
|
||||||
_user = credentials->add(
|
_user = credentials->add(
|
||||||
object_ptr<Ui::InputField>(
|
object_ptr<Ui::InputField>(
|
||||||
credentials,
|
credentials,
|
||||||
|
@ -848,7 +848,7 @@ void ProxyBox::setupMtprotoCredentials(const ProxyData &data) {
|
||||||
_content,
|
_content,
|
||||||
object_ptr<Ui::VerticalLayout>(_content)));
|
object_ptr<Ui::VerticalLayout>(_content)));
|
||||||
const auto mtproto = _mtprotoCredentials->entity();
|
const auto mtproto = _mtprotoCredentials->entity();
|
||||||
addLabel(mtproto, lang(lng_proxy_credentials));
|
addLabel(mtproto, tr::lng_proxy_credentials(tr::now));
|
||||||
|
|
||||||
auto secretWrap = object_ptr<Ui::RpWidget>(mtproto);
|
auto secretWrap = object_ptr<Ui::RpWidget>(mtproto);
|
||||||
_secret = Ui::CreateChild<Ui::HexInput>(
|
_secret = Ui::CreateChild<Ui::HexInput>(
|
||||||
|
@ -958,9 +958,9 @@ void ProxiesBoxController::ShowApplyConfirmation(
|
||||||
lt_port,
|
lt_port,
|
||||||
QString::number(port))
|
QString::number(port))
|
||||||
+ (proxy.type == Type::Mtproto
|
+ (proxy.type == Type::Mtproto
|
||||||
? "\n\n" + lang(lng_proxy_sponsor_warning)
|
? "\n\n" + tr::lng_proxy_sponsor_warning(tr::now)
|
||||||
: QString());
|
: QString());
|
||||||
*box = Ui::show(Box<ConfirmBox>(text, lang(lng_sure_enable), [=] {
|
*box = Ui::show(Box<ConfirmBox>(text, tr::lng_sure_enable(tr::now), [=] {
|
||||||
auto &proxies = Global::RefProxiesList();
|
auto &proxies = Global::RefProxiesList();
|
||||||
if (ranges::find(proxies, proxy) == end(proxies)) {
|
if (ranges::find(proxies, proxy) == end(proxies)) {
|
||||||
proxies.push_back(proxy);
|
proxies.push_back(proxy);
|
||||||
|
@ -1372,7 +1372,7 @@ void ProxiesBoxController::share(const ProxyData &proxy) {
|
||||||
+ ((proxy.type == Type::Mtproto && !proxy.password.isEmpty())
|
+ ((proxy.type == Type::Mtproto && !proxy.password.isEmpty())
|
||||||
? "&secret=" + proxy.password : "");
|
? "&secret=" + proxy.password : "");
|
||||||
QApplication::clipboard()->setText(link);
|
QApplication::clipboard()->setText(link);
|
||||||
Ui::Toast::Show(lang(lng_username_copied));
|
Ui::Toast::Show(tr::lng_username_copied(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProxiesBoxController::~ProxiesBoxController() {
|
ProxiesBoxController::~ProxiesBoxController() {
|
||||||
|
|
|
@ -655,7 +655,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
||||||
}) | rpl::map([=](int count) {
|
}) | rpl::map([=](int count) {
|
||||||
return (count < kMaxOptionsCount)
|
return (count < kMaxOptionsCount)
|
||||||
? lng_polls_create_limit(lt_count, kMaxOptionsCount - count)
|
? lng_polls_create_limit(lt_count, kMaxOptionsCount - count)
|
||||||
: lang(lng_polls_create_maximum);
|
: tr::lng_polls_create_maximum(tr::now);
|
||||||
}) | rpl::after_next([=] {
|
}) | rpl::after_next([=] {
|
||||||
container->resizeToWidth(container->widthNoMargins());
|
container->resizeToWidth(container->widthNoMargins());
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,9 +19,9 @@ DownloadPathBox::DownloadPathBox(QWidget *parent)
|
||||||
: _path(Global::DownloadPath())
|
: _path(Global::DownloadPath())
|
||||||
, _pathBookmark(Global::DownloadPathBookmark())
|
, _pathBookmark(Global::DownloadPathBookmark())
|
||||||
, _group(std::make_shared<Ui::RadioenumGroup<Directory>>(typeFromPath(_path)))
|
, _group(std::make_shared<Ui::RadioenumGroup<Directory>>(typeFromPath(_path)))
|
||||||
, _default(this, _group, Directory::Downloads, lang(lng_download_path_default_radio), st::defaultBoxCheckbox)
|
, _default(this, _group, Directory::Downloads, tr::lng_download_path_default_radio(tr::now), st::defaultBoxCheckbox)
|
||||||
, _temp(this, _group, Directory::Temp, lang(lng_download_path_temp_radio), st::defaultBoxCheckbox)
|
, _temp(this, _group, Directory::Temp, tr::lng_download_path_temp_radio(tr::now), st::defaultBoxCheckbox)
|
||||||
, _dir(this, _group, Directory::Custom, lang(lng_download_path_dir_radio), st::defaultBoxCheckbox)
|
, _dir(this, _group, Directory::Custom, tr::lng_download_path_dir_radio(tr::now), st::defaultBoxCheckbox)
|
||||||
, _pathLink(this, QString(), st::boxLinkButton) {
|
, _pathLink(this, QString(), st::boxLinkButton) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ void DownloadPathBox::editPath() {
|
||||||
};
|
};
|
||||||
FileDialog::GetFolder(
|
FileDialog::GetFolder(
|
||||||
this,
|
this,
|
||||||
lang(lng_download_path_choose),
|
tr::lng_download_path_choose(tr::now),
|
||||||
initialPath,
|
initialPath,
|
||||||
crl::guard(this, handleFolder));
|
crl::guard(this, handleFolder));
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ EditCaptionBox::EditCaptionBox(
|
||||||
|
|
||||||
if (doc) {
|
if (doc) {
|
||||||
const auto nameString = doc->isVoiceMessage()
|
const auto nameString = doc->isVoiceMessage()
|
||||||
? lang(lng_media_audio)
|
? tr::lng_media_audio(tr::now)
|
||||||
: doc->composeNameString();
|
: doc->composeNameString();
|
||||||
setName(nameString, doc->size);
|
setName(nameString, doc->size);
|
||||||
_isImage = doc->isImage();
|
_isImage = doc->isImage();
|
||||||
|
@ -262,7 +262,7 @@ EditCaptionBox::EditCaptionBox(
|
||||||
this,
|
this,
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
this,
|
this,
|
||||||
lang(lng_send_file),
|
tr::lng_send_file(tr::now),
|
||||||
false,
|
false,
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::editMediaCheckboxMargins);
|
st::editMediaCheckboxMargins);
|
||||||
|
@ -481,7 +481,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
const auto isValidFile = [](QString mimeType) {
|
const auto isValidFile = [](QString mimeType) {
|
||||||
if (mimeType == qstr("image/webp")) {
|
if (mimeType == qstr("image/webp")) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_edit_media_invalid_file)),
|
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -509,7 +509,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
if (ranges::find(albumMimes, file->mime) == end(albumMimes)
|
if (ranges::find(albumMimes, file->mime) == end(albumMimes)
|
||||||
|| file->type == Storage::PreparedFile::AlbumType::None) {
|
|| file->type == Storage::PreparedFile::AlbumType::None) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -539,7 +539,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
});
|
});
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -563,7 +563,7 @@ void EditCaptionBox::createEditMediaButton() {
|
||||||
: QStringList(FileDialog::AllFilesFilter());
|
: QStringList(FileDialog::AllFilesFilter());
|
||||||
FileDialog::GetOpenPath(
|
FileDialog::GetOpenPath(
|
||||||
this,
|
this,
|
||||||
lang(lng_choose_file),
|
tr::lng_choose_file(tr::now),
|
||||||
filters.join(qsl(";;")),
|
filters.join(qsl(";;")),
|
||||||
crl::guard(this, callback));
|
crl::guard(this, callback));
|
||||||
};
|
};
|
||||||
|
@ -674,7 +674,7 @@ bool EditCaptionBox::fileFromClipboard(not_null<const QMimeData*> data) {
|
||||||
if (list.files.front().type == Storage::PreparedFile::AlbumType::None
|
if (list.files.front().type == Storage::PreparedFile::AlbumType::None
|
||||||
&& _isAlbum) {
|
&& _isAlbum) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_edit_media_album_error)),
|
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -827,7 +827,7 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
|
||||||
} else {
|
} else {
|
||||||
p.setFont(st::boxTitleFont);
|
p.setFont(st::boxTitleFont);
|
||||||
p.setPen(st::boxTextFg);
|
p.setPen(st::boxTextFg);
|
||||||
p.drawTextLeft(_field->x(), st::boxPhotoPadding.top(), width(), lang(lng_edit_message));
|
p.drawTextLeft(_field->x(), st::boxPhotoPadding.top(), width(), tr::lng_edit_message(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_error.isEmpty()) {
|
if (!_error.isEmpty()) {
|
||||||
|
@ -875,7 +875,7 @@ void EditCaptionBox::save() {
|
||||||
|
|
||||||
const auto item = Auth().data().message(_msgId);
|
const auto item = Auth().data().message(_msgId);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
_error = lang(lng_edit_deleted);
|
_error = tr::lng_edit_deleted(tr::now);
|
||||||
update();
|
update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -945,7 +945,7 @@ bool EditCaptionBox::saveFail(const RPCError &error) {
|
||||||
_saveRequestId = 0;
|
_saveRequestId = 0;
|
||||||
QString err = error.type();
|
QString err = error.type();
|
||||||
if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) {
|
if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) {
|
||||||
_error = lang(lng_edit_error);
|
_error = tr::lng_edit_error(tr::now);
|
||||||
} else if (err == qstr("MESSAGE_NOT_MODIFIED")) {
|
} else if (err == qstr("MESSAGE_NOT_MODIFIED")) {
|
||||||
closeBox();
|
closeBox();
|
||||||
return true;
|
return true;
|
||||||
|
@ -953,7 +953,7 @@ bool EditCaptionBox::saveFail(const RPCError &error) {
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
_field->showError();
|
_field->showError();
|
||||||
} else {
|
} else {
|
||||||
_error = lang(lng_edit_error);
|
_error = tr::lng_edit_error(tr::now);
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -102,11 +102,11 @@ std::unique_ptr<PrivacyExceptionsBoxController::Row> PrivacyExceptionsBoxControl
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
LangKey EditPrivacyController::optionLabelKey(Option option) {
|
QString EditPrivacyController::optionLabel(Option option) {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case Option::Everyone: return lng_edit_privacy_everyone;
|
case Option::Everyone: return tr::lng_edit_privacy_everyone(tr::now);
|
||||||
case Option::Contacts: return lng_edit_privacy_contacts;
|
case Option::Contacts: return tr::lng_edit_privacy_contacts(tr::now);
|
||||||
case Option::Nobody: return lng_edit_privacy_nobody;
|
case Option::Nobody: return tr::lng_edit_privacy_nobody(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("Option value in optionsLabelKey.");
|
Unexpected("Option value in optionsLabelKey.");
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ Ui::Radioenum<EditPrivacyBox::Option> *EditPrivacyBox::addOption(
|
||||||
container,
|
container,
|
||||||
group,
|
group,
|
||||||
option,
|
option,
|
||||||
lang(_controller->optionLabelKey(option)),
|
_controller->optionLabel(option),
|
||||||
st::settingsSendType),
|
st::settingsSendType),
|
||||||
st::settingsSendTypePadding);
|
st::settingsSendTypePadding);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +303,7 @@ void EditPrivacyBox::setupContent() {
|
||||||
}) | rpl::map([](int count) {
|
}) | rpl::map([](int count) {
|
||||||
return count
|
return count
|
||||||
? lng_edit_privacy_exceptions_count(lt_count, count)
|
? lng_edit_privacy_exceptions_count(lt_count, count)
|
||||||
: lang(lng_edit_privacy_exceptions_add);
|
: tr::lng_edit_privacy_exceptions_add(tr::now);
|
||||||
});
|
});
|
||||||
auto text = _controller->exceptionButtonTextKey(exception);
|
auto text = _controller->exceptionButtonTextKey(exception);
|
||||||
const auto button = content->add(
|
const auto button = content->add(
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
[[nodiscard]] virtual rpl::producer<QString> optionsTitleKey() = 0;
|
[[nodiscard]] virtual rpl::producer<QString> optionsTitleKey() = 0;
|
||||||
[[nodiscard]] virtual LangKey optionLabelKey(Option option);
|
[[nodiscard]] virtual QString optionLabel(Option option);
|
||||||
[[nodiscard]] virtual rpl::producer<QString> warning() {
|
[[nodiscard]] virtual rpl::producer<QString> warning() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -409,7 +409,7 @@ bool Rows::hasMenu(not_null<const Row*> row) const {
|
||||||
void Rows::share(not_null<const Row*> row) const {
|
void Rows::share(not_null<const Row*> row) const {
|
||||||
const auto link = qsl("https://t.me/setlanguage/") + row->data.id;
|
const auto link = qsl("https://t.me/setlanguage/") + row->data.id;
|
||||||
QApplication::clipboard()->setText(link);
|
QApplication::clipboard()->setText(link);
|
||||||
Ui::Toast::Show(lang(lng_username_copied));
|
Ui::Toast::Show(tr::lng_username_copied(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Rows::remove(not_null<Row*> row) {
|
void Rows::remove(not_null<Row*> row) {
|
||||||
|
@ -461,15 +461,15 @@ void Rows::showMenu(int index) {
|
||||||
};
|
};
|
||||||
const auto id = row->data.id;
|
const auto id = row->data.id;
|
||||||
if (canShare(row)) {
|
if (canShare(row)) {
|
||||||
addAction(lang(lng_proxy_edit_share), [=] { share(row); });
|
addAction(tr::lng_proxy_edit_share(tr::now), [=] { share(row); });
|
||||||
}
|
}
|
||||||
if (canRemove(row)) {
|
if (canRemove(row)) {
|
||||||
if (row->removed) {
|
if (row->removed) {
|
||||||
addAction(lang(lng_proxy_menu_restore), [=] {
|
addAction(tr::lng_proxy_menu_restore(tr::now), [=] {
|
||||||
restore(row);
|
restore(row);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addAction(lang(lng_proxy_menu_delete), [=] {
|
addAction(tr::lng_proxy_menu_delete(tr::now), [=] {
|
||||||
remove(row);
|
remove(row);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ QString TimeLimitText(size_type limit) {
|
||||||
? lng_local_storage_limit_months(lt_count, months)
|
? lng_local_storage_limit_months(lt_count, months)
|
||||||
: (limit > 0)
|
: (limit > 0)
|
||||||
? lng_local_storage_limit_weeks(lt_count, weeks)
|
? lng_local_storage_limit_weeks(lt_count, weeks)
|
||||||
: lang(lng_local_storage_limit_never);
|
: tr::lng_local_storage_limit_never(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type LimitToValue(size_type timeLimit) {
|
size_type LimitToValue(size_type timeLimit) {
|
||||||
|
@ -189,7 +189,7 @@ void LocalStorageBox::Row::toggleProgress(bool shown) {
|
||||||
_progress->start();
|
_progress->start();
|
||||||
_clearing = object_ptr<Ui::FlatLabel>(
|
_clearing = object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_local_storage_clearing),
|
tr::lng_local_storage_clearing(tr::now),
|
||||||
st::localStorageRowSize);
|
st::localStorageRowSize);
|
||||||
_clearing->show();
|
_clearing->show();
|
||||||
_description->hide();
|
_description->hide();
|
||||||
|
@ -260,7 +260,7 @@ QString LocalStorageBox::Row::titleText(const Database::TaggedSummary &data) con
|
||||||
QString LocalStorageBox::Row::sizeText(const Database::TaggedSummary &data) const {
|
QString LocalStorageBox::Row::sizeText(const Database::TaggedSummary &data) const {
|
||||||
return data.totalSize
|
return data.totalSize
|
||||||
? formatSizeText(data.totalSize)
|
? formatSizeText(data.totalSize)
|
||||||
: lang(lng_local_storage_empty);
|
: tr::lng_local_storage_empty(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalStorageBox::LocalStorageBox(
|
LocalStorageBox::LocalStorageBox(
|
||||||
|
@ -399,10 +399,10 @@ void LocalStorageBox::setupControls() {
|
||||||
data));
|
data));
|
||||||
};
|
};
|
||||||
auto summaryTitle = [](size_type) {
|
auto summaryTitle = [](size_type) {
|
||||||
return lang(lng_local_storage_summary);
|
return tr::lng_local_storage_summary(tr::now);
|
||||||
};
|
};
|
||||||
auto mediaCacheTitle = [](size_type) {
|
auto mediaCacheTitle = [](size_type) {
|
||||||
return lang(lng_local_storage_media);
|
return tr::lng_local_storage_media(tr::now);
|
||||||
};
|
};
|
||||||
createRow(
|
createRow(
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -30,7 +30,7 @@ void MuteSettingsBox::prepare() {
|
||||||
auto y = 0;
|
auto y = 0;
|
||||||
|
|
||||||
object_ptr<Ui::FlatLabel> info(this, st::boxLabel);
|
object_ptr<Ui::FlatLabel> info(this, st::boxLabel);
|
||||||
info->setText(lang(lng_mute_box_tip));
|
info->setText(tr::lng_mute_box_tip(tr::now));
|
||||||
info->moveToLeft(st::boxPadding.left(), y);
|
info->moveToLeft(st::boxPadding.left(), y);
|
||||||
y += info->height() + st::boxLittleSkip;
|
y += info->height() + st::boxLittleSkip;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ void MuteSettingsBox::prepare() {
|
||||||
} else if (hours < kForeverHours) {
|
} else if (hours < kForeverHours) {
|
||||||
return lng_mute_duration_days(lt_count, hours / 24);
|
return lng_mute_duration_days(lt_count, hours / 24);
|
||||||
} else {
|
} else {
|
||||||
return lang(lng_mute_duration_forever);
|
return tr::lng_mute_duration_forever(tr::now);
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
object_ptr<Ui::Radiobutton> option(this, group, hours, text);
|
object_ptr<Ui::Radiobutton> option(this, group, hours, text);
|
||||||
|
|
|
@ -48,7 +48,7 @@ PasscodeBox::PasscodeBox(QWidget*, bool turningOff)
|
||||||
, _reenterPasscode(this, st::defaultInputField, tr::lng_passcode_confirm_new())
|
, _reenterPasscode(this, st::defaultInputField, tr::lng_passcode_confirm_new())
|
||||||
, _passwordHint(this, st::defaultInputField, tr::lng_cloud_password_hint())
|
, _passwordHint(this, st::defaultInputField, tr::lng_cloud_password_hint())
|
||||||
, _recoverEmail(this, st::defaultInputField, tr::lng_cloud_password_email())
|
, _recoverEmail(this, st::defaultInputField, tr::lng_cloud_password_email())
|
||||||
, _recover(this, lang(lng_signin_recover)) {
|
, _recover(this, tr::lng_signin_recover(tr::now)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PasscodeBox::PasscodeBox(QWidget*, const CloudFields &fields)
|
PasscodeBox::PasscodeBox(QWidget*, const CloudFields &fields)
|
||||||
|
@ -61,7 +61,7 @@ PasscodeBox::PasscodeBox(QWidget*, const CloudFields &fields)
|
||||||
, _reenterPasscode(this, st::defaultInputField, tr::lng_cloud_password_confirm_new())
|
, _reenterPasscode(this, st::defaultInputField, tr::lng_cloud_password_confirm_new())
|
||||||
, _passwordHint(this, st::defaultInputField, fields.curRequest ? tr::lng_cloud_password_change_hint() : tr::lng_cloud_password_hint())
|
, _passwordHint(this, st::defaultInputField, fields.curRequest ? tr::lng_cloud_password_change_hint() : tr::lng_cloud_password_hint())
|
||||||
, _recoverEmail(this, st::defaultInputField, tr::lng_cloud_password_email())
|
, _recoverEmail(this, st::defaultInputField, tr::lng_cloud_password_email())
|
||||||
, _recover(this, lang(lng_signin_recover)) {
|
, _recover(this, tr::lng_signin_recover(tr::now)) {
|
||||||
Expects(!_turningOff || _cloudFields.curRequest);
|
Expects(!_turningOff || _cloudFields.curRequest);
|
||||||
|
|
||||||
if (!_cloudFields.hint.isEmpty()) {
|
if (!_cloudFields.hint.isEmpty()) {
|
||||||
|
@ -103,9 +103,11 @@ void PasscodeBox::prepare() {
|
||||||
|
|
||||||
_about.setText(
|
_about.setText(
|
||||||
st::passcodeTextStyle,
|
st::passcodeTextStyle,
|
||||||
_cloudFields.customDescription.value_or(lang(_cloudPwd
|
(_cloudFields.customDescription
|
||||||
? lng_cloud_password_about
|
? *_cloudFields.customDescription
|
||||||
: lng_passcode_about)));
|
: _cloudPwd
|
||||||
|
? tr::lng_cloud_password_about(tr::now)
|
||||||
|
: tr::lng_passcode_about(tr::now)));
|
||||||
_aboutHeight = _about.countHeight(st::boxWidth - st::boxPadding.left() * 1.5);
|
_aboutHeight = _about.countHeight(st::boxWidth - st::boxPadding.left() * 1.5);
|
||||||
const auto onlyCheck = onlyCheckCurrent();
|
const auto onlyCheck = onlyCheckCurrent();
|
||||||
if (onlyCheck) {
|
if (onlyCheck) {
|
||||||
|
@ -259,7 +261,11 @@ void PasscodeBox::setPasswordDone(const QByteArray &newPasswordBytes) {
|
||||||
_setRequest = 0;
|
_setRequest = 0;
|
||||||
_newPasswordSet.fire_copy(newPasswordBytes);
|
_newPasswordSet.fire_copy(newPasswordBytes);
|
||||||
const auto weak = make_weak(this);
|
const auto weak = make_weak(this);
|
||||||
const auto text = lang(_reenterPasscode->isHidden() ? lng_cloud_password_removed : (_oldPasscode->isHidden() ? lng_cloud_password_was_set : lng_cloud_password_updated));
|
const auto text = _reenterPasscode->isHidden()
|
||||||
|
? tr::lng_cloud_password_removed(tr::now)
|
||||||
|
: _oldPasscode->isHidden()
|
||||||
|
? tr::lng_cloud_password_was_set(tr::now)
|
||||||
|
: tr::lng_cloud_password_updated(tr::now);
|
||||||
getDelegate()->show(Box<InformBox>(text));
|
getDelegate()->show(Box<InformBox>(text));
|
||||||
if (weak) {
|
if (weak) {
|
||||||
closeBox();
|
closeBox();
|
||||||
|
@ -282,7 +288,7 @@ void PasscodeBox::setPasswordFail(const RPCError &error) {
|
||||||
_oldPasscode->selectAll();
|
_oldPasscode->selectAll();
|
||||||
_oldPasscode->setFocus();
|
_oldPasscode->setFocus();
|
||||||
_oldPasscode->showError();
|
_oldPasscode->showError();
|
||||||
_oldError = lang(lng_flood_error);
|
_oldError = tr::lng_flood_error(tr::now);
|
||||||
if (_cloudFields.hasRecovery && _hintText.isEmpty()) {
|
if (_cloudFields.hasRecovery && _hintText.isEmpty()) {
|
||||||
_recover->hide();
|
_recover->hide();
|
||||||
}
|
}
|
||||||
|
@ -306,7 +312,7 @@ void PasscodeBox::setPasswordFail(const RPCError &error) {
|
||||||
//} else if (err == qstr("NEW_PASSWORD_BAD")) {
|
//} else if (err == qstr("NEW_PASSWORD_BAD")) {
|
||||||
//} else if (err == qstr("NEW_SALT_INVALID")) {
|
//} else if (err == qstr("NEW_SALT_INVALID")) {
|
||||||
} else if (err == qstr("EMAIL_INVALID")) {
|
} else if (err == qstr("EMAIL_INVALID")) {
|
||||||
_emailError = lang(lng_cloud_password_bad_email);
|
_emailError = tr::lng_cloud_password_bad_email(tr::now);
|
||||||
_recoverEmail->setFocus();
|
_recoverEmail->setFocus();
|
||||||
_recoverEmail->showError();
|
_recoverEmail->showError();
|
||||||
update();
|
update();
|
||||||
|
@ -349,9 +355,9 @@ void PasscodeBox::validateEmail(
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
_setRequest = 0;
|
_setRequest = 0;
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errors->fire(lang(lng_flood_error));
|
errors->fire(tr::lng_flood_error(tr::now));
|
||||||
} else if (error.type() == qstr("CODE_INVALID")) {
|
} else if (error.type() == qstr("CODE_INVALID")) {
|
||||||
errors->fire(lang(lng_signin_wrong_code));
|
errors->fire(tr::lng_signin_wrong_code(tr::now));
|
||||||
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
||||||
const auto weak = make_weak(this);
|
const auto weak = make_weak(this);
|
||||||
_clearUnconfirmedPassword.fire({});
|
_clearUnconfirmedPassword.fire({});
|
||||||
|
@ -374,7 +380,7 @@ void PasscodeBox::validateEmail(
|
||||||
_setRequest = request(MTPaccount_ResendPasswordEmail(
|
_setRequest = request(MTPaccount_ResendPasswordEmail(
|
||||||
)).done([=](const MTPBool &result) {
|
)).done([=](const MTPBool &result) {
|
||||||
_setRequest = 0;
|
_setRequest = 0;
|
||||||
resent->fire(lang(lng_cloud_password_resent));
|
resent->fire(tr::lng_cloud_password_resent(tr::now));
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
_setRequest = 0;
|
_setRequest = 0;
|
||||||
errors->fire(Lang::Hard::ServerError());
|
errors->fire(Lang::Hard::ServerError());
|
||||||
|
@ -424,7 +430,7 @@ void PasscodeBox::save(bool force) {
|
||||||
const auto has = currentlyHave();
|
const auto has = currentlyHave();
|
||||||
if (!_cloudPwd && (_turningOff || has)) {
|
if (!_cloudPwd && (_turningOff || has)) {
|
||||||
if (!passcodeCanTry()) {
|
if (!passcodeCanTry()) {
|
||||||
_oldError = lang(lng_flood_error);
|
_oldError = tr::lng_flood_error(tr::now);
|
||||||
_oldPasscode->setFocus();
|
_oldPasscode->setFocus();
|
||||||
_oldPasscode->showError();
|
_oldPasscode->showError();
|
||||||
update();
|
update();
|
||||||
|
@ -453,14 +459,18 @@ void PasscodeBox::save(bool force) {
|
||||||
_reenterPasscode->setFocus();
|
_reenterPasscode->setFocus();
|
||||||
_reenterPasscode->showError();
|
_reenterPasscode->showError();
|
||||||
if (!conf.isEmpty()) {
|
if (!conf.isEmpty()) {
|
||||||
_newError = lang(_cloudPwd ? lng_cloud_password_differ : lng_passcode_differ);
|
_newError = _cloudPwd
|
||||||
|
? tr::lng_cloud_password_differ(tr::now)
|
||||||
|
: tr::lng_passcode_differ(tr::now);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
closeReplacedBy();
|
closeReplacedBy();
|
||||||
} else if (!onlyCheck && has && old == pwd) {
|
} else if (!onlyCheck && has && old == pwd) {
|
||||||
_newPasscode->setFocus();
|
_newPasscode->setFocus();
|
||||||
_newPasscode->showError();
|
_newPasscode->showError();
|
||||||
_newError = lang(_cloudPwd ? lng_cloud_password_is_same : lng_passcode_is_same);
|
_newError = _cloudPwd
|
||||||
|
? tr::lng_cloud_password_is_same(tr::now)
|
||||||
|
: tr::lng_passcode_is_same(tr::now);
|
||||||
update();
|
update();
|
||||||
closeReplacedBy();
|
closeReplacedBy();
|
||||||
} else if (_cloudPwd) {
|
} else if (_cloudPwd) {
|
||||||
|
@ -471,7 +481,7 @@ void PasscodeBox::save(bool force) {
|
||||||
&& pwd == hint) {
|
&& pwd == hint) {
|
||||||
_newPasscode->setFocus();
|
_newPasscode->setFocus();
|
||||||
_newPasscode->showError();
|
_newPasscode->showError();
|
||||||
_newError = lang(lng_cloud_password_bad);
|
_newError = tr::lng_cloud_password_bad(tr::now);
|
||||||
update();
|
update();
|
||||||
closeReplacedBy();
|
closeReplacedBy();
|
||||||
return;
|
return;
|
||||||
|
@ -480,8 +490,8 @@ void PasscodeBox::save(bool force) {
|
||||||
_skipEmailWarning = true;
|
_skipEmailWarning = true;
|
||||||
_replacedBy = getDelegate()->show(
|
_replacedBy = getDelegate()->show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_cloud_password_about_recover),
|
tr::lng_cloud_password_about_recover(tr::now),
|
||||||
lang(lng_cloud_password_skip_email),
|
tr::lng_cloud_password_skip_email(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
crl::guard(this, [this] { save(true); })));
|
crl::guard(this, [this] { save(true); })));
|
||||||
} else if (onlyCheck) {
|
} else if (onlyCheck) {
|
||||||
|
@ -520,8 +530,8 @@ void PasscodeBox::submitOnlyCheckCloudPassword(const QString &oldPassword) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*box = getDelegate()->show(Box<ConfirmBox>(
|
*box = getDelegate()->show(Box<ConfirmBox>(
|
||||||
lang(lng_cloud_password_passport_losing),
|
tr::lng_cloud_password_passport_losing(tr::now),
|
||||||
lang(lng_continue),
|
tr::lng_continue(tr::now),
|
||||||
confirmed));
|
confirmed));
|
||||||
} else {
|
} else {
|
||||||
send();
|
send();
|
||||||
|
@ -817,7 +827,9 @@ void PasscodeBox::badOldPasscode() {
|
||||||
_oldPasscode->selectAll();
|
_oldPasscode->selectAll();
|
||||||
_oldPasscode->setFocus();
|
_oldPasscode->setFocus();
|
||||||
_oldPasscode->showError();
|
_oldPasscode->showError();
|
||||||
_oldError = lang(_cloudPwd ? lng_cloud_password_wrong : lng_passcode_wrong);
|
_oldError = _cloudPwd
|
||||||
|
? tr::lng_cloud_password_wrong(tr::now)
|
||||||
|
: tr::lng_passcode_wrong(tr::now);
|
||||||
if (_cloudFields.hasRecovery && _hintText.isEmpty()) {
|
if (_cloudFields.hasRecovery && _hintText.isEmpty()) {
|
||||||
_recover->hide();
|
_recover->hide();
|
||||||
}
|
}
|
||||||
|
@ -977,8 +989,8 @@ void RecoverBox::submit() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*box = getDelegate()->show(Box<ConfirmBox>(
|
*box = getDelegate()->show(Box<ConfirmBox>(
|
||||||
lang(lng_cloud_password_passport_losing),
|
tr::lng_cloud_password_passport_losing(tr::now),
|
||||||
lang(lng_continue),
|
tr::lng_continue(tr::now),
|
||||||
confirmed));
|
confirmed));
|
||||||
} else {
|
} else {
|
||||||
send();
|
send();
|
||||||
|
@ -997,14 +1009,14 @@ void RecoverBox::codeSubmitDone(
|
||||||
|
|
||||||
_passwordCleared.fire({});
|
_passwordCleared.fire({});
|
||||||
getDelegate()->show(
|
getDelegate()->show(
|
||||||
Box<InformBox>(lang(lng_cloud_password_removed)),
|
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||||
LayerOption::CloseOther);
|
LayerOption::CloseOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RecoverBox::codeSubmitFail(const RPCError &error) {
|
bool RecoverBox::codeSubmitFail(const RPCError &error) {
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
_submitRequest = 0;
|
_submitRequest = 0;
|
||||||
_error = lang(lng_flood_error);
|
_error = tr::lng_flood_error(tr::now);
|
||||||
update();
|
update();
|
||||||
_recoverCode->showError();
|
_recoverCode->showError();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1017,7 +1029,7 @@ bool RecoverBox::codeSubmitFail(const RPCError &error) {
|
||||||
if (err == qstr("PASSWORD_EMPTY")) {
|
if (err == qstr("PASSWORD_EMPTY")) {
|
||||||
_passwordCleared.fire({});
|
_passwordCleared.fire({});
|
||||||
getDelegate()->show(
|
getDelegate()->show(
|
||||||
Box<InformBox>(lang(lng_cloud_password_removed)),
|
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||||
LayerOption::CloseOther);
|
LayerOption::CloseOther);
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
|
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
|
||||||
|
@ -1028,7 +1040,7 @@ bool RecoverBox::codeSubmitFail(const RPCError &error) {
|
||||||
closeBox();
|
closeBox();
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("CODE_INVALID")) {
|
} else if (err == qstr("CODE_INVALID")) {
|
||||||
_error = lang(lng_signin_wrong_code);
|
_error = tr::lng_signin_wrong_code(tr::now);
|
||||||
update();
|
update();
|
||||||
_recoverCode->selectAll();
|
_recoverCode->selectAll();
|
||||||
_recoverCode->setFocus();
|
_recoverCode->setFocus();
|
||||||
|
@ -1062,7 +1074,7 @@ RecoveryEmailValidation ConfirmRecoveryEmail(const QString &pattern) {
|
||||||
reloads->fire({});
|
reloads->fire({});
|
||||||
if (*weak) {
|
if (*weak) {
|
||||||
(*weak)->getDelegate()->show(
|
(*weak)->getDelegate()->show(
|
||||||
Box<InformBox>(lang(lng_cloud_password_was_set)),
|
Box<InformBox>(tr::lng_cloud_password_was_set(tr::now)),
|
||||||
LayerOption::CloseOther);
|
LayerOption::CloseOther);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1074,9 +1086,9 @@ RecoveryEmailValidation ConfirmRecoveryEmail(const QString &pattern) {
|
||||||
}
|
}
|
||||||
*requestId = 0;
|
*requestId = 0;
|
||||||
if (MTP::isFloodError(error)) {
|
if (MTP::isFloodError(error)) {
|
||||||
errors->fire(lang(lng_flood_error));
|
errors->fire(tr::lng_flood_error(tr::now));
|
||||||
} else if (error.type() == qstr("CODE_INVALID")) {
|
} else if (error.type() == qstr("CODE_INVALID")) {
|
||||||
errors->fire(lang(lng_signin_wrong_code));
|
errors->fire(tr::lng_signin_wrong_code(tr::now));
|
||||||
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
||||||
cancels->fire({});
|
cancels->fire({});
|
||||||
if (*weak) {
|
if (*weak) {
|
||||||
|
@ -1103,7 +1115,7 @@ RecoveryEmailValidation ConfirmRecoveryEmail(const QString &pattern) {
|
||||||
*requestId = MTP::send(MTPaccount_ResendPasswordEmail(
|
*requestId = MTP::send(MTPaccount_ResendPasswordEmail(
|
||||||
), rpcDone([=](const MTPBool &result) {
|
), rpcDone([=](const MTPBool &result) {
|
||||||
*requestId = 0;
|
*requestId = 0;
|
||||||
resent->fire(lang(lng_cloud_password_resent));
|
resent->fire(tr::lng_cloud_password_resent(tr::now));
|
||||||
}), rpcFail([=](const RPCError &error) {
|
}), rpcFail([=](const RPCError &error) {
|
||||||
*requestId = 0;
|
*requestId = 0;
|
||||||
errors->fire(Lang::Hard::ServerError());
|
errors->fire(Lang::Hard::ServerError());
|
||||||
|
|
|
@ -295,7 +295,7 @@ void PeerListBox::addSelectItem(not_null<PeerData*> peer, PeerListRow::SetStyle
|
||||||
}
|
}
|
||||||
const auto respect = _controller->respectSavedMessagesChat();
|
const auto respect = _controller->respectSavedMessagesChat();
|
||||||
const auto text = (respect && peer->isSelf())
|
const auto text = (respect && peer->isSelf())
|
||||||
? lang(lng_saved_short)
|
? tr::lng_saved_short(tr::now)
|
||||||
: peer->shortName();
|
: peer->shortName();
|
||||||
const auto callback = PaintUserpicCallback(peer, respect);
|
const auto callback = PaintUserpicCallback(peer, respect);
|
||||||
if (style == PeerListRow::SetStyle::Fast) {
|
if (style == PeerListRow::SetStyle::Fast) {
|
||||||
|
@ -375,7 +375,7 @@ void PeerListRow::refreshStatus() {
|
||||||
_statusValidTill = 0;
|
_statusValidTill = 0;
|
||||||
if (auto user = peer()->asUser()) {
|
if (auto user = peer()->asUser()) {
|
||||||
if (_isSavedMessagesChat) {
|
if (_isSavedMessagesChat) {
|
||||||
setStatusText(lang(lng_saved_forward_here));
|
setStatusText(tr::lng_saved_forward_here(tr::now));
|
||||||
} else {
|
} else {
|
||||||
auto time = unixtime();
|
auto time = unixtime();
|
||||||
setStatusText(Data::OnlineText(user, time));
|
setStatusText(Data::OnlineText(user, time));
|
||||||
|
@ -387,16 +387,16 @@ void PeerListRow::refreshStatus() {
|
||||||
}
|
}
|
||||||
} else if (auto chat = peer()->asChat()) {
|
} else if (auto chat = peer()->asChat()) {
|
||||||
if (!chat->amIn()) {
|
if (!chat->amIn()) {
|
||||||
setStatusText(lang(lng_chat_status_unaccessible));
|
setStatusText(tr::lng_chat_status_unaccessible(tr::now));
|
||||||
} else if (chat->count > 0) {
|
} else if (chat->count > 0) {
|
||||||
setStatusText(lng_chat_status_members(lt_count_decimal, chat->count));
|
setStatusText(lng_chat_status_members(lt_count_decimal, chat->count));
|
||||||
} else {
|
} else {
|
||||||
setStatusText(lang(lng_group_status));
|
setStatusText(tr::lng_group_status(tr::now));
|
||||||
}
|
}
|
||||||
} else if (peer()->isMegagroup()) {
|
} else if (peer()->isMegagroup()) {
|
||||||
setStatusText(lang(lng_group_status));
|
setStatusText(tr::lng_group_status(tr::now));
|
||||||
} else if (peer()->isChannel()) {
|
} else if (peer()->isChannel()) {
|
||||||
setStatusText(lang(lng_channel_status));
|
setStatusText(tr::lng_channel_status(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ void PeerListRow::refreshName(const style::PeerListItem &st) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto text = _isSavedMessagesChat
|
const auto text = _isSavedMessagesChat
|
||||||
? lang(lng_saved_messages)
|
? tr::lng_saved_messages(tr::now)
|
||||||
: peer()->name;
|
: peer()->name;
|
||||||
_name.setText(st.nameStyle, text, Ui::NameTextOptions());
|
_name.setText(st.nameStyle, text, Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
|
@ -888,7 +888,7 @@ void PeerListContent::setSearchMode(PeerListSearchMode mode) {
|
||||||
if (!_searchLoading) {
|
if (!_searchLoading) {
|
||||||
setSearchLoading(object_ptr<Ui::FlatLabel>(
|
setSearchLoading(object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_contacts_loading),
|
tr::lng_contacts_loading(tr::now),
|
||||||
st::membersAbout));
|
st::membersAbout));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -221,7 +221,7 @@ ChatsListBoxController::ChatsListBoxController(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatsListBoxController::prepare() {
|
void ChatsListBoxController::prepare() {
|
||||||
setSearchNoResultsText(lang(lng_blocked_list_not_found));
|
setSearchNoResultsText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||||
|
|
||||||
prepareViewHook();
|
prepareViewHook();
|
||||||
|
@ -293,12 +293,12 @@ void ChatsListBoxController::checkForEmptyRows() {
|
||||||
} else {
|
} else {
|
||||||
const auto loaded = Auth().data().contactsLoaded().current()
|
const auto loaded = Auth().data().contactsLoaded().current()
|
||||||
&& Auth().data().chatsListLoaded();
|
&& Auth().data().chatsListLoaded();
|
||||||
setDescriptionText(loaded ? emptyBoxText() : lang(lng_contacts_loading));
|
setDescriptionText(loaded ? emptyBoxText() : tr::lng_contacts_loading(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ChatsListBoxController::emptyBoxText() const {
|
QString ChatsListBoxController::emptyBoxText() const {
|
||||||
return lang(lng_contacts_not_found);
|
return tr::lng_contacts_not_found(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListRow> ChatsListBoxController::createSearchRow(not_null<PeerData*> peer) {
|
std::unique_ptr<PeerListRow> ChatsListBoxController::createSearchRow(not_null<PeerData*> peer) {
|
||||||
|
@ -323,7 +323,7 @@ ContactsBoxController::ContactsBoxController(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsBoxController::prepare() {
|
void ContactsBoxController::prepare() {
|
||||||
setSearchNoResultsText(lang(lng_blocked_list_not_found));
|
setSearchNoResultsText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||||
delegate()->peerListSetTitle(tr::lng_contacts_header());
|
delegate()->peerListSetTitle(tr::lng_contacts_header());
|
||||||
|
|
||||||
|
@ -355,12 +355,11 @@ void ContactsBoxController::rebuildRows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsBoxController::checkForEmptyRows() {
|
void ContactsBoxController::checkForEmptyRows() {
|
||||||
if (delegate()->peerListFullRowsCount()) {
|
setDescriptionText(delegate()->peerListFullRowsCount()
|
||||||
setDescriptionText(QString());
|
? QString()
|
||||||
} else {
|
: Auth().data().contactsLoaded().current()
|
||||||
const auto loaded = Auth().data().contactsLoaded().current();
|
? tr::lng_contacts_not_found(tr::now)
|
||||||
setDescriptionText(lang(loaded ? lng_contacts_not_found : lng_contacts_loading));
|
: tr::lng_contacts_loading(tr::now));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<PeerListRow> ContactsBoxController::createSearchRow(
|
std::unique_ptr<PeerListRow> ContactsBoxController::createSearchRow(
|
||||||
|
@ -432,7 +431,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
|
||||||
if (const auto megagroup = chat->asMegagroup()) {
|
if (const auto megagroup = chat->asMegagroup()) {
|
||||||
if (!megagroup->canAddMembers()) {
|
if (!megagroup->canAddMembers()) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_error_cant_add_member)),
|
Box<InformBox>(tr::lng_error_cant_add_member(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -481,15 +480,19 @@ bool AddBotToGroupBoxController::sharingBotGame() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddBotToGroupBoxController::emptyBoxText() const {
|
QString AddBotToGroupBoxController::emptyBoxText() const {
|
||||||
return lang(Auth().data().chatsListLoaded()
|
return !Auth().data().chatsListLoaded()
|
||||||
? (sharingBotGame() ? lng_bot_no_chats : lng_bot_no_groups)
|
? tr::lng_contacts_loading(tr::now)
|
||||||
: lng_contacts_loading);
|
: sharingBotGame()
|
||||||
|
? tr::lng_bot_no_chats(tr::now)
|
||||||
|
: tr::lng_bot_no_groups(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddBotToGroupBoxController::noResultsText() const {
|
QString AddBotToGroupBoxController::noResultsText() const {
|
||||||
return lang(Auth().data().chatsListLoaded()
|
return !Auth().data().chatsListLoaded()
|
||||||
? (sharingBotGame() ? lng_bot_chats_not_found : lng_bot_groups_not_found)
|
? tr::lng_contacts_loading(tr::now)
|
||||||
: lng_contacts_loading);
|
: sharingBotGame()
|
||||||
|
? tr::lng_bot_chats_not_found(tr::now)
|
||||||
|
: tr::lng_bot_groups_not_found(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddBotToGroupBoxController::updateLabels() {
|
void AddBotToGroupBoxController::updateLabels() {
|
||||||
|
|
|
@ -91,7 +91,7 @@ void AddParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) {
|
||||||
} else if (count >= Global::ChatSizeMax()
|
} else if (count >= Global::ChatSizeMax()
|
||||||
&& count < Global::MegagroupSizeMax()) {
|
&& count < Global::MegagroupSizeMax()) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_profile_add_more_after_create)),
|
Box<InformBox>(tr::lng_profile_add_more_after_create(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,8 +299,8 @@ void AddSpecialBoxController::prepare() {
|
||||||
Unexpected("Role in AddSpecialBoxController::prepare()");
|
Unexpected("Role in AddSpecialBoxController::prepare()");
|
||||||
}();
|
}();
|
||||||
delegate()->peerListSetTitle(std::move(title));
|
delegate()->peerListSetTitle(std::move(title));
|
||||||
setDescriptionText(lang(lng_contacts_loading));
|
setDescriptionText(tr::lng_contacts_loading(tr::now));
|
||||||
setSearchNoResultsText(lang(lng_blocked_list_not_found));
|
setSearchNoResultsText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
|
|
||||||
if (const auto chat = _peer->asChat()) {
|
if (const auto chat = _peer->asChat()) {
|
||||||
prepareChatRows(chat);
|
prepareChatRows(chat);
|
||||||
|
@ -409,7 +409,7 @@ void AddSpecialBoxController::loadMoreRows() {
|
||||||
if (delegate()->peerListFullRowsCount() > 0) {
|
if (delegate()->peerListFullRowsCount() > 0) {
|
||||||
setDescriptionText(QString());
|
setDescriptionText(QString());
|
||||||
} else if (_allLoaded) {
|
} else if (_allLoaded) {
|
||||||
setDescriptionText(lang(lng_blocked_list_not_found));
|
setDescriptionText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
}
|
}
|
||||||
delegate()->peerListRefreshRows();
|
delegate()->peerListRefreshRows();
|
||||||
}).fail([this](const RPCError &error) {
|
}).fail([this](const RPCError &error) {
|
||||||
|
@ -488,20 +488,20 @@ void AddSpecialBoxController::showAdmin(
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_sure_add_admin_unremove),
|
tr::lng_sure_add_admin_unremove(tr::now),
|
||||||
showAdminSure),
|
showAdminSure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(
|
Ui::show(Box<InformBox>(
|
||||||
lang(lng_error_cant_add_admin_unban)),
|
tr::lng_error_cant_add_admin_unban(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(
|
Ui::show(Box<InformBox>(
|
||||||
lang(lng_error_cant_add_admin_invite)),
|
tr::lng_error_cant_add_admin_invite(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -511,14 +511,14 @@ void AddSpecialBoxController::showAdmin(
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_sure_add_admin_unremove),
|
tr::lng_sure_add_admin_unremove(tr::now),
|
||||||
showAdminSure),
|
showAdminSure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(
|
Ui::show(Box<InformBox>(
|
||||||
lang(lng_error_cant_add_admin_unban)),
|
tr::lng_error_cant_add_admin_unban(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -526,10 +526,9 @@ void AddSpecialBoxController::showAdmin(
|
||||||
// The user is not in the group yet.
|
// The user is not in the group yet.
|
||||||
if (canAddMembers) {
|
if (canAddMembers) {
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
const auto text = lang(
|
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
||||||
((_peer->isChat() || _peer->isMegagroup())
|
? tr::lng_sure_add_admin_invite
|
||||||
? lng_sure_add_admin_invite
|
: tr::lng_sure_add_admin_invite_channel)(tr::now);
|
||||||
: lng_sure_add_admin_invite_channel));
|
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
|
@ -539,7 +538,7 @@ void AddSpecialBoxController::showAdmin(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_error_cant_add_admin_invite)),
|
Box<InformBox>(tr::lng_error_cant_add_admin_invite(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -626,14 +625,14 @@ void AddSpecialBoxController::showRestricted(
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_sure_ban_admin),
|
tr::lng_sure_ban_admin(tr::now),
|
||||||
showRestrictedSure),
|
showRestrictedSure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_error_cant_ban_admin)),
|
Box<InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -716,14 +715,14 @@ void AddSpecialBoxController::kickUser(
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_sure_ban_admin),
|
tr::lng_sure_ban_admin(tr::now),
|
||||||
kickUserSure),
|
kickUserSure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_error_cant_ban_admin)),
|
Box<InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,7 +231,7 @@ void Controller::setupSharePhoneNumber() {
|
||||||
_sharePhone = _box->addRow(
|
_sharePhone = _box->addRow(
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
_box,
|
_box,
|
||||||
lang(lng_contact_share_phone),
|
tr::lng_contact_share_phone(tr::now),
|
||||||
true,
|
true,
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::addContactWarningMargin);
|
st::addContactWarningMargin);
|
||||||
|
|
|
@ -81,7 +81,7 @@ void Controller::prepare() {
|
||||||
auto row = std::make_unique<PeerListRow>(chat);
|
auto row = std::make_unique<PeerListRow>(chat);
|
||||||
const auto username = chat->userName();
|
const auto username = chat->userName();
|
||||||
row->setCustomStatus(username.isEmpty()
|
row->setCustomStatus(username.isEmpty()
|
||||||
? lang(lng_manage_discussion_group_private_status)
|
? tr::lng_manage_discussion_group_private_status(tr::now)
|
||||||
: ('@' + username));
|
: ('@' + username));
|
||||||
delegate()->peerListAppendRow(std::move(row));
|
delegate()->peerListAppendRow(std::move(row));
|
||||||
};
|
};
|
||||||
|
@ -148,7 +148,7 @@ void Controller::choose(not_null<ChannelData*> chat) {
|
||||||
*box = Ui::show(
|
*box = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_manage_discussion_group_link),
|
tr::lng_manage_discussion_group_link(tr::now),
|
||||||
sure),
|
sure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ void Controller::choose(not_null<ChatData*> chat) {
|
||||||
*box = Ui::show(
|
*box = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_manage_discussion_group_link),
|
tr::lng_manage_discussion_group_link(tr::now),
|
||||||
sure),
|
sure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -222,9 +222,9 @@ object_ptr<Ui::RpWidget> SetupFooter(
|
||||||
not_null<ChannelData*> channel) {
|
not_null<ChannelData*> channel) {
|
||||||
return object_ptr<Ui::FlatLabel>(
|
return object_ptr<Ui::FlatLabel>(
|
||||||
parent,
|
parent,
|
||||||
lang(channel->isBroadcast()
|
(channel->isBroadcast()
|
||||||
? lng_manage_discussion_group_posted
|
? tr::lng_manage_discussion_group_posted
|
||||||
: lng_manage_linked_channel_posted),
|
: tr::lng_manage_linked_channel_posted)(),
|
||||||
st::linkedChatAbout);
|
st::linkedChatAbout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,9 +199,9 @@ void EditParticipantBox::Inner::paintEvent(QPaintEvent *e) {
|
||||||
if (_user->botInfo) {
|
if (_user->botInfo) {
|
||||||
const auto seesAllMessages = _user->botInfo->readsAllHistory
|
const auto seesAllMessages = _user->botInfo->readsAllHistory
|
||||||
|| _hasAdminRights;
|
|| _hasAdminRights;
|
||||||
return lang(seesAllMessages
|
return (seesAllMessages
|
||||||
? lng_status_bot_reads_all
|
? tr::lng_status_bot_reads_all
|
||||||
: lng_status_bot_not_reads_all);
|
: tr::lng_status_bot_not_reads_all)(tr::now);
|
||||||
}
|
}
|
||||||
return Data::OnlineText(_user->onlineTill, unixtime());
|
return Data::OnlineText(_user->onlineTill, unixtime());
|
||||||
};
|
};
|
||||||
|
@ -305,16 +305,16 @@ void EditAdminBox::prepare() {
|
||||||
if (!canSave()) {
|
if (!canSave()) {
|
||||||
result.emplace(
|
result.emplace(
|
||||||
~Flags(0),
|
~Flags(0),
|
||||||
lang(lng_rights_about_admin_cant_edit));
|
tr::lng_rights_about_admin_cant_edit(tr::now));
|
||||||
} else {
|
} else {
|
||||||
result.emplace(
|
result.emplace(
|
||||||
disabledByDefaults,
|
disabledByDefaults,
|
||||||
lang(lng_rights_permission_for_all));
|
tr::lng_rights_permission_for_all(tr::now));
|
||||||
if (const auto channel = peer()->asChannel()) {
|
if (const auto channel = peer()->asChannel()) {
|
||||||
if (!channel->amCreator()) {
|
if (!channel->amCreator()) {
|
||||||
result.emplace(
|
result.emplace(
|
||||||
~channel->adminRights(),
|
~channel->adminRights(),
|
||||||
lang(lng_rights_permission_cant_edit));
|
tr::lng_rights_permission_cant_edit(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ void EditAdminBox::transferOwnership() {
|
||||||
lt_user,
|
lt_user,
|
||||||
Ui::Text::Bold(user()->shortName()),
|
Ui::Text::Bold(user()->shortName()),
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
lang(lng_rights_transfer_sure),
|
tr::lng_rights_transfer_sure(tr::now),
|
||||||
crl::guard(this, [=] { transferOwnershipChecked(); })));
|
crl::guard(this, [=] { transferOwnershipChecked(); })));
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -492,7 +492,7 @@ void EditAdminBox::requestTransferPassword(not_null<ChannelData*> channel) {
|
||||||
auto fields = PasscodeBox::CloudFields::From(state);
|
auto fields = PasscodeBox::CloudFields::From(state);
|
||||||
fields.customTitle = tr::lng_rights_transfer_password_title();
|
fields.customTitle = tr::lng_rights_transfer_password_title();
|
||||||
fields.customDescription
|
fields.customDescription
|
||||||
= lang(lng_rights_transfer_password_description);
|
= tr::lng_rights_transfer_password_description(tr::now);
|
||||||
fields.customSubmitButton = tr::lng_passcode_submit();
|
fields.customSubmitButton = tr::lng_passcode_submit();
|
||||||
fields.customCheckCallback = crl::guard(this, [=](
|
fields.customCheckCallback = crl::guard(this, [=](
|
||||||
const Core::CloudPasswordResult &result) {
|
const Core::CloudPasswordResult &result) {
|
||||||
|
@ -533,15 +533,15 @@ void EditAdminBox::sendTransferRequestFrom(
|
||||||
const auto &type = error.type();
|
const auto &type = error.type();
|
||||||
const auto problem = [&] {
|
const auto problem = [&] {
|
||||||
if (type == qstr("CHANNELS_ADMIN_PUBLIC_TOO_MUCH")) {
|
if (type == qstr("CHANNELS_ADMIN_PUBLIC_TOO_MUCH")) {
|
||||||
return lang(lng_channels_too_much_public_other);
|
return tr::lng_channels_too_much_public_other(tr::now);
|
||||||
} else if (type == qstr("ADMINS_TOO_MUCH")) {
|
} else if (type == qstr("ADMINS_TOO_MUCH")) {
|
||||||
return lang(channel->isBroadcast()
|
return (channel->isBroadcast()
|
||||||
? lng_error_admin_limit_channel
|
? tr::lng_error_admin_limit_channel
|
||||||
: lng_error_admin_limit);
|
: tr::lng_error_admin_limit)(tr::now);
|
||||||
} else if (type == qstr("CHANNEL_INVALID")) {
|
} else if (type == qstr("CHANNEL_INVALID")) {
|
||||||
return lang(channel->isBroadcast()
|
return (channel->isBroadcast()
|
||||||
? lng_channel_not_accessible
|
? tr::lng_channel_not_accessible
|
||||||
: lng_group_not_accessible);
|
: tr::lng_group_not_accessible)(tr::now);
|
||||||
}
|
}
|
||||||
return Lang::Hard::ServerError();
|
return Lang::Hard::ServerError();
|
||||||
}();
|
}();
|
||||||
|
@ -565,11 +565,11 @@ void EditAdminBox::sendTransferRequestFrom(
|
||||||
void EditAdminBox::refreshAboutAddAdminsText(bool canAddAdmins) {
|
void EditAdminBox::refreshAboutAddAdminsText(bool canAddAdmins) {
|
||||||
_aboutAddAdmins->setText([&] {
|
_aboutAddAdmins->setText([&] {
|
||||||
if (!canSave()) {
|
if (!canSave()) {
|
||||||
return lang(lng_rights_about_admin_cant_edit);
|
return tr::lng_rights_about_admin_cant_edit(tr::now);
|
||||||
} else if (canAddAdmins) {
|
} else if (canAddAdmins) {
|
||||||
return lang(lng_rights_about_add_admins_yes);
|
return tr::lng_rights_about_add_admins_yes(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_rights_about_add_admins_no);
|
return tr::lng_rights_about_add_admins_no(tr::now);
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ void EditRestrictedBox::prepare() {
|
||||||
if (!canSave()) {
|
if (!canSave()) {
|
||||||
result.emplace(
|
result.emplace(
|
||||||
~Flags(0),
|
~Flags(0),
|
||||||
lang(lng_rights_about_restriction_cant_edit));
|
tr::lng_rights_about_restriction_cant_edit(tr::now));
|
||||||
} else {
|
} else {
|
||||||
const auto disabled = FixDependentRestrictions(
|
const auto disabled = FixDependentRestrictions(
|
||||||
defaultRestrictions
|
defaultRestrictions
|
||||||
|
@ -620,7 +620,7 @@ void EditRestrictedBox::prepare() {
|
||||||
: Flags(0)));
|
: Flags(0)));
|
||||||
result.emplace(
|
result.emplace(
|
||||||
disabled,
|
disabled,
|
||||||
lang(lng_rights_restriction_for_all));
|
tr::lng_rights_restriction_for_all(tr::now));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}();
|
}();
|
||||||
|
@ -637,7 +637,7 @@ void EditRestrictedBox::prepare() {
|
||||||
addControl(
|
addControl(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_rights_chat_banned_until_header),
|
tr::lng_rights_chat_banned_until_header(tr::now),
|
||||||
st::rightsHeaderLabel),
|
st::rightsHeaderLabel),
|
||||||
st::rightsHeaderMargin);
|
st::rightsHeaderMargin);
|
||||||
setRestrictUntil(_until);
|
setRestrictUntil(_until);
|
||||||
|
@ -645,7 +645,7 @@ void EditRestrictedBox::prepare() {
|
||||||
//addControl(
|
//addControl(
|
||||||
// object_ptr<Ui::LinkButton>(
|
// object_ptr<Ui::LinkButton>(
|
||||||
// this,
|
// this,
|
||||||
// lang(lng_rights_chat_banned_block),
|
// tr::lng_rights_chat_banned_block(tr::now),
|
||||||
// st::boxLinkButton));
|
// st::boxLinkButton));
|
||||||
|
|
||||||
if (canSave()) {
|
if (canSave()) {
|
||||||
|
@ -759,7 +759,7 @@ void EditRestrictedBox::createUntilVariants() {
|
||||||
addCustomVariant(oldUntil, from, to);
|
addCustomVariant(oldUntil, from, to);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
addVariant(0, lang(lng_rights_chat_banned_forever));
|
addVariant(0, tr::lng_rights_chat_banned_forever(tr::now));
|
||||||
|
|
||||||
auto now = unixtime();
|
auto now = unixtime();
|
||||||
auto nextDay = now + kSecondsInDay;
|
auto nextDay = now + kSecondsInDay;
|
||||||
|
@ -769,7 +769,7 @@ void EditRestrictedBox::createUntilVariants() {
|
||||||
addCurrentVariant(nextDay, nextWeek);
|
addCurrentVariant(nextDay, nextWeek);
|
||||||
addVariant(kUntilOneWeek, lng_rights_chat_banned_week(lt_count, 1));
|
addVariant(kUntilOneWeek, lng_rights_chat_banned_week(lt_count, 1));
|
||||||
addCurrentVariant(nextWeek, INT_MAX);
|
addCurrentVariant(nextWeek, INT_MAX);
|
||||||
addVariant(kUntilCustom, lang(lng_rights_chat_banned_custom));
|
addVariant(kUntilCustom, tr::lng_rights_chat_banned_custom(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeId EditRestrictedBox::getRealUntilValue() const {
|
TimeId EditRestrictedBox::getRealUntilValue() const {
|
||||||
|
|
|
@ -1024,8 +1024,8 @@ void ParticipantsBoxController::prepare() {
|
||||||
}();
|
}();
|
||||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||||
delegate()->peerListSetTitle(std::move(title));
|
delegate()->peerListSetTitle(std::move(title));
|
||||||
setDescriptionText(lang(lng_contacts_loading));
|
setDescriptionText(tr::lng_contacts_loading(tr::now));
|
||||||
setSearchNoResultsText(lang(lng_blocked_list_not_found));
|
setSearchNoResultsText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
|
|
||||||
if (const auto chat = _peer->asChat()) {
|
if (const auto chat = _peer->asChat()) {
|
||||||
prepareChatRows(chat);
|
prepareChatRows(chat);
|
||||||
|
@ -1268,12 +1268,12 @@ void ParticipantsBoxController::loadMoreRows() {
|
||||||
|
|
||||||
void ParticipantsBoxController::refreshDescription() {
|
void ParticipantsBoxController::refreshDescription() {
|
||||||
setDescriptionText((_role == Role::Kicked)
|
setDescriptionText((_role == Role::Kicked)
|
||||||
? lang((_peer->isChat() || _peer->isMegagroup())
|
? ((_peer->isChat() || _peer->isMegagroup())
|
||||||
? lng_group_removed_list_about
|
? tr::lng_group_removed_list_about
|
||||||
: lng_channel_removed_list_about)
|
: tr::lng_channel_removed_list_about)(tr::now)
|
||||||
: (delegate()->peerListFullRowsCount() > 0)
|
: (delegate()->peerListFullRowsCount() > 0)
|
||||||
? QString()
|
? QString()
|
||||||
: lang(lng_blocked_list_not_found));
|
: tr::lng_blocked_list_not_found(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantsBoxController::feedMegagroupLastParticipants() {
|
bool ParticipantsBoxController::feedMegagroupLastParticipants() {
|
||||||
|
@ -1357,18 +1357,18 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||||
const auto user = row->peer()->asUser();
|
const auto user = row->peer()->asUser();
|
||||||
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(lng_context_view_profile),
|
tr::lng_context_view_profile(tr::now),
|
||||||
crl::guard(this, [=] { _navigation->showPeerInfo(user); }));
|
crl::guard(this, [=] { _navigation->showPeerInfo(user); }));
|
||||||
if (_role == Role::Kicked) {
|
if (_role == Role::Kicked) {
|
||||||
if (_peer->isMegagroup()
|
if (_peer->isMegagroup()
|
||||||
&& _additional.canRestrictUser(user)) {
|
&& _additional.canRestrictUser(user)) {
|
||||||
if (channel->canAddMembers()) {
|
if (channel->canAddMembers()) {
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(lng_context_add_to_group),
|
tr::lng_context_add_to_group(tr::now),
|
||||||
crl::guard(this, [=] { unkickMember(user); }));
|
crl::guard(this, [=] { unkickMember(user); }));
|
||||||
}
|
}
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(lng_profile_delete_removed),
|
tr::lng_profile_delete_removed(tr::now),
|
||||||
crl::guard(this, [=] { removeKickedWithRow(user); }));
|
crl::guard(this, [=] { removeKickedWithRow(user); }));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -1376,11 +1376,10 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||||
if (_additional.canAddOrEditAdmin(user)) {
|
if (_additional.canAddOrEditAdmin(user)) {
|
||||||
const auto isAdmin = _additional.isCreator(user)
|
const auto isAdmin = _additional.isCreator(user)
|
||||||
|| _additional.adminRights(user).has_value();
|
|| _additional.adminRights(user).has_value();
|
||||||
const auto labelKey = isAdmin
|
|
||||||
? lng_context_edit_permissions
|
|
||||||
: lng_context_promote_admin;
|
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(labelKey),
|
(isAdmin
|
||||||
|
? tr::lng_context_edit_permissions
|
||||||
|
: tr::lng_context_promote_admin)(tr::now),
|
||||||
crl::guard(this, [=] { showAdmin(user); }));
|
crl::guard(this, [=] { showAdmin(user); }));
|
||||||
}
|
}
|
||||||
if (_additional.canRestrictUser(user)) {
|
if (_additional.canRestrictUser(user)) {
|
||||||
|
@ -1392,15 +1391,15 @@ base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
|
||||||
}();
|
}();
|
||||||
if (canRestrictWithoutKick) {
|
if (canRestrictWithoutKick) {
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(lng_context_restrict_user),
|
tr::lng_context_restrict_user(tr::now),
|
||||||
crl::guard(this, [=] { showRestricted(user); }));
|
crl::guard(this, [=] { showRestricted(user); }));
|
||||||
}
|
}
|
||||||
if (!_additional.isKicked(user)) {
|
if (!_additional.isKicked(user)) {
|
||||||
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
const auto isGroup = _peer->isChat() || _peer->isMegagroup();
|
||||||
result->addAction(
|
result->addAction(
|
||||||
lang(isGroup
|
(isGroup
|
||||||
? lng_context_remove_from_group
|
? tr::lng_context_remove_from_group
|
||||||
: lng_profile_kick),
|
: tr::lng_profile_kick)(tr::now),
|
||||||
crl::guard(this, [=] { kickMember(user); }));
|
crl::guard(this, [=] { kickMember(user); }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1559,7 @@ void ParticipantsBoxController::kickMember(not_null<UserData*> user) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_box_remove),
|
tr::lng_box_remove(tr::now),
|
||||||
crl::guard(this, [=] { kickMemberSure(user); })),
|
crl::guard(this, [=] { kickMemberSure(user); })),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -1602,7 +1601,7 @@ void ParticipantsBoxController::removeAdmin(not_null<UserData*> user) {
|
||||||
lng_profile_sure_remove_admin(
|
lng_profile_sure_remove_admin(
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName),
|
user->firstName),
|
||||||
lang(lng_box_remove),
|
tr::lng_box_remove(tr::now),
|
||||||
crl::guard(this, [=] { removeAdminSure(user); })),
|
crl::guard(this, [=] { removeAdminSure(user); })),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -1645,7 +1644,7 @@ void ParticipantsBoxController::removeKicked(
|
||||||
delegate()->peerListRemoveRow(row);
|
delegate()->peerListRemoveRow(row);
|
||||||
if (_role != Role::Kicked
|
if (_role != Role::Kicked
|
||||||
&& !delegate()->peerListFullRowsCount()) {
|
&& !delegate()->peerListFullRowsCount()) {
|
||||||
setDescriptionText(lang(lng_blocked_list_not_found));
|
setDescriptionText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
}
|
}
|
||||||
delegate()->peerListRefreshRows();
|
delegate()->peerListRefreshRows();
|
||||||
removeKicked(user);
|
removeKicked(user);
|
||||||
|
@ -1684,14 +1683,14 @@ bool ParticipantsBoxController::removeRow(not_null<UserData*> user) {
|
||||||
if (auto row = delegate()->peerListFindRow(user->id)) {
|
if (auto row = delegate()->peerListFindRow(user->id)) {
|
||||||
if (_role == Role::Admins) {
|
if (_role == Role::Admins) {
|
||||||
// Perhaps we are removing an admin from search results.
|
// Perhaps we are removing an admin from search results.
|
||||||
row->setCustomStatus(lang(lng_channel_admin_status_not_admin));
|
row->setCustomStatus(tr::lng_channel_admin_status_not_admin(tr::now));
|
||||||
delegate()->peerListConvertRowToSearchResult(row);
|
delegate()->peerListConvertRowToSearchResult(row);
|
||||||
} else {
|
} else {
|
||||||
delegate()->peerListRemoveRow(row);
|
delegate()->peerListRemoveRow(row);
|
||||||
}
|
}
|
||||||
if (_role != Role::Kicked
|
if (_role != Role::Kicked
|
||||||
&& !delegate()->peerListFullRowsCount()) {
|
&& !delegate()->peerListFullRowsCount()) {
|
||||||
setDescriptionText(lang(lng_blocked_list_not_found));
|
setDescriptionText(tr::lng_blocked_list_not_found(tr::now));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1710,17 +1709,17 @@ std::unique_ptr<PeerListRow> ParticipantsBoxController::createRow(
|
||||||
if (_role == Role::Admins
|
if (_role == Role::Admins
|
||||||
&& _additional.adminRights(user).has_value()
|
&& _additional.adminRights(user).has_value()
|
||||||
&& _additional.canEditAdmin(user)) {
|
&& _additional.canEditAdmin(user)) {
|
||||||
row->setActionLink(lang(lng_profile_kick));
|
row->setActionLink(tr::lng_profile_kick(tr::now));
|
||||||
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
||||||
if (_additional.canRestrictUser(user)) {
|
if (_additional.canRestrictUser(user)) {
|
||||||
row->setActionLink(lang(lng_profile_delete_removed));
|
row->setActionLink(tr::lng_profile_delete_removed(tr::now));
|
||||||
}
|
}
|
||||||
} else if (_role == Role::Members) {
|
} else if (_role == Role::Members) {
|
||||||
if ((chat ? chat->canBanMembers() : channel->canBanMembers())
|
if ((chat ? chat->canBanMembers() : channel->canBanMembers())
|
||||||
&& !_additional.isCreator(user)
|
&& !_additional.isCreator(user)
|
||||||
&& (!_additional.adminRights(user)
|
&& (!_additional.adminRights(user)
|
||||||
|| _additional.canEditAdmin(user))) {
|
|| _additional.canEditAdmin(user))) {
|
||||||
row->setActionLink(lang(lng_profile_kick));
|
row->setActionLink(tr::lng_profile_kick(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return std::move(row);
|
return std::move(row);
|
||||||
|
@ -1759,10 +1758,10 @@ void ParticipantsBoxController::refreshCustomStatus(
|
||||||
} else {
|
} else {
|
||||||
if (_additional.isCreator(user)) {
|
if (_additional.isCreator(user)) {
|
||||||
row->setCustomStatus(
|
row->setCustomStatus(
|
||||||
lang(lng_channel_admin_status_creator));
|
tr::lng_channel_admin_status_creator(tr::now));
|
||||||
} else {
|
} else {
|
||||||
row->setCustomStatus(
|
row->setCustomStatus(
|
||||||
lang(lng_channel_admin_status_not_admin));
|
tr::lng_channel_admin_status_not_admin(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
||||||
|
|
|
@ -1296,16 +1296,16 @@ void Controller::deleteWithConfirmation() {
|
||||||
const auto channel = _peer->asChannel();
|
const auto channel = _peer->asChannel();
|
||||||
Assert(channel != nullptr);
|
Assert(channel != nullptr);
|
||||||
|
|
||||||
const auto text = lang(_isGroup
|
const auto text = (_isGroup
|
||||||
? lng_sure_delete_group
|
? tr::lng_sure_delete_group
|
||||||
: lng_sure_delete_channel);
|
: tr::lng_sure_delete_channel)(tr::now);
|
||||||
const auto deleteCallback = crl::guard(this, [=] {
|
const auto deleteCallback = crl::guard(this, [=] {
|
||||||
deleteChannel();
|
deleteChannel();
|
||||||
});
|
});
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_box_delete),
|
tr::lng_box_delete(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
deleteCallback),
|
deleteCallback),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
|
|
@ -79,51 +79,51 @@ void ApplyDependencies(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<ChatRestrictions, LangKey>> RestrictionLabels() {
|
std::vector<std::pair<ChatRestrictions, QString>> RestrictionLabels() {
|
||||||
const auto langKeys = {
|
const auto langKeys = {
|
||||||
lng_rights_chat_send_text,
|
tr::lng_rights_chat_send_text,
|
||||||
lng_rights_chat_send_media,
|
tr::lng_rights_chat_send_media,
|
||||||
lng_rights_chat_send_stickers,
|
tr::lng_rights_chat_send_stickers,
|
||||||
lng_rights_chat_send_links,
|
tr::lng_rights_chat_send_links,
|
||||||
lng_rights_chat_send_polls,
|
tr::lng_rights_chat_send_polls,
|
||||||
lng_rights_chat_add_members,
|
tr::lng_rights_chat_add_members,
|
||||||
lng_rights_group_pin,
|
tr::lng_rights_group_pin,
|
||||||
lng_rights_group_info,
|
tr::lng_rights_group_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<std::pair<ChatRestrictions, LangKey>> vector;
|
std::vector<std::pair<ChatRestrictions, QString>> vector;
|
||||||
const auto restrictions = Data::ListOfRestrictions();
|
const auto restrictions = Data::ListOfRestrictions();
|
||||||
auto i = 0;
|
auto i = 0;
|
||||||
for (const auto key : langKeys) {
|
for (const auto &key : langKeys) {
|
||||||
vector.emplace_back(restrictions[i++], key);
|
vector.emplace_back(restrictions[i++], key(tr::now));
|
||||||
}
|
}
|
||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<ChatAdminRights, LangKey>> AdminRightLabels(
|
std::vector<std::pair<ChatAdminRights, QString>> AdminRightLabels(
|
||||||
bool isGroup,
|
bool isGroup,
|
||||||
bool anyoneCanAddMembers) {
|
bool anyoneCanAddMembers) {
|
||||||
using Flag = ChatAdminRight;
|
using Flag = ChatAdminRight;
|
||||||
|
|
||||||
if (isGroup) {
|
if (isGroup) {
|
||||||
return {
|
return {
|
||||||
{ Flag::f_change_info, lng_rights_group_info },
|
{ Flag::f_change_info, tr::lng_rights_group_info(tr::now) },
|
||||||
{ Flag::f_delete_messages, lng_rights_group_delete },
|
{ Flag::f_delete_messages, tr::lng_rights_group_delete(tr::now) },
|
||||||
{ Flag::f_ban_users, lng_rights_group_ban },
|
{ Flag::f_ban_users, tr::lng_rights_group_ban(tr::now) },
|
||||||
{ Flag::f_invite_users, anyoneCanAddMembers
|
{ Flag::f_invite_users, anyoneCanAddMembers
|
||||||
? lng_rights_group_invite_link
|
? tr::lng_rights_group_invite_link(tr::now)
|
||||||
: lng_rights_group_invite },
|
: tr::lng_rights_group_invite(tr::now) },
|
||||||
{ Flag::f_pin_messages, lng_rights_group_pin },
|
{ Flag::f_pin_messages, tr::lng_rights_group_pin(tr::now) },
|
||||||
{ Flag::f_add_admins, lng_rights_add_admins },
|
{ Flag::f_add_admins, tr::lng_rights_add_admins(tr::now) },
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
{ Flag::f_change_info, lng_rights_channel_info },
|
{ Flag::f_change_info, tr::lng_rights_channel_info(tr::now) },
|
||||||
{ Flag::f_post_messages, lng_rights_channel_post },
|
{ Flag::f_post_messages, tr::lng_rights_channel_post(tr::now) },
|
||||||
{ Flag::f_edit_messages, lng_rights_channel_edit },
|
{ Flag::f_edit_messages, tr::lng_rights_channel_edit(tr::now) },
|
||||||
{ Flag::f_delete_messages, lng_rights_channel_delete },
|
{ Flag::f_delete_messages, tr::lng_rights_channel_delete(tr::now) },
|
||||||
{ Flag::f_invite_users, lng_rights_group_invite },
|
{ Flag::f_invite_users, tr::lng_rights_group_invite(tr::now) },
|
||||||
{ Flag::f_add_admins, lng_rights_add_admins }
|
{ Flag::f_add_admins, tr::lng_rights_add_admins(tr::now) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -323,12 +323,12 @@ void EditPeerPermissionsBox::prepare() {
|
||||||
auto result = std::map<Flags, QString>();
|
auto result = std::map<Flags, QString>();
|
||||||
result.emplace(
|
result.emplace(
|
||||||
disabledByAdminRights,
|
disabledByAdminRights,
|
||||||
lang(lng_rights_permission_cant_edit));
|
tr::lng_rights_permission_cant_edit(tr::now));
|
||||||
if (const auto channel = _peer->asChannel()) {
|
if (const auto channel = _peer->asChannel()) {
|
||||||
if (channel->isPublic()) {
|
if (channel->isPublic()) {
|
||||||
result.emplace(
|
result.emplace(
|
||||||
Flag::f_change_info | Flag::f_pin_messages,
|
Flag::f_change_info | Flag::f_pin_messages,
|
||||||
lang(lng_rights_permission_unavailable));
|
tr::lng_rights_permission_unavailable(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -473,7 +473,7 @@ EditFlagsControl<Flags> CreateEditFlags(
|
||||||
checkboxes->emplace(flags, control);
|
checkboxes->emplace(flags, control);
|
||||||
};
|
};
|
||||||
for (const auto &[flags, label] : flagLabelPairs) {
|
for (const auto &[flags, label] : flagLabelPairs) {
|
||||||
addCheckbox(flags, lang(label));
|
addCheckbox(flags, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyDependencies(nullptr);
|
applyDependencies(nullptr);
|
||||||
|
|
|
@ -516,13 +516,13 @@ void Controller::showUsernameResult(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::createInviteLink() {
|
void Controller::createInviteLink() {
|
||||||
exportInviteLink(lang(_isGroup
|
exportInviteLink((_isGroup
|
||||||
? lng_group_invite_about
|
? tr::lng_group_invite_about
|
||||||
: lng_group_invite_about_channel));
|
: tr::lng_group_invite_about_channel)(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::revokeInviteLink() {
|
void Controller::revokeInviteLink() {
|
||||||
exportInviteLink(lang(lng_group_invite_about_new));
|
exportInviteLink(tr::lng_group_invite_about_new(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::exportInviteLink(const QString &confirmation) {
|
void Controller::exportInviteLink(const QString &confirmation) {
|
||||||
|
@ -595,7 +595,7 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkEdit() {
|
||||||
_controls.inviteLink->setBreakEverywhere(true);
|
_controls.inviteLink->setBreakEverywhere(true);
|
||||||
_controls.inviteLink->setClickHandlerFilter([=](auto&&...) {
|
_controls.inviteLink->setClickHandlerFilter([=](auto&&...) {
|
||||||
QApplication::clipboard()->setText(inviteLinkText());
|
QApplication::clipboard()->setText(inviteLinkText());
|
||||||
Ui::Toast::Show(lang(lng_group_invite_copied));
|
Ui::Toast::Show(tr::lng_group_invite_copied(tr::now));
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkEdit() {
|
||||||
st::editPeerInviteLinkSkip));
|
st::editPeerInviteLinkSkip));
|
||||||
container->add(object_ptr<Ui::LinkButton>(
|
container->add(object_ptr<Ui::LinkButton>(
|
||||||
container,
|
container,
|
||||||
lang(lng_group_invite_create_new),
|
tr::lng_group_invite_create_new(tr::now),
|
||||||
st::editPeerInviteLinkButton)
|
st::editPeerInviteLinkButton)
|
||||||
)->addClickHandler([=] { revokeInviteLink(); });
|
)->addClickHandler([=] { revokeInviteLink(); });
|
||||||
|
|
||||||
|
@ -663,7 +663,7 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkCreate() {
|
||||||
|
|
||||||
container->add(object_ptr<Ui::LinkButton>(
|
container->add(object_ptr<Ui::LinkButton>(
|
||||||
_wrap,
|
_wrap,
|
||||||
lang(lng_group_invite_create),
|
tr::lng_group_invite_create(tr::now),
|
||||||
st::editPeerInviteLinkButton)
|
st::editPeerInviteLinkButton)
|
||||||
)->addClickHandler([this] {
|
)->addClickHandler([this] {
|
||||||
createInviteLink();
|
createInviteLink();
|
||||||
|
|
|
@ -54,21 +54,21 @@ void ReportBox::prepare() {
|
||||||
const auto createButton = [&](
|
const auto createButton = [&](
|
||||||
object_ptr<Ui::Radioenum<Reason>> &button,
|
object_ptr<Ui::Radioenum<Reason>> &button,
|
||||||
Reason reason,
|
Reason reason,
|
||||||
LangKey key) {
|
const QString &text) {
|
||||||
button.create(
|
button.create(
|
||||||
this,
|
this,
|
||||||
_reasonGroup,
|
_reasonGroup,
|
||||||
reason,
|
reason,
|
||||||
lang(key),
|
text,
|
||||||
st::defaultBoxCheckbox);
|
st::defaultBoxCheckbox);
|
||||||
};
|
};
|
||||||
createButton(_reasonSpam, Reason::Spam, lng_report_reason_spam);
|
createButton(_reasonSpam, Reason::Spam, tr::lng_report_reason_spam(tr::now));
|
||||||
createButton(_reasonViolence, Reason::Violence, lng_report_reason_violence);
|
createButton(_reasonViolence, Reason::Violence, tr::lng_report_reason_violence(tr::now));
|
||||||
if (_ids) {
|
if (_ids) {
|
||||||
createButton(_reasonChildAbuse, Reason::ChildAbuse, lng_report_reason_child_abuse);
|
createButton(_reasonChildAbuse, Reason::ChildAbuse, tr::lng_report_reason_child_abuse(tr::now));
|
||||||
}
|
}
|
||||||
createButton(_reasonPornography, Reason::Pornography, lng_report_reason_pornography);
|
createButton(_reasonPornography, Reason::Pornography, tr::lng_report_reason_pornography(tr::now));
|
||||||
createButton(_reasonOther, Reason::Other, lng_report_reason_other);
|
createButton(_reasonOther, Reason::Other, tr::lng_report_reason_other(tr::now));
|
||||||
_reasonGroup->setChangedCallback([=](Reason value) {
|
_reasonGroup->setChangedCallback([=](Reason value) {
|
||||||
reasonChanged(value);
|
reasonChanged(value);
|
||||||
});
|
});
|
||||||
|
@ -173,7 +173,7 @@ void ReportBox::report() {
|
||||||
|
|
||||||
void ReportBox::reportDone(const MTPBool &result) {
|
void ReportBox::reportDone(const MTPBool &result) {
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
Ui::Toast::Show(lang(lng_report_thanks));
|
Ui::Toast::Show(tr::lng_report_thanks(tr::now));
|
||||||
closeBox();
|
closeBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ SelfDestructionBox::SelfDestructionBox(
|
||||||
: _ttlValues{ 30, 90, 180, 365 }
|
: _ttlValues{ 30, 90, 180, 365 }
|
||||||
, _loading(
|
, _loading(
|
||||||
this,
|
this,
|
||||||
lang(lng_contacts_loading),
|
tr::lng_contacts_loading(tr::now),
|
||||||
st::membersAbout) {
|
st::membersAbout) {
|
||||||
std::move(
|
std::move(
|
||||||
preloaded
|
preloaded
|
||||||
|
@ -53,7 +53,7 @@ void SelfDestructionBox::showContent() {
|
||||||
auto y = st::boxOptionListPadding.top();
|
auto y = st::boxOptionListPadding.top();
|
||||||
_description.create(
|
_description.create(
|
||||||
this,
|
this,
|
||||||
lang(lng_self_destruct_description),
|
tr::lng_self_destruct_description(tr::now),
|
||||||
st::boxLabel);
|
st::boxLabel);
|
||||||
_description->moveToLeft(st::boxPadding.left(), y);
|
_description->moveToLeft(st::boxPadding.left(), y);
|
||||||
y += _description->height() + st::boxMediumSkip;
|
y += _description->height() + st::boxMediumSkip;
|
||||||
|
@ -90,7 +90,7 @@ void SelfDestructionBox::prepare() {
|
||||||
|
|
||||||
auto fake = object_ptr<Ui::FlatLabel>(
|
auto fake = object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_self_destruct_description),
|
tr::lng_self_destruct_description(tr::now),
|
||||||
st::boxLabel);
|
st::boxLabel);
|
||||||
const auto boxHeight = st::boxOptionListPadding.top()
|
const auto boxHeight = st::boxOptionListPadding.top()
|
||||||
+ fake->height() + st::boxMediumSkip
|
+ fake->height() + st::boxMediumSkip
|
||||||
|
|
|
@ -1541,19 +1541,19 @@ void SendFilesBox::setupSendWayControls() {
|
||||||
button->show();
|
button->show();
|
||||||
};
|
};
|
||||||
if (_list.albumIsPossible) {
|
if (_list.albumIsPossible) {
|
||||||
addRadio(_sendAlbum, SendFilesWay::Album, lang(lng_send_album));
|
addRadio(_sendAlbum, SendFilesWay::Album, tr::lng_send_album(tr::now));
|
||||||
}
|
}
|
||||||
if (!_list.albumIsPossible || _albumPhotosCount > 0) {
|
if (!_list.albumIsPossible || _albumPhotosCount > 0) {
|
||||||
addRadio(_sendPhotos, SendFilesWay::Photos, (_list.files.size() == 1)
|
addRadio(_sendPhotos, SendFilesWay::Photos, (_list.files.size() == 1)
|
||||||
? lang(lng_send_photo)
|
? tr::lng_send_photo(tr::now)
|
||||||
: (_albumVideosCount > 0)
|
: (_albumVideosCount > 0)
|
||||||
? lang(lng_send_separate_photos_videos)
|
? tr::lng_send_separate_photos_videos(tr::now)
|
||||||
: (_list.albumIsPossible
|
: (_list.albumIsPossible
|
||||||
? lang(lng_send_separate_photos)
|
? tr::lng_send_separate_photos(tr::now)
|
||||||
: lng_send_photos(lt_count, _list.files.size())));
|
: lng_send_photos(lt_count, _list.files.size())));
|
||||||
}
|
}
|
||||||
addRadio(_sendFiles, SendFilesWay::Files, (_list.files.size() == 1)
|
addRadio(_sendFiles, SendFilesWay::Files, (_list.files.size() == 1)
|
||||||
? lang(lng_send_file)
|
? tr::lng_send_file(tr::now)
|
||||||
: lng_send_files(lt_count, _list.files.size()));
|
: lng_send_files(lt_count, _list.files.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ void SessionsBox::paintEvent(QPaintEvent *e) {
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(
|
p.drawText(
|
||||||
QRect(0, 0, width(), st::noContactsHeight),
|
QRect(0, 0, width(), st::noContactsHeight),
|
||||||
lang(lng_contacts_loading),
|
tr::lng_contacts_loading(tr::now),
|
||||||
style::al_center);
|
style::al_center);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,8 +226,8 @@ SessionsBox::Entry SessionsBox::ParseEntry(const MTPDauthorization &data) {
|
||||||
result.info = qs(data.vdevice_model) + qstr(", ") + (platform.isEmpty() ? QString() : platform + ' ') + qs(data.vsystem_version);
|
result.info = qs(data.vdevice_model) + qstr(", ") + (platform.isEmpty() ? QString() : platform + ' ') + qs(data.vsystem_version);
|
||||||
result.ip = qs(data.vip) + (country.isEmpty() ? QString() : QString::fromUtf8(" \xe2\x80\x93 ") + country);
|
result.ip = qs(data.vip) + (country.isEmpty() ? QString() : QString::fromUtf8(" \xe2\x80\x93 ") + country);
|
||||||
if (!result.hash) {
|
if (!result.hash) {
|
||||||
result.active = lang(lng_status_online);
|
result.active = tr::lng_status_online(tr::now);
|
||||||
result.activeWidth = st::sessionWhenFont->width(lang(lng_status_online));
|
result.activeWidth = st::sessionWhenFont->width(tr::lng_status_online(tr::now));
|
||||||
} else {
|
} else {
|
||||||
const auto now = QDateTime::currentDateTime();
|
const auto now = QDateTime::currentDateTime();
|
||||||
const auto lastTime = ParseDateTime(result.activeTime);
|
const auto lastTime = ParseDateTime(result.activeTime);
|
||||||
|
@ -315,8 +315,8 @@ void SessionsBox::terminateOne(uint64 hash) {
|
||||||
});
|
});
|
||||||
_terminateBox = Ui::show(
|
_terminateBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_settings_reset_one_sure),
|
tr::lng_settings_reset_one_sure(tr::now),
|
||||||
lang(lng_settings_reset_button),
|
tr::lng_settings_reset_button(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
callback),
|
callback),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
@ -341,8 +341,8 @@ void SessionsBox::terminateAll() {
|
||||||
});
|
});
|
||||||
_terminateBox = Ui::show(
|
_terminateBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_settings_reset_sure),
|
tr::lng_settings_reset_sure(tr::now),
|
||||||
lang(lng_settings_reset_button),
|
tr::lng_settings_reset_button(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
callback),
|
callback),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
|
|
@ -417,7 +417,7 @@ void ShareBox::addPeerToMultiSelect(PeerData *peer, bool skipAnimation) {
|
||||||
auto addItemWay = skipAnimation ? AddItemWay::SkipAnimation : AddItemWay::Default;
|
auto addItemWay = skipAnimation ? AddItemWay::SkipAnimation : AddItemWay::Default;
|
||||||
_select->addItem(
|
_select->addItem(
|
||||||
peer->id,
|
peer->id,
|
||||||
peer->isSelf() ? lang(lng_saved_short) : peer->shortName(),
|
peer->isSelf() ? tr::lng_saved_short(tr::now) : peer->shortName(),
|
||||||
st::activeButtonBg,
|
st::activeButtonBg,
|
||||||
PaintUserpicCallback(peer, true),
|
PaintUserpicCallback(peer, true),
|
||||||
addItemWay);
|
addItemWay);
|
||||||
|
@ -590,7 +590,7 @@ void ShareBox::Inner::updateChat(not_null<PeerData*> peer) {
|
||||||
void ShareBox::Inner::updateChatName(
|
void ShareBox::Inner::updateChatName(
|
||||||
not_null<Chat*> chat,
|
not_null<Chat*> chat,
|
||||||
not_null<PeerData*> peer) {
|
not_null<PeerData*> peer) {
|
||||||
const auto text = peer->isSelf() ? lang(lng_saved_messages) : peer->name;
|
const auto text = peer->isSelf() ? tr::lng_saved_messages(tr::now) : peer->name;
|
||||||
chat->name.setText(st::shareNameStyle, text, Ui::NameTextOptions());
|
chat->name.setText(st::shareNameStyle, text, Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,7 +791,7 @@ void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(
|
p.drawText(
|
||||||
rect().marginsRemoved(st::boxPadding),
|
rect().marginsRemoved(st::boxPadding),
|
||||||
lang(lng_bot_no_chats),
|
tr::lng_bot_no_chats(tr::now),
|
||||||
style::al_center);
|
style::al_center);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -802,7 +802,7 @@ void ShareBox::Inner::paintEvent(QPaintEvent *e) {
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(
|
p.drawText(
|
||||||
rect().marginsRemoved(st::boxPadding),
|
rect().marginsRemoved(st::boxPadding),
|
||||||
lang(lng_bot_chats_not_found),
|
tr::lng_bot_chats_not_found(tr::now),
|
||||||
style::al_center);
|
style::al_center);
|
||||||
} else {
|
} else {
|
||||||
auto filteredSize = _filtered.size();
|
auto filteredSize = _filtered.size();
|
||||||
|
@ -1081,7 +1081,7 @@ void ShareGameScoreByHash(const QString &hash) {
|
||||||
|
|
||||||
auto hashEncrypted = QByteArray::fromBase64(hash.toLatin1(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
auto hashEncrypted = QByteArray::fromBase64(hash.toLatin1(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||||
if (hashEncrypted.size() <= key128Size || (hashEncrypted.size() % 0x10) != 0) {
|
if (hashEncrypted.size() <= key128Size || (hashEncrypted.size() % 0x10) != 0) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_confirm_phone_link_invalid)));
|
Ui::show(Box<InformBox>(tr::lng_confirm_phone_link_invalid(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1101,20 +1101,20 @@ void ShareGameScoreByHash(const QString &hash) {
|
||||||
// Check next 64 bits of SHA1() of data.
|
// Check next 64 bits of SHA1() of data.
|
||||||
auto skipSha1Part = sizeof(channelAccessHash);
|
auto skipSha1Part = sizeof(channelAccessHash);
|
||||||
if (memcmp(dataSha1 + skipSha1Part, hashEncrypted.constData() + skipSha1Part, key128Size - skipSha1Part) != 0) {
|
if (memcmp(dataSha1 + skipSha1Part, hashEncrypted.constData() + skipSha1Part, key128Size - skipSha1Part) != 0) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_share_wrong_user)));
|
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto hashDataInts = reinterpret_cast<int32*>(hashData.data());
|
auto hashDataInts = reinterpret_cast<int32*>(hashData.data());
|
||||||
if (!AuthSession::Exists() || hashDataInts[0] != Auth().userId()) {
|
if (!AuthSession::Exists() || hashDataInts[0] != Auth().userId()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_share_wrong_user)));
|
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check first 32 bits of channel access hash.
|
// Check first 32 bits of channel access hash.
|
||||||
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
||||||
if (channelAccessHashInts[0] != hashDataInts[3]) {
|
if (channelAccessHashInts[0] != hashDataInts[3]) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_share_wrong_user)));
|
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1122,7 +1122,7 @@ void ShareGameScoreByHash(const QString &hash) {
|
||||||
auto msgId = hashDataInts[2];
|
auto msgId = hashDataInts[2];
|
||||||
if (!channelId && channelAccessHash) {
|
if (!channelId && channelAccessHash) {
|
||||||
// If there is no channel id, there should be no channel access_hash.
|
// If there is no channel id, there should be no channel access_hash.
|
||||||
Ui::show(Box<InformBox>(lang(lng_share_wrong_user)));
|
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1136,7 +1136,7 @@ void ShareGameScoreByHash(const QString &hash) {
|
||||||
if (const auto item = Auth().data().message(channel, msgId)) {
|
if (const auto item = Auth().data().message(channel, msgId)) {
|
||||||
FastShareMessage(item);
|
FastShareMessage(item);
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(lang(lng_edit_deleted)));
|
Ui::show(Box<InformBox>(tr::lng_edit_deleted(tr::now)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -145,7 +145,7 @@ void StickerSetBox::addStickers() {
|
||||||
void StickerSetBox::shareStickers() {
|
void StickerSetBox::shareStickers() {
|
||||||
auto url = Core::App().createInternalLinkFull(qsl("addstickers/") + _inner->shortName());
|
auto url = Core::App().createInternalLinkFull(qsl("addstickers/") + _inner->shortName());
|
||||||
QApplication::clipboard()->setText(url);
|
QApplication::clipboard()->setText(url);
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_copied)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_copied(tr::now)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void StickerSetBox::updateTitleAndButtons() {
|
void StickerSetBox::updateTitleAndButtons() {
|
||||||
|
@ -260,7 +260,7 @@ void StickerSetBox::Inner::gotSet(const MTPmessages_StickerSet &set) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (_pack.isEmpty()) {
|
if (_pack.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
int32 rows = _pack.size() / kStickersPanelPerRow + ((_pack.size() % kStickersPanelPerRow) ? 1 : 0);
|
int32 rows = _pack.size() / kStickersPanelPerRow + ((_pack.size() % kStickersPanelPerRow) ? 1 : 0);
|
||||||
|
@ -285,7 +285,7 @@ bool StickerSetBox::Inner::failedSet(const RPCError &error) {
|
||||||
|
|
||||||
_loaded = true;
|
_loaded = true;
|
||||||
|
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ void StickerSetBox::Inner::installDone(const MTPmessages_StickerSetInstallResult
|
||||||
bool StickerSetBox::Inner::installFail(const RPCError &error) {
|
bool StickerSetBox::Inner::installFail(const RPCError &error) {
|
||||||
if (MTP::isDefaultHandledError(error)) return false;
|
if (MTP::isDefaultHandledError(error)) return false;
|
||||||
|
|
||||||
Ui::show(Box<InformBox>(lang(lng_stickers_not_found)));
|
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -538,7 +538,7 @@ QString StickerSetBox::Inner::shortName() const {
|
||||||
void StickerSetBox::Inner::install() {
|
void StickerSetBox::Inner::install() {
|
||||||
if (isMasksSet()) {
|
if (isMasksSet()) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_stickers_masks_pack)),
|
Box<InformBox>(tr::lng_stickers_masks_pack(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,14 +341,14 @@ void StickersBox::refreshTabs() {
|
||||||
|
|
||||||
_tabIndices.clear();
|
_tabIndices.clear();
|
||||||
auto sections = QStringList();
|
auto sections = QStringList();
|
||||||
sections.push_back(lang(lng_stickers_installed_tab).toUpper());
|
sections.push_back(tr::lng_stickers_installed_tab(tr::now).toUpper());
|
||||||
_tabIndices.push_back(Section::Installed);
|
_tabIndices.push_back(Section::Installed);
|
||||||
if (!Auth().data().featuredStickerSetsOrder().isEmpty()) {
|
if (!Auth().data().featuredStickerSetsOrder().isEmpty()) {
|
||||||
sections.push_back(lang(lng_stickers_featured_tab).toUpper());
|
sections.push_back(tr::lng_stickers_featured_tab(tr::now).toUpper());
|
||||||
_tabIndices.push_back(Section::Featured);
|
_tabIndices.push_back(Section::Featured);
|
||||||
}
|
}
|
||||||
if (!Auth().data().archivedStickerSetsOrder().isEmpty()) {
|
if (!Auth().data().archivedStickerSetsOrder().isEmpty()) {
|
||||||
sections.push_back(lang(lng_stickers_archived_tab).toUpper());
|
sections.push_back(tr::lng_stickers_archived_tab(tr::now).toUpper());
|
||||||
_tabIndices.push_back(Section::Archived);
|
_tabIndices.push_back(Section::Archived);
|
||||||
}
|
}
|
||||||
_tabs->setSections(sections);
|
_tabs->setSections(sections);
|
||||||
|
@ -407,7 +407,7 @@ void StickersBox::updateTabsGeometry() {
|
||||||
|
|
||||||
auto featuredLeft = width() / 3;
|
auto featuredLeft = width() / 3;
|
||||||
auto featuredRight = 2 * width() / 3;
|
auto featuredRight = 2 * width() / 3;
|
||||||
auto featuredTextWidth = st::stickersTabs.labelFont->width(lang(lng_stickers_featured_tab).toUpper());
|
auto featuredTextWidth = st::stickersTabs.labelFont->width(tr::lng_stickers_featured_tab(tr::now).toUpper());
|
||||||
auto featuredTextRight = featuredLeft + (featuredRight - featuredLeft - featuredTextWidth) / 2 + featuredTextWidth;
|
auto featuredTextRight = featuredLeft + (featuredRight - featuredLeft - featuredTextWidth) / 2 + featuredTextWidth;
|
||||||
auto unreadBadgeLeft = featuredTextRight - st::stickersFeaturedBadgeSkip;
|
auto unreadBadgeLeft = featuredTextRight - st::stickersFeaturedBadgeSkip;
|
||||||
auto unreadBadgeTop = st::stickersFeaturedBadgeTop;
|
auto unreadBadgeTop = st::stickersFeaturedBadgeTop;
|
||||||
|
@ -661,9 +661,9 @@ StickersBox::Inner::Inner(QWidget *parent, StickersBox::Section section) : TWidg
|
||||||
return shiftingAnimationCallback(now);
|
return shiftingAnimationCallback(now);
|
||||||
})
|
})
|
||||||
, _itemsTop(st::membersMarginTop)
|
, _itemsTop(st::membersMarginTop)
|
||||||
, _addText(lang(lng_stickers_featured_add).toUpper())
|
, _addText(tr::lng_stickers_featured_add(tr::now).toUpper())
|
||||||
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
|
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
|
||||||
, _undoText(lang(lng_stickers_return).toUpper())
|
, _undoText(tr::lng_stickers_return(tr::now).toUpper())
|
||||||
, _undoWidth(st::stickersUndoRemove.font->width(_undoText)) {
|
, _undoWidth(st::stickersUndoRemove.font->width(_undoText)) {
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ StickersBox::Inner::Inner(QWidget *parent, not_null<ChannelData*> megagroup) : T
|
||||||
, _megagroupSetInput(_megagroupSet->mgInfo->stickerSet)
|
, _megagroupSetInput(_megagroupSet->mgInfo->stickerSet)
|
||||||
, _megagroupSetField(this, st::groupStickersField, rpl::single(qsl("stickerset")), QString(), true)
|
, _megagroupSetField(this, st::groupStickersField, rpl::single(qsl("stickerset")), QString(), true)
|
||||||
, _megagroupDivider(this)
|
, _megagroupDivider(this)
|
||||||
, _megagroupSubTitle(this, lang(lng_stickers_group_from_your), st::boxTitle) {
|
, _megagroupSubTitle(this, tr::lng_stickers_group_from_your(tr::now), st::boxTitle) {
|
||||||
_megagroupSetField->setLinkPlaceholder(Core::App().createInternalLink(qsl("addstickers/")));
|
_megagroupSetField->setLinkPlaceholder(Core::App().createInternalLink(qsl("addstickers/")));
|
||||||
_megagroupSetField->setPlaceholderHidden(false);
|
_megagroupSetField->setPlaceholderHidden(false);
|
||||||
_megagroupSetAddressChangedTimer.setCallback([this] { handleMegagroupSetAddressChange(); });
|
_megagroupSetAddressChangedTimer.setCallback([this] { handleMegagroupSetAddressChange(); });
|
||||||
|
@ -733,7 +733,7 @@ void StickersBox::Inner::paintEvent(QPaintEvent *e) {
|
||||||
if (_rows.empty()) {
|
if (_rows.empty()) {
|
||||||
p.setFont(st::noContactsFont);
|
p.setFont(st::noContactsFont);
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(QRect(0, y, width(), st::noContactsHeight), lang(lng_contacts_loading), style::al_center);
|
p.drawText(QRect(0, y, width(), st::noContactsHeight), tr::lng_contacts_loading(tr::now), style::al_center);
|
||||||
} else {
|
} else {
|
||||||
p.translate(0, _itemsTop);
|
p.translate(0, _itemsTop);
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ void StickersBox::Inner::paintRow(Painter &p, Row *set, int index) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto statusText = (set->count > 0) ? lng_stickers_count(lt_count, set->count) : lang(lng_contacts_loading);
|
auto statusText = (set->count > 0) ? lng_stickers_count(lt_count, set->count) : tr::lng_contacts_loading(tr::now);
|
||||||
|
|
||||||
p.setFont(st::contactsStatusFont);
|
p.setFont(st::contactsStatusFont);
|
||||||
p.setPen(st::contactsStatusFg);
|
p.setPen(st::contactsStatusFg);
|
||||||
|
@ -1484,9 +1484,9 @@ void StickersBox::Inner::rebuild() {
|
||||||
auto &sets = Auth().data().stickerSets();
|
auto &sets = Auth().data().stickerSets();
|
||||||
if (_megagroupSet) {
|
if (_megagroupSet) {
|
||||||
auto usingFeatured = Auth().data().stickerSetsOrder().empty();
|
auto usingFeatured = Auth().data().stickerSetsOrder().empty();
|
||||||
_megagroupSubTitle->setText(lang(usingFeatured
|
_megagroupSubTitle->setText(usingFeatured
|
||||||
? lng_stickers_group_from_featured
|
? tr::lng_stickers_group_from_featured(tr::now)
|
||||||
: lng_stickers_group_from_your));
|
: tr::lng_stickers_group_from_your(tr::now));
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
} else if (_section == Section::Installed) {
|
} else if (_section == Section::Installed) {
|
||||||
auto cloudIt = sets.constFind(Stickers::CloudRecentSetId);
|
auto cloudIt = sets.constFind(Stickers::CloudRecentSetId);
|
||||||
|
|
|
@ -40,7 +40,7 @@ UsernameBox::UsernameBox(QWidget*)
|
||||||
void UsernameBox::prepare() {
|
void UsernameBox::prepare() {
|
||||||
_goodText = Auth().user()->username.isEmpty()
|
_goodText = Auth().user()->username.isEmpty()
|
||||||
? QString()
|
? QString()
|
||||||
: lang(lng_username_available);
|
: tr::lng_username_available(tr::now);
|
||||||
|
|
||||||
setTitle(tr::lng_username_title());
|
setTitle(tr::lng_username_title());
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ void UsernameBox::prepare() {
|
||||||
connect(_username, &Ui::MaskedInputField::submitted, [=] { save(); });
|
connect(_username, &Ui::MaskedInputField::submitted, [=] { save(); });
|
||||||
_link->addClickHandler([=] { linkClick(); });
|
_link->addClickHandler([=] { linkClick(); });
|
||||||
|
|
||||||
_about.setText(st::usernameTextStyle, lang(lng_username_about));
|
_about.setText(st::usernameTextStyle, tr::lng_username_about(tr::now));
|
||||||
setDimensions(st::boxWidth, st::usernamePadding.top() + _username->height() + st::usernameSkip + _about.countHeight(st::boxWidth - st::usernamePadding.left()) + 3 * st::usernameTextStyle.lineHeight + st::usernamePadding.bottom());
|
setDimensions(st::boxWidth, st::usernamePadding.top() + _username->height() + st::usernameSkip + _about.countHeight(st::boxWidth - st::usernamePadding.left()) + 3 * st::usernameTextStyle.lineHeight + st::usernamePadding.bottom());
|
||||||
|
|
||||||
_checkTimer->setSingleShot(true);
|
_checkTimer->setSingleShot(true);
|
||||||
|
@ -78,7 +78,7 @@ void UsernameBox::paintEvent(QPaintEvent *e) {
|
||||||
p.drawTextLeft(st::usernamePadding.left(), _username->y() + _username->height() + ((st::usernameSkip - st::boxTextFont->height) / 2), width(), _goodText);
|
p.drawTextLeft(st::usernamePadding.left(), _username->y() + _username->height() + ((st::usernameSkip - st::boxTextFont->height) / 2), width(), _goodText);
|
||||||
} else {
|
} else {
|
||||||
p.setPen(st::usernameDefaultFg);
|
p.setPen(st::usernameDefaultFg);
|
||||||
p.drawTextLeft(st::usernamePadding.left(), _username->y() + _username->height() + ((st::usernameSkip - st::boxTextFont->height) / 2), width(), lang(lng_username_choose));
|
p.drawTextLeft(st::usernamePadding.left(), _username->y() + _username->height() + ((st::usernameSkip - st::boxTextFont->height) / 2), width(), tr::lng_username_choose(tr::now));
|
||||||
}
|
}
|
||||||
p.setPen(st::boxTextFg);
|
p.setPen(st::boxTextFg);
|
||||||
int32 availw = st::boxWidth - st::usernamePadding.left(), h = _about.countHeight(availw);
|
int32 availw = st::boxWidth - st::usernamePadding.left(), h = _about.countHeight(availw);
|
||||||
|
@ -86,11 +86,11 @@ void UsernameBox::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
int32 linky = _username->y() + _username->height() + st::usernameSkip + h + st::usernameTextStyle.lineHeight + ((st::usernameTextStyle.lineHeight - st::boxTextFont->height) / 2);
|
int32 linky = _username->y() + _username->height() + st::usernameSkip + h + st::usernameTextStyle.lineHeight + ((st::usernameTextStyle.lineHeight - st::boxTextFont->height) / 2);
|
||||||
if (_link->isHidden()) {
|
if (_link->isHidden()) {
|
||||||
p.drawTextLeft(st::usernamePadding.left(), linky, width(), lang(lng_username_link_willbe));
|
p.drawTextLeft(st::usernamePadding.left(), linky, width(), tr::lng_username_link_willbe(tr::now));
|
||||||
p.setPen(st::usernameDefaultFg);
|
p.setPen(st::usernameDefaultFg);
|
||||||
p.drawTextLeft(st::usernamePadding.left(), linky + st::usernameTextStyle.lineHeight + ((st::usernameTextStyle.lineHeight - st::boxTextFont->height) / 2), width(), Core::App().createInternalLinkFull(qsl("username")));
|
p.drawTextLeft(st::usernamePadding.left(), linky + st::usernameTextStyle.lineHeight + ((st::usernameTextStyle.lineHeight - st::boxTextFont->height) / 2), width(), Core::App().createInternalLinkFull(qsl("username")));
|
||||||
} else {
|
} else {
|
||||||
p.drawTextLeft(st::usernamePadding.left(), linky, width(), lang(lng_username_link));
|
p.drawTextLeft(st::usernamePadding.left(), linky, width(), tr::lng_username_link(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,8 +141,8 @@ void UsernameBox::changed() {
|
||||||
for (int32 i = 0; i < len; ++i) {
|
for (int32 i = 0; i < len; ++i) {
|
||||||
QChar ch = name.at(i);
|
QChar ch = name.at(i);
|
||||||
if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_' && (ch != '@' || i > 0)) {
|
if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '_' && (ch != '@' || i > 0)) {
|
||||||
if (_errorText != lang(lng_username_bad_symbols)) {
|
if (_errorText != tr::lng_username_bad_symbols(tr::now)) {
|
||||||
_errorText = lang(lng_username_bad_symbols);
|
_errorText = tr::lng_username_bad_symbols(tr::now);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
_checkTimer->stop();
|
_checkTimer->stop();
|
||||||
|
@ -150,8 +150,8 @@ void UsernameBox::changed() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (name.size() < kMinUsernameLength) {
|
if (name.size() < kMinUsernameLength) {
|
||||||
if (_errorText != lang(lng_username_too_short)) {
|
if (_errorText != tr::lng_username_too_short(tr::now)) {
|
||||||
_errorText = lang(lng_username_too_short);
|
_errorText = tr::lng_username_too_short(tr::now);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
_checkTimer->stop();
|
_checkTimer->stop();
|
||||||
|
@ -167,7 +167,7 @@ void UsernameBox::changed() {
|
||||||
|
|
||||||
void UsernameBox::linkClick() {
|
void UsernameBox::linkClick() {
|
||||||
QApplication::clipboard()->setText(Core::App().createInternalLinkFull(getName()));
|
QApplication::clipboard()->setText(Core::App().createInternalLinkFull(getName()));
|
||||||
Ui::Toast::Show(lang(lng_username_copied));
|
Ui::Toast::Show(tr::lng_username_copied(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UsernameBox::onUpdateDone(const MTPUser &user) {
|
void UsernameBox::onUpdateDone(const MTPUser &user) {
|
||||||
|
@ -192,13 +192,13 @@ bool UsernameBox::onUpdateFail(const RPCError &error) {
|
||||||
} else if (err == qstr("USERNAME_INVALID")) {
|
} else if (err == qstr("USERNAME_INVALID")) {
|
||||||
_username->setFocus();
|
_username->setFocus();
|
||||||
_username->showError();
|
_username->showError();
|
||||||
_errorText = lang(lng_username_invalid);
|
_errorText = tr::lng_username_invalid(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("USERNAME_OCCUPIED") || err == qstr("USERNAMES_UNAVAILABLE")) {
|
} else if (err == qstr("USERNAME_OCCUPIED") || err == qstr("USERNAMES_UNAVAILABLE")) {
|
||||||
_username->setFocus();
|
_username->setFocus();
|
||||||
_username->showError();
|
_username->showError();
|
||||||
_errorText = lang(lng_username_occupied);
|
_errorText = tr::lng_username_occupied(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -211,9 +211,9 @@ void UsernameBox::onCheckDone(const MTPBool &result) {
|
||||||
const auto newError = (mtpIsTrue(result)
|
const auto newError = (mtpIsTrue(result)
|
||||||
|| _checkUsername == Auth().user()->username)
|
|| _checkUsername == Auth().user()->username)
|
||||||
? QString()
|
? QString()
|
||||||
: lang(lng_username_occupied);
|
: tr::lng_username_occupied(tr::now);
|
||||||
const auto newGood = newError.isEmpty()
|
const auto newGood = newError.isEmpty()
|
||||||
? lang(lng_username_available)
|
? tr::lng_username_available(tr::now)
|
||||||
: QString();
|
: QString();
|
||||||
if (_errorText != newError || _goodText != newGood) {
|
if (_errorText != newError || _goodText != newGood) {
|
||||||
_errorText = newError;
|
_errorText = newError;
|
||||||
|
@ -228,11 +228,11 @@ bool UsernameBox::onCheckFail(const RPCError &error) {
|
||||||
_checkRequestId = 0;
|
_checkRequestId = 0;
|
||||||
QString err(error.type());
|
QString err(error.type());
|
||||||
if (err == qstr("USERNAME_INVALID")) {
|
if (err == qstr("USERNAME_INVALID")) {
|
||||||
_errorText = lang(lng_username_invalid);
|
_errorText = tr::lng_username_invalid(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
} else if (err == qstr("USERNAME_OCCUPIED") && _checkUsername != Auth().user()->username) {
|
} else if (err == qstr("USERNAME_OCCUPIED") && _checkUsername != Auth().user()->username) {
|
||||||
_errorText = lang(lng_username_occupied);
|
_errorText = tr::lng_username_occupied(tr::now);
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ void BoxController::prepare() {
|
||||||
});
|
});
|
||||||
|
|
||||||
delegate()->peerListSetTitle(tr::lng_call_box_title());
|
delegate()->peerListSetTitle(tr::lng_call_box_title());
|
||||||
setDescriptionText(lang(lng_contacts_loading));
|
setDescriptionText(tr::lng_contacts_loading(tr::now));
|
||||||
delegate()->peerListRefreshRows();
|
delegate()->peerListRefreshRows();
|
||||||
|
|
||||||
loadMoreRows();
|
loadMoreRows();
|
||||||
|
@ -284,7 +284,7 @@ void BoxController::loadMoreRows() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxController::refreshAbout() {
|
void BoxController::refreshAbout() {
|
||||||
setDescriptionText(delegate()->peerListFullRowsCount() ? QString() : lang(lng_call_box_about));
|
setDescriptionText(delegate()->peerListFullRowsCount() ? QString() : tr::lng_call_box_about(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoxController::rowClicked(not_null<PeerListRow*> row) {
|
void BoxController::rowClicked(not_null<PeerListRow*> row) {
|
||||||
|
|
|
@ -888,7 +888,7 @@ void Call::handleControllerError(int error) {
|
||||||
"{user}",
|
"{user}",
|
||||||
App::peerName(_user))));
|
App::peerName(_user))));
|
||||||
} else if (error == tgvoip::ERROR_AUDIO_IO) {
|
} else if (error == tgvoip::ERROR_AUDIO_IO) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_call_error_audio_io)));
|
Ui::show(Box<InformBox>(tr::lng_call_error_audio_io(tr::now)));
|
||||||
}
|
}
|
||||||
finish(FinishType::Failed);
|
finish(FinishType::Failed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,7 +286,7 @@ void Instance::requestMicrophonePermissionOrFail(Fn<void()> onSuccess) {
|
||||||
if (alreadyInCall()) {
|
if (alreadyInCall()) {
|
||||||
_currentCall->hangup();
|
_currentCall->hangup();
|
||||||
}
|
}
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_no_mic_permission), lang(lng_menu_settings), crl::guard(this, [] {
|
Ui::show(Box<ConfirmBox>(tr::lng_no_mic_permission(tr::now), tr::lng_menu_settings(tr::now), crl::guard(this, [] {
|
||||||
Platform::OpenSystemSettingsForPermission(Platform::PermissionType::Microphone);
|
Platform::OpenSystemSettingsForPermission(Platform::PermissionType::Microphone);
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
})));
|
})));
|
||||||
|
|
|
@ -892,7 +892,7 @@ void Panel::updateStatusText(State state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case State::Starting:
|
case State::Starting:
|
||||||
case State::WaitingInit:
|
case State::WaitingInit:
|
||||||
case State::WaitingInitAck: return lang(lng_call_status_connecting);
|
case State::WaitingInitAck: return tr::lng_call_status_connecting(tr::now);
|
||||||
case State::Established: {
|
case State::Established: {
|
||||||
if (_call) {
|
if (_call) {
|
||||||
auto durationMs = _call->getDurationMs();
|
auto durationMs = _call->getDurationMs();
|
||||||
|
@ -900,19 +900,19 @@ void Panel::updateStatusText(State state) {
|
||||||
startDurationUpdateTimer(durationMs);
|
startDurationUpdateTimer(durationMs);
|
||||||
return formatDurationText(durationSeconds);
|
return formatDurationText(durationSeconds);
|
||||||
}
|
}
|
||||||
return lang(lng_call_status_ended);
|
return tr::lng_call_status_ended(tr::now);
|
||||||
} break;
|
} break;
|
||||||
case State::FailedHangingUp:
|
case State::FailedHangingUp:
|
||||||
case State::Failed: return lang(lng_call_status_failed);
|
case State::Failed: return tr::lng_call_status_failed(tr::now);
|
||||||
case State::HangingUp: return lang(lng_call_status_hanging);
|
case State::HangingUp: return tr::lng_call_status_hanging(tr::now);
|
||||||
case State::Ended:
|
case State::Ended:
|
||||||
case State::EndedByOtherDevice: return lang(lng_call_status_ended);
|
case State::EndedByOtherDevice: return tr::lng_call_status_ended(tr::now);
|
||||||
case State::ExchangingKeys: return lang(lng_call_status_exchanging);
|
case State::ExchangingKeys: return tr::lng_call_status_exchanging(tr::now);
|
||||||
case State::Waiting: return lang(lng_call_status_waiting);
|
case State::Waiting: return tr::lng_call_status_waiting(tr::now);
|
||||||
case State::Requesting: return lang(lng_call_status_requesting);
|
case State::Requesting: return tr::lng_call_status_requesting(tr::now);
|
||||||
case State::WaitingIncoming: return lang(lng_call_status_incoming);
|
case State::WaitingIncoming: return tr::lng_call_status_incoming(tr::now);
|
||||||
case State::Ringing: return lang(lng_call_status_ringing);
|
case State::Ringing: return tr::lng_call_status_ringing(tr::now);
|
||||||
case State::Busy: return lang(lng_call_status_busy);
|
case State::Busy: return tr::lng_call_status_busy(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("State in stateChanged()");
|
Unexpected("State in stateChanged()");
|
||||||
};
|
};
|
||||||
|
|
|
@ -80,7 +80,7 @@ TopBar::TopBar(
|
||||||
, _signalBars(this, _call.get(), st::callBarSignalBars)
|
, _signalBars(this, _call.get(), st::callBarSignalBars)
|
||||||
, _fullInfoLabel(this, st::callBarInfoLabel)
|
, _fullInfoLabel(this, st::callBarInfoLabel)
|
||||||
, _shortInfoLabel(this, st::callBarInfoLabel)
|
, _shortInfoLabel(this, st::callBarInfoLabel)
|
||||||
, _hangupLabel(this, st::callBarLabel, lang(lng_call_bar_hangup).toUpper())
|
, _hangupLabel(this, st::callBarLabel, tr::lng_call_bar_hangup(tr::now).toUpper())
|
||||||
, _mute(this, st::callBarMuteToggle)
|
, _mute(this, st::callBarMuteToggle)
|
||||||
, _info(this)
|
, _info(this)
|
||||||
, _hangup(this, st::callBarHangup) {
|
, _hangup(this, st::callBarHangup) {
|
||||||
|
|
|
@ -18,6 +18,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
namespace ChatHelpers {
|
namespace ChatHelpers {
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
tr::phrase<> CategoryTitle(int index) {
|
||||||
|
switch (index) {
|
||||||
|
case 1: return tr::lng_emoji_category1;
|
||||||
|
case 2: return tr::lng_emoji_category2;
|
||||||
|
case 3: return tr::lng_emoji_category3;
|
||||||
|
case 4: return tr::lng_emoji_category4;
|
||||||
|
case 5: return tr::lng_emoji_category5;
|
||||||
|
case 6: return tr::lng_emoji_category6;
|
||||||
|
case 7: return tr::lng_emoji_category7;
|
||||||
|
}
|
||||||
|
Unexpected("Index in CategoryTitle.");
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
class EmojiColorPicker : public Ui::RpWidget {
|
class EmojiColorPicker : public Ui::RpWidget {
|
||||||
public:
|
public:
|
||||||
|
@ -529,7 +545,7 @@ void EmojiListWidget::paintEvent(QPaintEvent *e) {
|
||||||
if (info.section > 0 && r.top() < info.rowsTop) {
|
if (info.section > 0 && r.top() < info.rowsTop) {
|
||||||
p.setFont(st::emojiPanHeaderFont);
|
p.setFont(st::emojiPanHeaderFont);
|
||||||
p.setPen(st::emojiPanHeaderFg);
|
p.setPen(st::emojiPanHeaderFg);
|
||||||
p.drawTextLeft(st::emojiPanHeaderLeft - st::buttonRadius, info.top + st::emojiPanHeaderTop, width(), lang(LangKey(lng_emoji_category1 + info.section - 1)));
|
p.drawTextLeft(st::emojiPanHeaderLeft - st::buttonRadius, info.top + st::emojiPanHeaderTop, width(), CategoryTitle(info.section)(tr::now));
|
||||||
}
|
}
|
||||||
if (r.top() + r.height() > info.rowsTop) {
|
if (r.top() + r.height() > info.rowsTop) {
|
||||||
ensureLoaded(info.section);
|
ensureLoaded(info.section);
|
||||||
|
|
|
@ -169,9 +169,9 @@ QString StateDescription(const SetState &state) {
|
||||||
return state.match([](const Available &data) {
|
return state.match([](const Available &data) {
|
||||||
return lng_emoji_set_download(lt_size, formatSizeText(data.size));
|
return lng_emoji_set_download(lt_size, formatSizeText(data.size));
|
||||||
}, [](const Ready &data) -> QString {
|
}, [](const Ready &data) -> QString {
|
||||||
return lang(lng_emoji_set_ready);
|
return tr::lng_emoji_set_ready(tr::now);
|
||||||
}, [](const Active &data) -> QString {
|
}, [](const Active &data) -> QString {
|
||||||
return lang(lng_emoji_set_active);
|
return tr::lng_emoji_set_active(tr::now);
|
||||||
}, [](const Loading &data) {
|
}, [](const Loading &data) {
|
||||||
const auto percent = (data.size > 0)
|
const auto percent = (data.size > 0)
|
||||||
? snap((data.already * 100) / float64(data.size), 0., 100.)
|
? snap((data.already * 100) / float64(data.size), 0., 100.)
|
||||||
|
@ -182,7 +182,7 @@ QString StateDescription(const SetState &state) {
|
||||||
lt_progress,
|
lt_progress,
|
||||||
formatDownloadText(data.already, data.size));
|
formatDownloadText(data.already, data.size));
|
||||||
}, [](const Failed &data) {
|
}, [](const Failed &data) {
|
||||||
return lang(lng_attach_failed);
|
return tr::lng_attach_failed(tr::now);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,9 @@ void GifsListWidget::paintInlineItems(Painter &p, QRect clip) {
|
||||||
if (_rows.isEmpty()) {
|
if (_rows.isEmpty()) {
|
||||||
p.setFont(st::normalFont);
|
p.setFont(st::normalFont);
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
auto text = lang(_inlineQuery.isEmpty() ? lng_gifs_no_saved : lng_inline_bot_no_results);
|
auto text = _inlineQuery.isEmpty()
|
||||||
|
? tr::lng_gifs_no_saved(tr::now)
|
||||||
|
: tr::lng_inline_bot_no_results(tr::now);
|
||||||
p.drawText(QRect(0, 0, width(), (height() / 3) * 2 + st::normalFont->height), text, style::al_center);
|
p.drawText(QRect(0, 0, width(), (height() / 3) * 2 + st::normalFont->height), text, style::al_center);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ void ApplyArchivedResult(const MTPDmessages_stickerSetInstallResultArchive &d) {
|
||||||
Local::writeArchivedStickers();
|
Local::writeArchivedStickers();
|
||||||
|
|
||||||
Ui::Toast::Config toast;
|
Ui::Toast::Config toast;
|
||||||
toast.text = lang(lng_stickers_packs_archived);
|
toast.text = tr::lng_stickers_packs_archived(tr::now);
|
||||||
toast.maxWidth = st::stickersToastMaxWidth;
|
toast.maxWidth = st::stickersToastMaxWidth;
|
||||||
toast.padding = st::stickersToastPadding;
|
toast.padding = st::stickersToastPadding;
|
||||||
Ui::Toast::Show(toast);
|
Ui::Toast::Show(toast);
|
||||||
|
@ -175,7 +175,7 @@ void UndoInstallLocally(uint64 setId) {
|
||||||
Auth().data().notifyStickersUpdated();
|
Auth().data().notifyStickersUpdated();
|
||||||
|
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lang(lng_stickers_not_found)),
|
Box<InformBox>(tr::lng_stickers_not_found(tr::now)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1064,7 +1064,7 @@ void NewSetReceived(const MTPmessages_StickerSet &data) {
|
||||||
QString GetSetTitle(const MTPDstickerSet &s) {
|
QString GetSetTitle(const MTPDstickerSet &s) {
|
||||||
auto title = qs(s.vtitle);
|
auto title = qs(s.vtitle);
|
||||||
if ((s.vflags.v & MTPDstickerSet::Flag::f_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
|
if ((s.vflags.v & MTPDstickerSet::Flag::f_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
|
||||||
return lang(lng_stickers_default_set);
|
return tr::lng_stickers_default_set(tr::now);
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
|
@ -703,9 +703,9 @@ StickersListWidget::StickersListWidget(
|
||||||
: Inner(parent, controller)
|
: Inner(parent, controller)
|
||||||
, _section(Section::Stickers)
|
, _section(Section::Stickers)
|
||||||
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st::emojiPanHeaderLeft)
|
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st::emojiPanHeaderLeft)
|
||||||
, _addText(lang(lng_stickers_featured_add).toUpper())
|
, _addText(tr::lng_stickers_featured_add(tr::now).toUpper())
|
||||||
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
|
, _addWidth(st::stickersTrendingAdd.font->width(_addText))
|
||||||
, _settings(this, lang(lng_stickers_you_have))
|
, _settings(this, tr::lng_stickers_you_have(tr::now))
|
||||||
, _previewTimer([=] { showPreview(); })
|
, _previewTimer([=] { showPreview(); })
|
||||||
, _searchRequestTimer([=] { sendSearchRequest(); }) {
|
, _searchRequestTimer([=] { sendSearchRequest(); }) {
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
@ -1241,7 +1241,7 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto statusText = (size > 0) ? lng_stickers_count(lt_count, size) : lang(lng_contacts_loading);
|
auto statusText = (size > 0) ? lng_stickers_count(lt_count, size) : tr::lng_contacts_loading(tr::now);
|
||||||
p.setFont(st::stickersTrendingSubheaderFont);
|
p.setFont(st::stickersTrendingSubheaderFont);
|
||||||
p.setPen(st::stickersTrendingSubheaderFg);
|
p.setPen(st::stickersTrendingSubheaderFg);
|
||||||
p.drawTextLeft(st::emojiPanHeaderLeft - st::buttonRadius, info.top + st::stickersTrendingSubheaderTop, width(), statusText);
|
p.drawTextLeft(st::emojiPanHeaderLeft - st::buttonRadius, info.top + st::stickersTrendingSubheaderTop, width(), statusText);
|
||||||
|
@ -1314,7 +1314,7 @@ void StickersListWidget::paintEmptySearchResults(Painter &p) {
|
||||||
const auto iconTop = (height() / 3) - (st::stickersEmpty.height() / 2);
|
const auto iconTop = (height() / 3) - (st::stickersEmpty.height() / 2);
|
||||||
st::stickersEmpty.paint(p, iconLeft, iconTop, width());
|
st::stickersEmpty.paint(p, iconLeft, iconTop, width());
|
||||||
|
|
||||||
const auto text = lang(lng_stickers_nothing_found);
|
const auto text = tr::lng_stickers_nothing_found(tr::now);
|
||||||
const auto textWidth = st::normalFont->width(text);
|
const auto textWidth = st::normalFont->width(text);
|
||||||
p.setFont(st::normalFont);
|
p.setFont(st::normalFont);
|
||||||
p.setPen(st::windowSubTextFg);
|
p.setPen(st::windowSubTextFg);
|
||||||
|
@ -1937,7 +1937,7 @@ void StickersListWidget::refreshRecentStickers(bool performResize) {
|
||||||
Stickers::RecentSetId,
|
Stickers::RecentSetId,
|
||||||
(MTPDstickerSet::Flag::f_official
|
(MTPDstickerSet::Flag::f_official
|
||||||
| MTPDstickerSet_ClientFlag::f_special),
|
| MTPDstickerSet_ClientFlag::f_special),
|
||||||
lang(lng_recent_stickers),
|
tr::lng_recent_stickers(tr::now),
|
||||||
shortName,
|
shortName,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
externalLayout,
|
externalLayout,
|
||||||
|
@ -1998,7 +1998,7 @@ void StickersListWidget::refreshMegagroupStickers(GroupStickersPlace place) {
|
||||||
_mySets.emplace_back(
|
_mySets.emplace_back(
|
||||||
Stickers::MegagroupSetId,
|
Stickers::MegagroupSetId,
|
||||||
MTPDstickerSet_ClientFlag::f_special | 0,
|
MTPDstickerSet_ClientFlag::f_special | 0,
|
||||||
lang(lng_group_stickers),
|
tr::lng_group_stickers(tr::now),
|
||||||
shortName,
|
shortName,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
externalLayout,
|
externalLayout,
|
||||||
|
@ -2036,7 +2036,7 @@ void StickersListWidget::refreshMegagroupStickers(GroupStickersPlace place) {
|
||||||
_mySets.emplace_back(
|
_mySets.emplace_back(
|
||||||
Stickers::MegagroupSetId,
|
Stickers::MegagroupSetId,
|
||||||
MTPDstickerSet_ClientFlag::f_special | 0,
|
MTPDstickerSet_ClientFlag::f_special | 0,
|
||||||
lang(lng_group_stickers),
|
tr::lng_group_stickers(tr::now),
|
||||||
shortName,
|
shortName,
|
||||||
thumbnail,
|
thumbnail,
|
||||||
externalLayout,
|
externalLayout,
|
||||||
|
@ -2317,8 +2317,8 @@ void StickersListWidget::showMegagroupSet(ChannelData *megagroup) {
|
||||||
if (_megagroupSetAbout.isEmpty()) {
|
if (_megagroupSetAbout.isEmpty()) {
|
||||||
_megagroupSetAbout.setText(
|
_megagroupSetAbout.setText(
|
||||||
st::stickerGroupCategoryAbout,
|
st::stickerGroupCategoryAbout,
|
||||||
lang(lng_group_stickers_description));
|
tr::lng_group_stickers_description(tr::now));
|
||||||
_megagroupSetButtonText = lang(lng_group_stickers_add).toUpper();
|
_megagroupSetButtonText = tr::lng_group_stickers_add(tr::now).toUpper();
|
||||||
refreshMegagroupSetGeometry();
|
refreshMegagroupSetGeometry();
|
||||||
}
|
}
|
||||||
_megagroupSetButtonRipple.reset();
|
_megagroupSetButtonRipple.reset();
|
||||||
|
@ -2415,7 +2415,7 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_removingSetId = Stickers::MegagroupSetId;
|
_removingSetId = Stickers::MegagroupSetId;
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_stickers_remove_group_set), crl::guard(this, [this, group = _megagroupSet] {
|
Ui::show(Box<ConfirmBox>(tr::lng_stickers_remove_group_set(tr::now), crl::guard(this, [this, group = _megagroupSet] {
|
||||||
Expects(group->mgInfo != nullptr);
|
Expects(group->mgInfo != nullptr);
|
||||||
|
|
||||||
if (group->mgInfo->stickerSet.type() != mtpc_inputStickerSetEmpty) {
|
if (group->mgInfo->stickerSet.type() != mtpc_inputStickerSetEmpty) {
|
||||||
|
@ -2436,7 +2436,7 @@ void StickersListWidget::removeSet(uint64 setId) {
|
||||||
if (it != sets.cend()) {
|
if (it != sets.cend()) {
|
||||||
_removingSetId = it->id;
|
_removingSetId = it->id;
|
||||||
auto text = lng_stickers_remove_pack(lt_sticker_pack, it->title);
|
auto text = lng_stickers_remove_pack(lt_sticker_pack, it->title);
|
||||||
Ui::show(Box<ConfirmBox>(text, lang(lng_stickers_remove_pack_confirm), crl::guard(this, [=] {
|
Ui::show(Box<ConfirmBox>(text, tr::lng_stickers_remove_pack_confirm(tr::now), crl::guard(this, [=] {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
auto &sets = Auth().data().stickerSetsRef();
|
auto &sets = Auth().data().stickerSetsRef();
|
||||||
auto it = sets.find(_removingSetId);
|
auto it = sets.find(_removingSetId);
|
||||||
|
|
|
@ -663,20 +663,20 @@ void TabbedSelector::setCurrentPeer(PeerData *peer) {
|
||||||
|
|
||||||
void TabbedSelector::checkRestrictedPeer() {
|
void TabbedSelector::checkRestrictedPeer() {
|
||||||
if (_currentPeer) {
|
if (_currentPeer) {
|
||||||
const auto errorKey = (_currentTabType == SelectorTab::Stickers)
|
const auto error = (_currentTabType == SelectorTab::Stickers)
|
||||||
? Data::RestrictionErrorKey(
|
? Data::RestrictionError(
|
||||||
_currentPeer,
|
_currentPeer,
|
||||||
ChatRestriction::f_send_stickers)
|
ChatRestriction::f_send_stickers)
|
||||||
: (_currentTabType == SelectorTab::Gifs)
|
: (_currentTabType == SelectorTab::Gifs)
|
||||||
? Data::RestrictionErrorKey(
|
? Data::RestrictionError(
|
||||||
_currentPeer,
|
_currentPeer,
|
||||||
ChatRestriction::f_send_gifs)
|
ChatRestriction::f_send_gifs)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (errorKey) {
|
if (error) {
|
||||||
if (!_restrictedLabel) {
|
if (!_restrictedLabel) {
|
||||||
_restrictedLabel.create(
|
_restrictedLabel.create(
|
||||||
this,
|
this,
|
||||||
lang(*errorKey),
|
*error,
|
||||||
st::stickersRestrictedLabel);
|
st::stickersRestrictedLabel);
|
||||||
_restrictedLabel->show();
|
_restrictedLabel->show();
|
||||||
updateRestrictedLabelGeometry();
|
updateRestrictedLabelGeometry();
|
||||||
|
@ -748,9 +748,9 @@ void TabbedSelector::createTabsSlider() {
|
||||||
_tabsSlider.create(this, st::emojiTabs);
|
_tabsSlider.create(this, st::emojiTabs);
|
||||||
|
|
||||||
auto sections = QStringList();
|
auto sections = QStringList();
|
||||||
sections.push_back(lang(lng_switch_emoji).toUpper());
|
sections.push_back(tr::lng_switch_emoji(tr::now).toUpper());
|
||||||
sections.push_back(lang(lng_switch_stickers).toUpper());
|
sections.push_back(tr::lng_switch_stickers(tr::now).toUpper());
|
||||||
sections.push_back(lang(lng_switch_gifs).toUpper());
|
sections.push_back(tr::lng_switch_gifs(tr::now).toUpper());
|
||||||
_tabsSlider->setSections(sections);
|
_tabsSlider->setSections(sections);
|
||||||
|
|
||||||
_tabsSlider->setActiveSectionFast(static_cast<int>(_currentTabType));
|
_tabsSlider->setActiveSectionFast(static_cast<int>(_currentTabType));
|
||||||
|
|
|
@ -121,8 +121,7 @@ inline constexpr auto kTagsCount = " << langpack_.tags.size() << ";\n\
|
||||||
\n";
|
\n";
|
||||||
|
|
||||||
header_->popNamespace().newline().stream() << "\
|
header_->popNamespace().newline().stream() << "\
|
||||||
enum LangKey : int;\n\
|
enum LangKey : int;\n\n";
|
||||||
QString lang(LangKey key);\n\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Generator::writeHeaderTagTypes() {
|
void Generator::writeHeaderTagTypes() {
|
||||||
|
@ -170,7 +169,6 @@ void Generator::writeHeaderTaggedMethods() {
|
||||||
args.push_back((isPluralTag ? "type" : ("lt_" + tag)) + ", " + tag + "__val");
|
args.push_back((isPluralTag ? "type" : ("lt_" + tag)) + ", " + tag + "__val");
|
||||||
}
|
}
|
||||||
if (!entry.tags.empty() && (!isPlural || key == ComputePluralKey(entry.keyBase, 0))) {
|
if (!entry.tags.empty() && (!isPlural || key == ComputePluralKey(entry.keyBase, 0))) {
|
||||||
auto initialString = isPlural ? ("lang(LangKey(" + key + " + plural.keyShift))") : ("lang(" + getFullKey(entry) + ")");
|
|
||||||
header_->stream() << "\
|
header_->stream() << "\
|
||||||
inline QString " << (isPlural ? entry.keyBase : key) << "(" << params.join(QString(", ")) << ") {\n\
|
inline QString " << (isPlural ? entry.keyBase : key) << "(" << params.join(QString(", ")) << ") {\n\
|
||||||
return tr::" << (isPlural ? entry.keyBase : key) << "(tr::now, " << args.join(QString(", ")) << ");\n\
|
return tr::" << (isPlural ? entry.keyBase : key) << "(tr::now, " << args.join(QString(", ")) << ");\n\
|
||||||
|
@ -207,7 +205,7 @@ inline constexpr ushort TagValue() {\n\
|
||||||
header_->stream() << "template <> struct TagData<lngtag_" << tag.tag << "> : std::integral_constant<ushort, ushort(lt_" << tag.tag << ")> {};\n";
|
header_->stream() << "template <> struct TagData<lngtag_" << tag.tag << "> : std::integral_constant<ushort, ushort(lt_" << tag.tag << ")> {};\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
header_->popNamespace();
|
header_->newline().popNamespace();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Generator::writeHeaderReactiveInterface() {
|
void Generator::writeHeaderReactiveInterface() {
|
||||||
|
@ -231,14 +229,13 @@ struct Identity {\n\
|
||||||
|
|
||||||
header_->popNamespace().newline();
|
header_->popNamespace().newline();
|
||||||
header_->stream() << "\
|
header_->stream() << "\
|
||||||
\n\
|
|
||||||
struct now_t {\n\
|
struct now_t {\n\
|
||||||
};\n\
|
};\n\
|
||||||
\n\
|
\n\
|
||||||
inline constexpr now_t now{};\n\
|
inline constexpr now_t now{};\n\
|
||||||
\n\
|
\n\
|
||||||
template <typename ...Tags>\n\
|
template <typename ...Tags>\n\
|
||||||
struct Producer;\n\
|
struct phrase;\n\
|
||||||
\n";
|
\n";
|
||||||
std::set<QStringList> producersDeclared;
|
std::set<QStringList> producersDeclared;
|
||||||
for (auto &entry : langpack_.entries) {
|
for (auto &entry : langpack_.entries) {
|
||||||
|
@ -274,19 +271,19 @@ struct Producer;\n\
|
||||||
}
|
}
|
||||||
header_->stream() << "\
|
header_->stream() << "\
|
||||||
template <>\n\
|
template <>\n\
|
||||||
struct Producer<" << tags.join(", ") << "> {\n\
|
struct phrase<" << tags.join(", ") << "> {\n\
|
||||||
template <\n\
|
template <\n\
|
||||||
typename P = details::Identity,\n\
|
typename P = details::Identity,\n\
|
||||||
typename T = decltype(std::declval<P>()(QString()))>\n\
|
typename T = decltype(std::declval<P>()(QString()))>\n\
|
||||||
rpl::producer<T> operator()(" << producerArgs.join(", ") << ") const {\n\
|
rpl::producer<T> operator()(" << producerArgs.join(", ") << ") const {\n\
|
||||||
return ::Lang::details::template Producer<" << tags.join(", ") << ">::template Combine(" << values.join(", ") << ");\n\
|
return ::Lang::details::Producer<" << tags.join(", ") << ">::template Combine(" << values.join(", ") << ");\n\
|
||||||
}\n\
|
}\n\
|
||||||
\n\
|
\n\
|
||||||
template <\n\
|
template <\n\
|
||||||
typename P = details::Identity,\n\
|
typename P = details::Identity,\n\
|
||||||
typename T = decltype(std::declval<P>()(QString()))>\n\
|
typename T = decltype(std::declval<P>()(QString()))>\n\
|
||||||
T operator()(now_t, " << currentArgs.join(", ") << ") const {\n\
|
T operator()(now_t, " << currentArgs.join(", ") << ") const {\n\
|
||||||
return ::Lang::details::template Producer<" << tags.join(", ") << ">::template Current(" << values.join(", ") << ");\n\
|
return ::Lang::details::Producer<" << tags.join(", ") << ">::template Current(" << values.join(", ") << ");\n\
|
||||||
}\n\
|
}\n\
|
||||||
\n\
|
\n\
|
||||||
LangKey base;\n\
|
LangKey base;\n\
|
||||||
|
@ -307,7 +304,7 @@ void Generator::writeHeaderProducersInstances() {
|
||||||
}
|
}
|
||||||
if (!isPlural || key == ComputePluralKey(entry.keyBase, 0)) {
|
if (!isPlural || key == ComputePluralKey(entry.keyBase, 0)) {
|
||||||
header_->stream() << "\
|
header_->stream() << "\
|
||||||
inline constexpr Producer<" << tags.join(", ") << "> " << (isPlural ? entry.keyBase : key) << "{ LangKey(" << index << ") };\n";
|
inline constexpr phrase<" << tags.join(", ") << "> " << (isPlural ? entry.keyBase : key) << "{ LangKey(" << index << ") };\n";
|
||||||
}
|
}
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
|
@ -672,7 +672,7 @@ void Application::startLocalStorage() {
|
||||||
void Application::forceLogOut(const TextWithEntities &explanation) {
|
void Application::forceLogOut(const TextWithEntities &explanation) {
|
||||||
const auto box = Ui::show(Box<InformBox>(
|
const auto box = Ui::show(Box<InformBox>(
|
||||||
explanation,
|
explanation,
|
||||||
lang(lng_passcode_logout)));
|
tr::lng_passcode_logout(tr::now)));
|
||||||
box->setCloseByEscape(false);
|
box->setCloseByEscape(false);
|
||||||
box->setCloseByOutsideClick(false);
|
box->setCloseByOutsideClick(false);
|
||||||
connect(box, &QObject::destroyed, [=] {
|
connect(box, &QObject::destroyed, [=] {
|
||||||
|
|
|
@ -126,7 +126,7 @@ void Changelogs::addLocalLogs() {
|
||||||
lt_version,
|
lt_version,
|
||||||
QString::fromLatin1(AppVersionStr),
|
QString::fromLatin1(AppVersionStr),
|
||||||
lt_changes,
|
lt_changes,
|
||||||
lang(lng_new_version_minor),
|
tr::lng_new_version_minor(tr::now),
|
||||||
lt_link,
|
lt_link,
|
||||||
qsl("https://desktop.telegram.org/changelog"));
|
qsl("https://desktop.telegram.org/changelog"));
|
||||||
addLocalLog(text.trimmed());
|
addLocalLog(text.trimmed());
|
||||||
|
|
|
@ -100,7 +100,9 @@ UrlClickHandler::UrlClickHandler(const QString &url, bool fullDisplayed)
|
||||||
}
|
}
|
||||||
|
|
||||||
QString UrlClickHandler::copyToClipboardContextItemText() const {
|
QString UrlClickHandler::copyToClipboardContextItemText() const {
|
||||||
return lang(isEmail() ? lng_context_copy_email : lng_context_copy_link);
|
return isEmail()
|
||||||
|
? tr::lng_context_copy_email(tr::now)
|
||||||
|
: tr::lng_context_copy_link(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString UrlClickHandler::url() const {
|
QString UrlClickHandler::url() const {
|
||||||
|
@ -161,8 +163,8 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
|
||||||
: url;
|
: url;
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lang(lng_open_this_link) + qsl("\n\n") + displayUrl,
|
tr::lng_open_this_link(tr::now) + qsl("\n\n") + displayUrl,
|
||||||
lang(lng_open_link),
|
tr::lng_open_link(tr::now),
|
||||||
[=] { Ui::hideLayer(); open(); }),
|
[=] { Ui::hideLayer(); open(); }),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
} else {
|
} else {
|
||||||
|
@ -192,7 +194,7 @@ void BotGameUrlClickHandler::onClick(ClickContext context) const {
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lng_allow_bot_pass(lt_bot_name, _bot->name),
|
lng_allow_bot_pass(lt_bot_name, _bot->name),
|
||||||
lang(lng_allow_bot),
|
tr::lng_allow_bot(tr::now),
|
||||||
callback));
|
callback));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +204,7 @@ auto HiddenUrlClickHandler::getTextEntity() const -> TextEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MentionClickHandler::copyToClipboardContextItemText() const {
|
QString MentionClickHandler::copyToClipboardContextItemText() const {
|
||||||
return lang(lng_context_copy_mention);
|
return tr::lng_context_copy_mention(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MentionClickHandler::onClick(ClickContext context) const {
|
void MentionClickHandler::onClick(ClickContext context) const {
|
||||||
|
@ -241,7 +243,7 @@ QString MentionNameClickHandler::tooltip() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString HashtagClickHandler::copyToClipboardContextItemText() const {
|
QString HashtagClickHandler::copyToClipboardContextItemText() const {
|
||||||
return lang(lng_context_copy_hashtag);
|
return tr::lng_context_copy_hashtag(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HashtagClickHandler::onClick(ClickContext context) const {
|
void HashtagClickHandler::onClick(ClickContext context) const {
|
||||||
|
@ -256,7 +258,7 @@ auto HashtagClickHandler::getTextEntity() const -> TextEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CashtagClickHandler::copyToClipboardContextItemText() const {
|
QString CashtagClickHandler::copyToClipboardContextItemText() const {
|
||||||
return lang(lng_context_copy_hashtag);
|
return tr::lng_context_copy_hashtag(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CashtagClickHandler::onClick(ClickContext context) const {
|
void CashtagClickHandler::onClick(ClickContext context) const {
|
||||||
|
|
|
@ -56,7 +56,7 @@ bool JoinGroupByHash(const Match &match, const QVariant &context) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Core::App().hideMediaView();
|
Core::App().hideMediaView();
|
||||||
Ui::show(Box<InformBox>(lang(lng_group_invite_bad_link)));
|
Ui::show(Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ bool ResolvePrivatePost(const Match &match, const QVariant &context) {
|
||||||
msgId);
|
msgId);
|
||||||
};
|
};
|
||||||
const auto fail = [=] {
|
const auto fail = [=] {
|
||||||
Ui::show(Box<InformBox>(lang(lng_error_post_link_invalid)));
|
Ui::show(Box<InformBox>(tr::lng_error_post_link_invalid(tr::now)));
|
||||||
};
|
};
|
||||||
const auto auth = &Auth();
|
const auto auth = &Auth();
|
||||||
if (const auto channel = auth->data().channelLoaded(channelId)) {
|
if (const auto channel = auth->data().channelLoaded(channelId)) {
|
||||||
|
@ -292,7 +292,7 @@ bool HandleUnknown(const Match &match, const QVariant &context) {
|
||||||
};
|
};
|
||||||
*box = Ui::show(Box<ConfirmBox>(
|
*box = Ui::show(Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_menu_update),
|
tr::lng_menu_update(tr::now),
|
||||||
callback));
|
callback));
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(text));
|
Ui::show(Box<InformBox>(text));
|
||||||
|
|
|
@ -101,7 +101,7 @@ void LaunchWithWarning(const QString &name, HistoryItem *item) {
|
||||||
lt_extension,
|
lt_extension,
|
||||||
rpl::single(Ui::Text::Bold(extension)),
|
rpl::single(Ui::Text::Bold(extension)),
|
||||||
Ui::Text::WithEntities),
|
Ui::Text::WithEntities),
|
||||||
lang(lng_launch_exe_dont_ask),
|
tr::lng_launch_exe_dont_ask(tr::now),
|
||||||
tr::lng_launch_exe_sure(),
|
tr::lng_launch_exe_sure(),
|
||||||
callback));
|
callback));
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = fals
|
||||||
name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : already;
|
name = already.isEmpty() ? (mp3 ? qsl(".mp3") : qsl(".ogg")) : already;
|
||||||
filter = mp3 ? qsl("MP3 Audio (*.mp3);;") : qsl("OGG Opus Audio (*.ogg);;");
|
filter = mp3 ? qsl("MP3 Audio (*.mp3);;") : qsl("OGG Opus Audio (*.ogg);;");
|
||||||
filter += FileDialog::AllFilesFilter();
|
filter += FileDialog::AllFilesFilter();
|
||||||
caption = lang(lng_save_audio);
|
caption = tr::lng_save_audio(tr::now);
|
||||||
prefix = qsl("audio");
|
prefix = qsl("audio");
|
||||||
} else if (data->isVideoFile()) {
|
} else if (data->isVideoFile()) {
|
||||||
name = already.isEmpty() ? data->filename() : already;
|
name = already.isEmpty() ? data->filename() : already;
|
||||||
|
@ -274,7 +274,7 @@ QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = fals
|
||||||
} else {
|
} else {
|
||||||
filter = mimeType.filterString() + qsl(";;") + FileDialog::AllFilesFilter();
|
filter = mimeType.filterString() + qsl(";;") + FileDialog::AllFilesFilter();
|
||||||
}
|
}
|
||||||
caption = lang(lng_save_video);
|
caption = tr::lng_save_video(tr::now);
|
||||||
prefix = qsl("video");
|
prefix = qsl("video");
|
||||||
} else {
|
} else {
|
||||||
name = already.isEmpty() ? data->filename() : already;
|
name = already.isEmpty() ? data->filename() : already;
|
||||||
|
@ -286,7 +286,9 @@ QString documentSaveFilename(const DocumentData *data, bool forceSavingAs = fals
|
||||||
} else {
|
} else {
|
||||||
filter = mimeType.filterString() + qsl(";;") + FileDialog::AllFilesFilter();
|
filter = mimeType.filterString() + qsl(";;") + FileDialog::AllFilesFilter();
|
||||||
}
|
}
|
||||||
caption = lang(data->isAudioFile() ? lng_save_audio_file : lng_save_file);
|
caption = data->isAudioFile()
|
||||||
|
? tr::lng_save_audio_file(tr::now)
|
||||||
|
: tr::lng_save_file(tr::now);
|
||||||
prefix = qsl("doc");
|
prefix = qsl("doc");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1708,9 +1710,9 @@ base::binary_guard ReadImageAsync(
|
||||||
// document->owner().message(contextId));
|
// document->owner().message(contextId));
|
||||||
// };
|
// };
|
||||||
// Ui::show(Box<ConfirmBox>(
|
// Ui::show(Box<ConfirmBox>(
|
||||||
// lang(lng_player_cant_stream),
|
// tr::lng_player_cant_stream(tr::now),
|
||||||
// lang(lng_player_download),
|
// tr::lng_player_download(tr::now),
|
||||||
// lang(lng_cancel),
|
// tr::lng_cancel(tr::now),
|
||||||
// save));
|
// save));
|
||||||
// } else if (IsValidMediaFile(filepath)) {
|
// } else if (IsValidMediaFile(filepath)) {
|
||||||
// File::Launch(filepath);
|
// File::Launch(filepath);
|
||||||
|
|
|
@ -54,7 +54,7 @@ Folder::Folder(not_null<Data::Session*> owner, FolderId id)
|
||||||
: Entry(owner, this)
|
: Entry(owner, this)
|
||||||
, _id(id)
|
, _id(id)
|
||||||
, _chatsList(PinnedDialogsInFolderMaxValue())
|
, _chatsList(PinnedDialogsInFolderMaxValue())
|
||||||
, _name(lang(lng_archived_name)) {
|
, _name(tr::lng_archived_name(tr::now)) {
|
||||||
indexNameParts();
|
indexNameParts();
|
||||||
|
|
||||||
Notify::PeerUpdateViewer(
|
Notify::PeerUpdateViewer(
|
||||||
|
|
|
@ -306,23 +306,23 @@ Image *MediaPhoto::replyPreview() const {
|
||||||
|
|
||||||
QString MediaPhoto::notificationText() const {
|
QString MediaPhoto::notificationText() const {
|
||||||
return WithCaptionNotificationText(
|
return WithCaptionNotificationText(
|
||||||
lang(lng_in_dlg_photo),
|
tr::lng_in_dlg_photo(tr::now),
|
||||||
parent()->originalText().text);
|
parent()->originalText().text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaPhoto::chatListText() const {
|
QString MediaPhoto::chatListText() const {
|
||||||
return WithCaptionDialogsText(
|
return WithCaptionDialogsText(
|
||||||
lang(lng_in_dlg_photo),
|
tr::lng_in_dlg_photo(tr::now),
|
||||||
parent()->originalText().text);
|
parent()->originalText().text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaPhoto::pinnedTextSubstring() const {
|
QString MediaPhoto::pinnedTextSubstring() const {
|
||||||
return lang(lng_action_pinned_media_photo);
|
return tr::lng_action_pinned_media_photo(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextForMimeData MediaPhoto::clipboardText() const {
|
TextForMimeData MediaPhoto::clipboardText() const {
|
||||||
return WithCaptionClipboardText(
|
return WithCaptionClipboardText(
|
||||||
lang(lng_in_dlg_photo),
|
tr::lng_in_dlg_photo(tr::now),
|
||||||
parent()->clipboardText());
|
parent()->clipboardText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,10 +335,10 @@ bool MediaPhoto::allowsEditMedia() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaPhoto::errorTextForForward(not_null<PeerData*> peer) const {
|
QString MediaPhoto::errorTextForForward(not_null<PeerData*> peer) const {
|
||||||
const auto errorKey = Data::RestrictionErrorKey(
|
return Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_media);
|
ChatRestriction::f_send_media
|
||||||
return errorKey ? lang(*errorKey) : QString();
|
).value_or(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MediaPhoto::updateInlineResultMedia(const MTPMessageMedia &media) {
|
bool MediaPhoto::updateInlineResultMedia(const MTPMessageMedia &media) {
|
||||||
|
@ -564,20 +564,20 @@ QString MediaFile::chatListText() const {
|
||||||
}
|
}
|
||||||
const auto type = [&] {
|
const auto type = [&] {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
return lang(lng_in_dlg_video_message);
|
return tr::lng_in_dlg_video_message(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
return qsl("GIF");
|
return qsl("GIF");
|
||||||
} else if (_document->isVideoFile()) {
|
} else if (_document->isVideoFile()) {
|
||||||
return lang(lng_in_dlg_video);
|
return tr::lng_in_dlg_video(tr::now);
|
||||||
} else if (_document->isVoiceMessage()) {
|
} else if (_document->isVoiceMessage()) {
|
||||||
return lang(lng_in_dlg_audio);
|
return tr::lng_in_dlg_audio(tr::now);
|
||||||
} else if (const auto name = _document->composeNameString();
|
} else if (const auto name = _document->composeNameString();
|
||||||
!name.isEmpty()) {
|
!name.isEmpty()) {
|
||||||
return name;
|
return name;
|
||||||
} else if (_document->isAudioFile()) {
|
} else if (_document->isAudioFile()) {
|
||||||
return lang(lng_in_dlg_audio_file);
|
return tr::lng_in_dlg_audio_file(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_in_dlg_file);
|
return tr::lng_in_dlg_file(tr::now);
|
||||||
}();
|
}();
|
||||||
return WithCaptionDialogsText(type, parent()->originalText().text);
|
return WithCaptionDialogsText(type, parent()->originalText().text);
|
||||||
}
|
}
|
||||||
|
@ -585,24 +585,24 @@ QString MediaFile::chatListText() const {
|
||||||
QString MediaFile::notificationText() const {
|
QString MediaFile::notificationText() const {
|
||||||
if (const auto sticker = _document->sticker()) {
|
if (const auto sticker = _document->sticker()) {
|
||||||
return _emoji.isEmpty()
|
return _emoji.isEmpty()
|
||||||
? lang(lng_in_dlg_sticker)
|
? tr::lng_in_dlg_sticker(tr::now)
|
||||||
: lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
: lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
const auto type = [&] {
|
const auto type = [&] {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
return lang(lng_in_dlg_video_message);
|
return tr::lng_in_dlg_video_message(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
return qsl("GIF");
|
return qsl("GIF");
|
||||||
} else if (_document->isVideoFile()) {
|
} else if (_document->isVideoFile()) {
|
||||||
return lang(lng_in_dlg_video);
|
return tr::lng_in_dlg_video(tr::now);
|
||||||
} else if (_document->isVoiceMessage()) {
|
} else if (_document->isVoiceMessage()) {
|
||||||
return lang(lng_in_dlg_audio);
|
return tr::lng_in_dlg_audio(tr::now);
|
||||||
} else if (!_document->filename().isEmpty()) {
|
} else if (!_document->filename().isEmpty()) {
|
||||||
return _document->filename();
|
return _document->filename();
|
||||||
} else if (_document->isAudioFile()) {
|
} else if (_document->isAudioFile()) {
|
||||||
return lang(lng_in_dlg_audio_file);
|
return tr::lng_in_dlg_audio_file(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_in_dlg_file);
|
return tr::lng_in_dlg_file(tr::now);
|
||||||
}();
|
}();
|
||||||
return WithCaptionNotificationText(type, parent()->originalText().text);
|
return WithCaptionNotificationText(type, parent()->originalText().text);
|
||||||
}
|
}
|
||||||
|
@ -612,20 +612,20 @@ QString MediaFile::pinnedTextSubstring() const {
|
||||||
if (!_emoji.isEmpty()) {
|
if (!_emoji.isEmpty()) {
|
||||||
return lng_action_pinned_media_emoji_sticker(lt_emoji, _emoji);
|
return lng_action_pinned_media_emoji_sticker(lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
return lang(lng_action_pinned_media_sticker);
|
return tr::lng_action_pinned_media_sticker(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
return lang(lng_action_pinned_media_video_message);
|
return tr::lng_action_pinned_media_video_message(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_action_pinned_media_gif);
|
return tr::lng_action_pinned_media_gif(tr::now);
|
||||||
} else if (_document->isVideoFile()) {
|
} else if (_document->isVideoFile()) {
|
||||||
return lang(lng_action_pinned_media_video);
|
return tr::lng_action_pinned_media_video(tr::now);
|
||||||
} else if (_document->isVoiceMessage()) {
|
} else if (_document->isVoiceMessage()) {
|
||||||
return lang(lng_action_pinned_media_voice);
|
return tr::lng_action_pinned_media_voice(tr::now);
|
||||||
} else if (_document->isSong()) {
|
} else if (_document->isSong()) {
|
||||||
return lang(lng_action_pinned_media_audio);
|
return tr::lng_action_pinned_media_audio(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_action_pinned_media_file);
|
return tr::lng_action_pinned_media_file(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextForMimeData MediaFile::clipboardText() const {
|
TextForMimeData MediaFile::clipboardText() const {
|
||||||
|
@ -638,20 +638,20 @@ TextForMimeData MediaFile::clipboardText() const {
|
||||||
if (!_emoji.isEmpty()) {
|
if (!_emoji.isEmpty()) {
|
||||||
return lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
return lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
return lang(lng_in_dlg_sticker);
|
return tr::lng_in_dlg_sticker(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
return lang(lng_in_dlg_video_message);
|
return tr::lng_in_dlg_video_message(tr::now);
|
||||||
}
|
}
|
||||||
return qsl("GIF");
|
return qsl("GIF");
|
||||||
} else if (_document->isVideoFile()) {
|
} else if (_document->isVideoFile()) {
|
||||||
return lang(lng_in_dlg_video);
|
return tr::lng_in_dlg_video(tr::now);
|
||||||
} else if (_document->isVoiceMessage()) {
|
} else if (_document->isVoiceMessage()) {
|
||||||
return lang(lng_in_dlg_audio) + addName;
|
return tr::lng_in_dlg_audio(tr::now) + addName;
|
||||||
} else if (_document->isSong()) {
|
} else if (_document->isSong()) {
|
||||||
return lang(lng_in_dlg_audio_file) + addName;
|
return tr::lng_in_dlg_audio_file(tr::now) + addName;
|
||||||
}
|
}
|
||||||
return lang(lng_in_dlg_file) + addName;
|
return tr::lng_in_dlg_file(tr::now) + addName;
|
||||||
}();
|
}();
|
||||||
return WithCaptionClipboardText(
|
return WithCaptionClipboardText(
|
||||||
attachType,
|
attachType,
|
||||||
|
@ -676,29 +676,29 @@ bool MediaFile::forwardedBecomesUnread() const {
|
||||||
|
|
||||||
QString MediaFile::errorTextForForward(not_null<PeerData*> peer) const {
|
QString MediaFile::errorTextForForward(not_null<PeerData*> peer) const {
|
||||||
if (const auto sticker = _document->sticker()) {
|
if (const auto sticker = _document->sticker()) {
|
||||||
if (const auto key = Data::RestrictionErrorKey(
|
if (const auto error = Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_stickers)) {
|
ChatRestriction::f_send_stickers)) {
|
||||||
return lang(*key);
|
return *error;
|
||||||
}
|
}
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
if (const auto key = Data::RestrictionErrorKey(
|
if (const auto error = Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_media)) {
|
ChatRestriction::f_send_media)) {
|
||||||
return lang(*key);
|
return *error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (const auto key = Data::RestrictionErrorKey(
|
if (const auto error = Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_gifs)) {
|
ChatRestriction::f_send_gifs)) {
|
||||||
return lang(*key);
|
return *error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (const auto key = Data::RestrictionErrorKey(
|
} else if (const auto error = Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_media)) {
|
ChatRestriction::f_send_media)) {
|
||||||
return lang(*key);
|
return *error;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -807,15 +807,15 @@ const SharedContact *MediaContact::sharedContact() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaContact::notificationText() const {
|
QString MediaContact::notificationText() const {
|
||||||
return lang(lng_in_dlg_contact);
|
return tr::lng_in_dlg_contact(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaContact::pinnedTextSubstring() const {
|
QString MediaContact::pinnedTextSubstring() const {
|
||||||
return lang(lng_action_pinned_media_contact);
|
return tr::lng_action_pinned_media_contact(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextForMimeData MediaContact::clipboardText() const {
|
TextForMimeData MediaContact::clipboardText() const {
|
||||||
const auto text = qsl("[ ") + lang(lng_in_dlg_contact) + qsl(" ]\n")
|
const auto text = qsl("[ ") + tr::lng_in_dlg_contact(tr::now) + qsl(" ]\n")
|
||||||
+ lng_full_name(
|
+ lng_full_name(
|
||||||
lt_first_name,
|
lt_first_name,
|
||||||
_contact.firstName,
|
_contact.firstName,
|
||||||
|
@ -887,20 +887,20 @@ LocationData *MediaLocation::location() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaLocation::chatListText() const {
|
QString MediaLocation::chatListText() const {
|
||||||
return WithCaptionDialogsText(lang(lng_maps_point), _title);
|
return WithCaptionDialogsText(tr::lng_maps_point(tr::now), _title);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaLocation::notificationText() const {
|
QString MediaLocation::notificationText() const {
|
||||||
return WithCaptionNotificationText(lang(lng_maps_point), _title);
|
return WithCaptionNotificationText(tr::lng_maps_point(tr::now), _title);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaLocation::pinnedTextSubstring() const {
|
QString MediaLocation::pinnedTextSubstring() const {
|
||||||
return lang(lng_action_pinned_media_location);
|
return tr::lng_action_pinned_media_location(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextForMimeData MediaLocation::clipboardText() const {
|
TextForMimeData MediaLocation::clipboardText() const {
|
||||||
auto result = TextForMimeData::Simple(
|
auto result = TextForMimeData::Simple(
|
||||||
qstr("[ ") + lang(lng_maps_point) + qstr(" ]\n"));
|
qstr("[ ") + tr::lng_maps_point(tr::now) + qstr(" ]\n"));
|
||||||
auto titleResult = TextUtilities::ParseEntities(
|
auto titleResult = TextUtilities::ParseEntities(
|
||||||
TextUtilities::Clean(_title),
|
TextUtilities::Clean(_title),
|
||||||
Ui::WebpageTextTitleOptions().flags);
|
Ui::WebpageTextTitleOptions().flags);
|
||||||
|
@ -993,15 +993,15 @@ QString MediaCall::Text(
|
||||||
not_null<HistoryItem*> item,
|
not_null<HistoryItem*> item,
|
||||||
CallFinishReason reason) {
|
CallFinishReason reason) {
|
||||||
if (item->out()) {
|
if (item->out()) {
|
||||||
return lang(reason == CallFinishReason::Missed
|
return (reason == CallFinishReason::Missed)
|
||||||
? lng_call_cancelled
|
? tr::lng_call_cancelled(tr::now)
|
||||||
: lng_call_outgoing);
|
: tr::lng_call_outgoing(tr::now);
|
||||||
} else if (reason == CallFinishReason::Missed) {
|
} else if (reason == CallFinishReason::Missed) {
|
||||||
return lang(lng_call_missed);
|
return tr::lng_call_missed(tr::now);
|
||||||
} else if (reason == CallFinishReason::Busy) {
|
} else if (reason == CallFinishReason::Busy) {
|
||||||
return lang(lng_call_declined);
|
return tr::lng_call_declined(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_call_incoming);
|
return tr::lng_call_incoming(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaWebPage::MediaWebPage(
|
MediaWebPage::MediaWebPage(
|
||||||
|
@ -1141,10 +1141,10 @@ TextForMimeData MediaGame::clipboardText() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaGame::errorTextForForward(not_null<PeerData*> peer) const {
|
QString MediaGame::errorTextForForward(not_null<PeerData*> peer) const {
|
||||||
const auto errorKey = Data::RestrictionErrorKey(
|
return Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_games);
|
ChatRestriction::f_send_games
|
||||||
return errorKey ? lang(*errorKey) : QString();
|
).value_or(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MediaGame::consumeMessageText(const TextWithEntities &text) {
|
bool MediaGame::consumeMessageText(const TextWithEntities &text) {
|
||||||
|
@ -1265,7 +1265,7 @@ QString MediaPoll::pinnedTextSubstring() const {
|
||||||
|
|
||||||
TextForMimeData MediaPoll::clipboardText() const {
|
TextForMimeData MediaPoll::clipboardText() const {
|
||||||
const auto text = qstr("[ ")
|
const auto text = qstr("[ ")
|
||||||
+ lang(lng_in_dlg_poll)
|
+ tr::lng_in_dlg_poll(tr::now)
|
||||||
+ qstr(" : ")
|
+ qstr(" : ")
|
||||||
+ _poll->question
|
+ _poll->question
|
||||||
+ qstr(" ]")
|
+ qstr(" ]")
|
||||||
|
@ -1280,10 +1280,10 @@ TextForMimeData MediaPoll::clipboardText() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MediaPoll::errorTextForForward(not_null<PeerData*> peer) const {
|
QString MediaPoll::errorTextForForward(not_null<PeerData*> peer) const {
|
||||||
const auto errorKey = Data::RestrictionErrorKey(
|
return Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_polls);
|
ChatRestriction::f_send_polls
|
||||||
return errorKey ? lang(*errorKey) : QString();
|
).value_or(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MediaPoll::updateInlineResultMedia(const MTPMessageMedia &media) {
|
bool MediaPoll::updateInlineResultMedia(const MTPMessageMedia &media) {
|
||||||
|
|
|
@ -82,9 +82,9 @@ void PeerClickHandler::onClick(ClickContext context) const {
|
||||||
&& _peer->isChannel()
|
&& _peer->isChannel()
|
||||||
&& controller->activeChatCurrent().peer() != _peer) {
|
&& controller->activeChatCurrent().peer() != _peer) {
|
||||||
if (!_peer->asChannel()->isPublic() && !_peer->asChannel()->amIn()) {
|
if (!_peer->asChannel()->isPublic() && !_peer->asChannel()->amIn()) {
|
||||||
Ui::show(Box<InformBox>(lang(_peer->isMegagroup()
|
Ui::show(Box<InformBox>(_peer->isMegagroup()
|
||||||
? lng_group_not_accessible
|
? tr::lng_group_not_accessible(tr::now)
|
||||||
: lng_channel_not_accessible)));
|
: tr::lng_channel_not_accessible(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
controller->showPeerHistory(
|
controller->showPeerHistory(
|
||||||
_peer,
|
_peer,
|
||||||
|
@ -455,7 +455,7 @@ void PeerData::fillNames() {
|
||||||
appendToIndex(user->username);
|
appendToIndex(user->username);
|
||||||
if (isSelf()) {
|
if (isSelf()) {
|
||||||
const auto english = qsl("Saved messages");
|
const auto english = qsl("Saved messages");
|
||||||
const auto localized = lang(lng_saved_messages);
|
const auto localized = tr::lng_saved_messages(tr::now);
|
||||||
appendToIndex(english);
|
appendToIndex(english);
|
||||||
if (localized != english) {
|
if (localized != english) {
|
||||||
appendToIndex(localized);
|
appendToIndex(localized);
|
||||||
|
@ -709,7 +709,7 @@ std::vector<ChatRestrictions> ListOfRestrictions() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<LangKey> RestrictionErrorKey(
|
std::optional<QString> RestrictionError(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
ChatRestriction restriction) {
|
ChatRestriction restriction) {
|
||||||
using Flag = ChatRestriction;
|
using Flag = ChatRestriction;
|
||||||
|
@ -718,29 +718,29 @@ std::optional<LangKey> RestrictionErrorKey(
|
||||||
switch (restriction) {
|
switch (restriction) {
|
||||||
case Flag::f_send_polls:
|
case Flag::f_send_polls:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_polls_all
|
? tr::lng_restricted_send_polls_all(tr::now)
|
||||||
: lng_restricted_send_polls;
|
: tr::lng_restricted_send_polls(tr::now);
|
||||||
case Flag::f_send_messages:
|
case Flag::f_send_messages:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_message_all
|
? tr::lng_restricted_send_message_all(tr::now)
|
||||||
: lng_restricted_send_message;
|
: tr::lng_restricted_send_message(tr::now);
|
||||||
case Flag::f_send_media:
|
case Flag::f_send_media:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_media_all
|
? tr::lng_restricted_send_media_all(tr::now)
|
||||||
: lng_restricted_send_media;
|
: tr::lng_restricted_send_media(tr::now);
|
||||||
case Flag::f_send_stickers:
|
case Flag::f_send_stickers:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_stickers_all
|
? tr::lng_restricted_send_stickers_all(tr::now)
|
||||||
: lng_restricted_send_stickers;
|
: tr::lng_restricted_send_stickers(tr::now);
|
||||||
case Flag::f_send_gifs:
|
case Flag::f_send_gifs:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_gifs_all
|
? tr::lng_restricted_send_gifs_all(tr::now)
|
||||||
: lng_restricted_send_gifs;
|
: tr::lng_restricted_send_gifs(tr::now);
|
||||||
case Flag::f_send_inline:
|
case Flag::f_send_inline:
|
||||||
case Flag::f_send_games:
|
case Flag::f_send_games:
|
||||||
return all
|
return all
|
||||||
? lng_restricted_send_inline_all
|
? tr::lng_restricted_send_inline_all(tr::now)
|
||||||
: lng_restricted_send_inline;
|
: tr::lng_restricted_send_inline(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("Restriction in Data::RestrictionErrorKey.");
|
Unexpected("Restriction in Data::RestrictionErrorKey.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,7 +380,7 @@ namespace Data {
|
||||||
|
|
||||||
std::vector<ChatRestrictions> ListOfRestrictions();
|
std::vector<ChatRestrictions> ListOfRestrictions();
|
||||||
|
|
||||||
std::optional<LangKey> RestrictionErrorKey(
|
std::optional<QString> RestrictionError(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
ChatRestriction restriction);
|
ChatRestriction restriction);
|
||||||
|
|
||||||
|
|
|
@ -44,13 +44,13 @@ int OnlinePhraseChangeInSeconds(TimeId online, TimeId now) {
|
||||||
|
|
||||||
std::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
|
std::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
|
||||||
if (user->isNotificationsUser()) {
|
if (user->isNotificationsUser()) {
|
||||||
return lang(lng_status_service_notifications);
|
return tr::lng_status_service_notifications(tr::now);
|
||||||
} else if (user->isSupport()) {
|
} else if (user->isSupport()) {
|
||||||
return lang(lng_status_support);
|
return tr::lng_status_support(tr::now);
|
||||||
} else if (user->isBot()) {
|
} else if (user->isBot()) {
|
||||||
return lang(lng_status_bot);
|
return tr::lng_status_bot(tr::now);
|
||||||
} else if (user->isServiceUser()) {
|
} else if (user->isServiceUser()) {
|
||||||
return lang(lng_status_support);
|
return tr::lng_status_support(tr::now);
|
||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
@ -59,16 +59,16 @@ std::optional<QString> OnlineTextCommon(TimeId online, TimeId now) {
|
||||||
if (online <= 0) {
|
if (online <= 0) {
|
||||||
switch (online) {
|
switch (online) {
|
||||||
case 0:
|
case 0:
|
||||||
case -1: return lang(lng_status_offline);
|
case -1: return tr::lng_status_offline(tr::now);
|
||||||
case -2: return lang(lng_status_recently);
|
case -2: return tr::lng_status_recently(tr::now);
|
||||||
case -3: return lang(lng_status_last_week);
|
case -3: return tr::lng_status_last_week(tr::now);
|
||||||
case -4: return lang(lng_status_last_month);
|
case -4: return tr::lng_status_last_month(tr::now);
|
||||||
}
|
}
|
||||||
return (-online > now)
|
return (-online > now)
|
||||||
? lang(lng_status_online)
|
? tr::lng_status_online(tr::now)
|
||||||
: lang(lng_status_recently);
|
: tr::lng_status_recently(tr::now);
|
||||||
} else if (online > now) {
|
} else if (online > now) {
|
||||||
return lang(lng_status_online);
|
return tr::lng_status_online(tr::now);
|
||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ QString OnlineText(TimeId online, TimeId now) {
|
||||||
}
|
}
|
||||||
const auto minutes = (now - online) / 60;
|
const auto minutes = (now - online) / 60;
|
||||||
if (!minutes) {
|
if (!minutes) {
|
||||||
return lang(lng_status_lastseen_now);
|
return tr::lng_status_lastseen_now(tr::now);
|
||||||
} else if (minutes < 60) {
|
} else if (minutes < 60) {
|
||||||
return lng_status_lastseen_minutes(lt_count, minutes);
|
return lng_status_lastseen_minutes(lt_count, minutes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
#include "passport/passport_form_controller.h"
|
#include "passport/passport_form_controller.h"
|
||||||
#include "window/themes/window_theme.h"
|
#include "window/themes/window_theme.h"
|
||||||
#include "lang/lang_keys.h" // lang(lng_deleted) in user name
|
#include "lang/lang_keys.h" // tr::lng_deleted(tr::now) in user name
|
||||||
#include "data/data_media_types.h"
|
#include "data/data_media_types.h"
|
||||||
#include "data/data_folder.h"
|
#include "data/data_folder.h"
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
|
@ -298,7 +298,7 @@ not_null<UserData*> Session::processUser(const MTPUser &data) {
|
||||||
|
|
||||||
result->input = MTP_inputPeerUser(data.vid, MTP_long(0));
|
result->input = MTP_inputPeerUser(data.vid, MTP_long(0));
|
||||||
result->inputUser = MTP_inputUser(data.vid, MTP_long(0));
|
result->inputUser = MTP_inputUser(data.vid, MTP_long(0));
|
||||||
result->setName(lang(lng_deleted), QString(), QString(), QString());
|
result->setName(tr::lng_deleted(tr::now), QString(), QString(), QString());
|
||||||
result->setPhoto(MTP_userProfilePhotoEmpty());
|
result->setPhoto(MTP_userProfilePhotoEmpty());
|
||||||
//result->setFlags(MTPDuser_ClientFlag::f_inaccessible | 0);
|
//result->setFlags(MTPDuser_ClientFlag::f_inaccessible | 0);
|
||||||
result->setFlags(MTPDuser::Flag::f_deleted);
|
result->setFlags(MTPDuser::Flag::f_deleted);
|
||||||
|
@ -342,7 +342,7 @@ not_null<UserData*> Session::processUser(const MTPUser &data) {
|
||||||
result->setPhone(QString());
|
result->setPhone(QString());
|
||||||
update.flags |= UpdateFlag::UserPhoneChanged;
|
update.flags |= UpdateFlag::UserPhoneChanged;
|
||||||
}
|
}
|
||||||
result->setName(lang(lng_deleted), QString(), QString(), QString());
|
result->setName(tr::lng_deleted(tr::now), QString(), QString(), QString());
|
||||||
result->setPhoto(MTP_userProfilePhotoEmpty());
|
result->setPhoto(MTP_userProfilePhotoEmpty());
|
||||||
status = &emptyStatus;
|
status = &emptyStatus;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -105,7 +105,7 @@ InnerWidget::InnerWidget(
|
||||||
, _pinnedShiftAnimation([=](crl::time now) {
|
, _pinnedShiftAnimation([=](crl::time now) {
|
||||||
return pinnedShiftAnimationCallback(now);
|
return pinnedShiftAnimationCallback(now);
|
||||||
})
|
})
|
||||||
, _addContactLnk(this, lang(lng_add_contact_button))
|
, _addContactLnk(this, tr::lng_add_contact_button(tr::now))
|
||||||
, _cancelSearchInChat(this, st::dialogsCancelSearchInPeer)
|
, _cancelSearchInChat(this, st::dialogsCancelSearchInPeer)
|
||||||
, _cancelSearchFromUser(this, st::dialogsCancelSearchInPeer) {
|
, _cancelSearchFromUser(this, st::dialogsCancelSearchInPeer) {
|
||||||
|
|
||||||
|
@ -478,7 +478,12 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(dialogsClip, st::dialogsBg);
|
p.fillRect(dialogsClip, st::dialogsBg);
|
||||||
p.setFont(st::noContactsFont);
|
p.setFont(st::noContactsFont);
|
||||||
p.setPen(st::noContactsColor);
|
p.setPen(st::noContactsColor);
|
||||||
p.drawText(QRect(0, 0, fullWidth, st::noContactsHeight - (session().data().contactsLoaded().current() ? st::noContactsFont->height : 0)), lang(session().data().contactsLoaded().current() ? lng_no_chats : lng_contacts_loading), style::al_center);
|
p.drawText(
|
||||||
|
QRect(0, 0, fullWidth, st::noContactsHeight - (session().data().contactsLoaded().current() ? st::noContactsFont->height : 0)),
|
||||||
|
(session().data().contactsLoaded().current()
|
||||||
|
? tr::lng_no_chats
|
||||||
|
: tr::lng_contacts_loading)(tr::now),
|
||||||
|
style::al_center);
|
||||||
}
|
}
|
||||||
} else if (_state == WidgetState::Filtered) {
|
} else if (_state == WidgetState::Filtered) {
|
||||||
if (!_hashtagResults.empty()) {
|
if (!_hashtagResults.empty()) {
|
||||||
|
@ -557,7 +562,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(0, 0, fullWidth, st::searchedBarHeight, st::searchedBarBg);
|
p.fillRect(0, 0, fullWidth, st::searchedBarHeight, st::searchedBarBg);
|
||||||
p.setFont(st::searchedBarFont);
|
p.setFont(st::searchedBarFont);
|
||||||
p.setPen(st::searchedBarFg);
|
p.setPen(st::searchedBarFg);
|
||||||
p.drawTextLeft(st::searchedBarPosition.x(), st::searchedBarPosition.y(), width(), lang(lng_search_global_results));
|
p.drawTextLeft(st::searchedBarPosition.x(), st::searchedBarPosition.y(), width(), tr::lng_search_global_results(tr::now));
|
||||||
p.translate(0, st::searchedBarHeight);
|
p.translate(0, st::searchedBarHeight);
|
||||||
|
|
||||||
auto skip = peerSearchOffset();
|
auto skip = peerSearchOffset();
|
||||||
|
@ -598,7 +603,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
st::searchedBarPosition.x(),
|
st::searchedBarPosition.x(),
|
||||||
st::searchedBarPosition.y(),
|
st::searchedBarPosition.y(),
|
||||||
width(),
|
width(),
|
||||||
lang(lng_dlg_search_for_messages));
|
tr::lng_dlg_search_for_messages(tr::now));
|
||||||
p.translate(0, st::searchedBarHeight);
|
p.translate(0, st::searchedBarHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,7 +611,7 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
const auto showUnreadInSearchResults = uniqueSearchResults();
|
const auto showUnreadInSearchResults = uniqueSearchResults();
|
||||||
if (!_waitingForSearch || !_searchResults.empty()) {
|
if (!_waitingForSearch || !_searchResults.empty()) {
|
||||||
const auto text = _searchResults.empty()
|
const auto text = _searchResults.empty()
|
||||||
? lang(lng_search_no_results)
|
? tr::lng_search_no_results(tr::now)
|
||||||
: showUnreadInSearchResults
|
: showUnreadInSearchResults
|
||||||
? qsl("Search results")
|
? qsl("Search results")
|
||||||
: lng_search_found_results(
|
: lng_search_found_results(
|
||||||
|
@ -676,8 +681,8 @@ void InnerWidget::paintCollapsedRow(
|
||||||
const auto text = row->folder
|
const auto text = row->folder
|
||||||
? row->folder->chatListName()
|
? row->folder->chatListName()
|
||||||
: (_mode == Dialogs::Mode::Important)
|
: (_mode == Dialogs::Mode::Important)
|
||||||
? (narrow ? "Show" : lang(lng_dialogs_show_all_chats))
|
? (narrow ? "Show" : tr::lng_dialogs_show_all_chats(tr::now))
|
||||||
: (narrow ? "Hide" : lang(lng_dialogs_hide_muted_chats));
|
: (narrow ? "Hide" : tr::lng_dialogs_hide_muted_chats(tr::now));
|
||||||
const auto unread = row->folder
|
const auto unread = row->folder
|
||||||
? row->folder->chatListUnreadCount()
|
? row->folder->chatListUnreadCount()
|
||||||
: (_mode == Dialogs::Mode::Important)
|
: (_mode == Dialogs::Mode::Important)
|
||||||
|
@ -768,7 +773,7 @@ void InnerWidget::paintSearchInChat(Painter &p) const {
|
||||||
p.fillRect(0, 0, width(), top, st::searchedBarBg);
|
p.fillRect(0, 0, width(), top, st::searchedBarBg);
|
||||||
p.setFont(st::searchedBarFont);
|
p.setFont(st::searchedBarFont);
|
||||||
p.setPen(st::searchedBarFg);
|
p.setPen(st::searchedBarFg);
|
||||||
p.drawTextLeft(st::searchedBarPosition.x(), st::searchedBarPosition.y(), width(), lang(lng_dlg_search_in));
|
p.drawTextLeft(st::searchedBarPosition.x(), st::searchedBarPosition.y(), width(), tr::lng_dlg_search_in(tr::now));
|
||||||
|
|
||||||
auto fullRect = QRect(0, top, width(), height - top);
|
auto fullRect = QRect(0, top, width(), height - top);
|
||||||
p.fillRect(fullRect, st::dialogsBg);
|
p.fillRect(fullRect, st::dialogsBg);
|
||||||
|
@ -1699,9 +1704,9 @@ void InnerWidget::fillArchiveSearchMenu(not_null<Ui::PopupMenu*> menu) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto skip = session().settings().skipArchiveInSearch();
|
const auto skip = session().settings().skipArchiveInSearch();
|
||||||
const auto text = lang(skip
|
const auto text = skip
|
||||||
? lng_dialogs_show_archive_in_search
|
? tr::lng_dialogs_show_archive_in_search(tr::now)
|
||||||
: lng_dialogs_skip_archive_in_search);
|
: tr::lng_dialogs_skip_archive_in_search(tr::now);
|
||||||
menu->addAction(text, [=] {
|
menu->addAction(text, [=] {
|
||||||
session().settings().setSkipArchiveInSearch(!skip);
|
session().settings().setSkipArchiveInSearch(!skip);
|
||||||
session().saveSettingsDelayed();
|
session().saveSettingsDelayed();
|
||||||
|
@ -2225,7 +2230,7 @@ void InnerWidget::refreshSearchInChatLabel() {
|
||||||
const auto dialog = [&] {
|
const auto dialog = [&] {
|
||||||
if (const auto peer = _searchInChat.peer()) {
|
if (const auto peer = _searchInChat.peer()) {
|
||||||
if (peer->isSelf()) {
|
if (peer->isSelf()) {
|
||||||
return lang(lng_saved_messages);
|
return tr::lng_saved_messages(tr::now);
|
||||||
}
|
}
|
||||||
return peer->name;
|
return peer->name;
|
||||||
//} else if (const auto feed = _searchInChat.feed()) { // #feed
|
//} else if (const auto feed = _searchInChat.feed()) { // #feed
|
||||||
|
|
|
@ -295,7 +295,7 @@ void paintRow(
|
||||||
const auto promoted = (history && history->useProxyPromotion())
|
const auto promoted = (history && history->useProxyPromotion())
|
||||||
&& !(flags & (Flag::SearchResult/* | Flag::FeedSearchResult*/)); // #feed
|
&& !(flags & (Flag::SearchResult/* | Flag::FeedSearchResult*/)); // #feed
|
||||||
if (promoted) {
|
if (promoted) {
|
||||||
const auto text = lang(lng_proxy_sponsor);
|
const auto text = tr::lng_proxy_sponsor(tr::now);
|
||||||
PaintRowTopRight(p, text, rectForName, active, selected);
|
PaintRowTopRight(p, text, rectForName, active, selected);
|
||||||
} else if (from/* && !(flags & Flag::FeedSearchResult)*/) { // #feed
|
} else if (from/* && !(flags & Flag::FeedSearchResult)*/) { // #feed
|
||||||
if (const auto chatTypeIcon = ChatTypeIcon(from, active, selected)) {
|
if (const auto chatTypeIcon = ChatTypeIcon(from, active, selected)) {
|
||||||
|
@ -329,7 +329,7 @@ void paintRow(
|
||||||
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
|
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
|
||||||
if (history && !history->paintSendAction(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
|
if (history && !history->paintSendAction(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
|
||||||
if (history->cloudDraftTextCache.isEmpty()) {
|
if (history->cloudDraftTextCache.isEmpty()) {
|
||||||
auto draftWrapped = textcmdLink(1, lng_dialogs_text_from_wrapped(lt_from, lang(lng_from_draft)));
|
auto draftWrapped = textcmdLink(1, lng_dialogs_text_from_wrapped(lt_from, tr::lng_from_draft(tr::now)));
|
||||||
auto draftText = supportMode
|
auto draftText = supportMode
|
||||||
? textcmdLink(1, Support::ChatOccupiedString(history))
|
? textcmdLink(1, Support::ChatOccupiedString(history))
|
||||||
: lng_dialogs_text_with_from(lt_from_part, draftWrapped, lt_message, TextUtilities::Clean(draft->textWithTags.text));
|
: lng_dialogs_text_with_from(lt_from_part, draftWrapped, lt_message, TextUtilities::Clean(draft->textWithTags.text));
|
||||||
|
@ -414,7 +414,7 @@ void paintRow(
|
||||||
p.setPen(nameFg);
|
p.setPen(nameFg);
|
||||||
if (flags & Flag::SavedMessages) {
|
if (flags & Flag::SavedMessages) {
|
||||||
p.setFont(st::msgNameFont);
|
p.setFont(st::msgNameFont);
|
||||||
auto text = lang(lng_saved_messages);
|
auto text = tr::lng_saved_messages(tr::now);
|
||||||
auto textWidth = st::msgNameFont->width(text);
|
auto textWidth = st::msgNameFont->width(text);
|
||||||
if (textWidth > rectForName.width()) {
|
if (textWidth > rectForName.width()) {
|
||||||
text = st::msgNameFont->elided(text, rectForName.width());
|
text = st::msgNameFont->elided(text, rectForName.width());
|
||||||
|
|
|
@ -476,7 +476,7 @@ void Widget::checkUpdateStatus() {
|
||||||
if (_updateTelegram) return;
|
if (_updateTelegram) return;
|
||||||
_updateTelegram.create(
|
_updateTelegram.create(
|
||||||
this,
|
this,
|
||||||
lang(lng_update_telegram),
|
tr::lng_update_telegram(tr::now),
|
||||||
st::dialogsUpdateButton,
|
st::dialogsUpdateButton,
|
||||||
st::dialogsInstallUpdate,
|
st::dialogsInstallUpdate,
|
||||||
st::dialogsInstallUpdateOver);
|
st::dialogsInstallUpdateOver);
|
||||||
|
@ -1563,7 +1563,7 @@ void Widget::paintEvent(QPaintEvent *e) {
|
||||||
p.fillRect(0, aboveTop, width(), st::dialogsForwardHeight, st::dialogsForwardBg);
|
p.fillRect(0, aboveTop, width(), st::dialogsForwardHeight, st::dialogsForwardBg);
|
||||||
p.setPen(st::dialogsForwardFg);
|
p.setPen(st::dialogsForwardFg);
|
||||||
p.setFont(st::dialogsForwardFont);
|
p.setFont(st::dialogsForwardFont);
|
||||||
p.drawTextLeft(st::dialogsForwardTextLeft, st::dialogsForwardTextTop, width(), lang(lng_forward_choose));
|
p.drawTextLeft(st::dialogsForwardTextLeft, st::dialogsForwardTextTop, width(), tr::lng_forward_choose(tr::now));
|
||||||
aboveTop += st::dialogsForwardHeight;
|
aboveTop += st::dialogsForwardHeight;
|
||||||
}
|
}
|
||||||
auto above = QRect(0, aboveTop, width(), _scroll->y() - aboveTop);
|
auto above = QRect(0, aboveTop, width(), _scroll->y() - aboveTop);
|
||||||
|
|
|
@ -65,38 +65,38 @@ Content ContentFromState(const ProcessingState &state) {
|
||||||
};
|
};
|
||||||
switch (state.step) {
|
switch (state.step) {
|
||||||
case Step::Initializing:
|
case Step::Initializing:
|
||||||
pushMain(lang(lng_export_state_initializing));
|
pushMain(tr::lng_export_state_initializing(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::DialogsList:
|
case Step::DialogsList:
|
||||||
pushMain(lang(lng_export_state_chats_list));
|
pushMain(tr::lng_export_state_chats_list(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::PersonalInfo:
|
case Step::PersonalInfo:
|
||||||
pushMain(lang(lng_export_option_info));
|
pushMain(tr::lng_export_option_info(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::Userpics:
|
case Step::Userpics:
|
||||||
pushMain(lang(lng_export_state_userpics));
|
pushMain(tr::lng_export_state_userpics(tr::now));
|
||||||
pushBytes(
|
pushBytes(
|
||||||
"userpic" + QString::number(state.entityIndex),
|
"userpic" + QString::number(state.entityIndex),
|
||||||
state.bytesName);
|
state.bytesName);
|
||||||
break;
|
break;
|
||||||
case Step::Contacts:
|
case Step::Contacts:
|
||||||
pushMain(lang(lng_export_option_contacts));
|
pushMain(tr::lng_export_option_contacts(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::Sessions:
|
case Step::Sessions:
|
||||||
pushMain(lang(lng_export_option_sessions));
|
pushMain(tr::lng_export_option_sessions(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::OtherData:
|
case Step::OtherData:
|
||||||
pushMain(lang(lng_export_option_other));
|
pushMain(tr::lng_export_option_other(tr::now));
|
||||||
break;
|
break;
|
||||||
case Step::Dialogs:
|
case Step::Dialogs:
|
||||||
pushMain(lang(lng_export_state_chats));
|
pushMain(tr::lng_export_state_chats(tr::now));
|
||||||
push(
|
push(
|
||||||
"chat" + QString::number(state.entityIndex),
|
"chat" + QString::number(state.entityIndex),
|
||||||
(state.entityName.isEmpty()
|
(state.entityName.isEmpty()
|
||||||
? lang(lng_deleted)
|
? tr::lng_deleted(tr::now)
|
||||||
: (state.entityType == ProcessingState::EntityType::Chat)
|
: (state.entityType == ProcessingState::EntityType::Chat)
|
||||||
? state.entityName
|
? state.entityName
|
||||||
: lang(lng_saved_messages)),
|
: tr::lng_saved_messages(tr::now)),
|
||||||
(state.itemCount > 0
|
(state.itemCount > 0
|
||||||
? (QString::number(state.itemIndex)
|
? (QString::number(state.itemIndex)
|
||||||
+ " / "
|
+ " / "
|
||||||
|
|
|
@ -52,7 +52,7 @@ void SuggestBox::prepare() {
|
||||||
|
|
||||||
const auto content = Ui::CreateChild<Ui::FlatLabel>(
|
const auto content = Ui::CreateChild<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_export_suggest_text),
|
tr::lng_export_suggest_text(tr::now),
|
||||||
st::boxLabel);
|
st::boxLabel);
|
||||||
widthValue(
|
widthValue(
|
||||||
) | rpl::start_with_next([=](int width) {
|
) | rpl::start_with_next([=](int width) {
|
||||||
|
@ -72,17 +72,14 @@ void SuggestBox::prepare() {
|
||||||
|
|
||||||
Environment PrepareEnvironment() {
|
Environment PrepareEnvironment() {
|
||||||
auto result = Environment();
|
auto result = Environment();
|
||||||
const auto utfLang = [](LangKey key) {
|
|
||||||
return lang(key).toUtf8();
|
|
||||||
};
|
|
||||||
result.internalLinksDomain = Global::InternalLinksDomain();
|
result.internalLinksDomain = Global::InternalLinksDomain();
|
||||||
result.aboutTelegram = utfLang(lng_export_about_telegram);
|
result.aboutTelegram = tr::lng_export_about_telegram(tr::now).toUtf8();
|
||||||
result.aboutContacts = utfLang(lng_export_about_contacts);
|
result.aboutContacts = tr::lng_export_about_contacts(tr::now).toUtf8();
|
||||||
result.aboutFrequent = utfLang(lng_export_about_frequent);
|
result.aboutFrequent = tr::lng_export_about_frequent(tr::now).toUtf8();
|
||||||
result.aboutSessions = utfLang(lng_export_about_sessions);
|
result.aboutSessions = tr::lng_export_about_sessions(tr::now).toUtf8();
|
||||||
result.aboutWebSessions = utfLang(lng_export_about_web_sessions);
|
result.aboutWebSessions = tr::lng_export_about_web_sessions(tr::now).toUtf8();
|
||||||
result.aboutChats = utfLang(lng_export_about_chats);
|
result.aboutChats = tr::lng_export_about_chats(tr::now).toUtf8();
|
||||||
result.aboutLeftChats = utfLang(lng_export_about_left_chats);
|
result.aboutLeftChats = tr::lng_export_about_left_chats(tr::now).toUtf8();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,7 +188,7 @@ void PanelController::showError(const ApiErrorState &error) {
|
||||||
LOG(("Export Info: API Error '%1'.").arg(error.data.type()));
|
LOG(("Export Info: API Error '%1'.").arg(error.data.type()));
|
||||||
|
|
||||||
if (error.data.type() == qstr("TAKEOUT_INVALID")) {
|
if (error.data.type() == qstr("TAKEOUT_INVALID")) {
|
||||||
showError(lang(lng_export_invalid));
|
showError(tr::lng_export_invalid(tr::now));
|
||||||
} else if (error.data.type().startsWith(qstr("TAKEOUT_INIT_DELAY_"))) {
|
} else if (error.data.type().startsWith(qstr("TAKEOUT_INIT_DELAY_"))) {
|
||||||
const auto seconds = std::max(error.data.type().mid(
|
const auto seconds = std::max(error.data.type().mid(
|
||||||
qstr("TAKEOUT_INIT_DELAY_").size()).toInt(), 1);
|
qstr("TAKEOUT_INIT_DELAY_").size()).toInt(), 1);
|
||||||
|
@ -200,7 +197,7 @@ void PanelController::showError(const ApiErrorState &error) {
|
||||||
const auto hours = seconds / 3600;
|
const auto hours = seconds / 3600;
|
||||||
const auto hoursText = [&] {
|
const auto hoursText = [&] {
|
||||||
if (hours <= 0) {
|
if (hours <= 0) {
|
||||||
return lang(lng_export_delay_less_than_hour);
|
return tr::lng_export_delay_less_than_hour(tr::now);
|
||||||
}
|
}
|
||||||
return lng_export_delay_hours(lt_count, hours);
|
return lng_export_delay_hours(lt_count, hours);
|
||||||
}();
|
}();
|
||||||
|
@ -316,8 +313,8 @@ void PanelController::stopWithConfirmation(FnMut<void()> callback) {
|
||||||
const auto hidden = _panel->isHidden();
|
const auto hidden = _panel->isHidden();
|
||||||
const auto old = _confirmStopBox;
|
const auto old = _confirmStopBox;
|
||||||
auto box = Box<ConfirmBox>(
|
auto box = Box<ConfirmBox>(
|
||||||
lang(lng_export_sure_stop),
|
tr::lng_export_sure_stop(tr::now),
|
||||||
lang(lng_export_stop),
|
tr::lng_export_stop(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
std::move(stop));
|
std::move(stop));
|
||||||
_confirmStopBox = box.data();
|
_confirmStopBox = box.data();
|
||||||
|
|
|
@ -245,7 +245,7 @@ ProgressWidget::ProgressWidget(
|
||||||
_about = _body->add(
|
_about = _body->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_export_progress),
|
tr::lng_export_progress(tr::now),
|
||||||
st::exportAboutLabel),
|
st::exportAboutLabel),
|
||||||
st::exportAboutPadding);
|
st::exportAboutPadding);
|
||||||
|
|
||||||
|
@ -307,13 +307,13 @@ void ProgressWidget::updateState(Content &&content) {
|
||||||
|
|
||||||
void ProgressWidget::showDone() {
|
void ProgressWidget::showDone() {
|
||||||
_cancel = nullptr;
|
_cancel = nullptr;
|
||||||
_about->setText(lang(lng_export_about_done));
|
_about->setText(tr::lng_export_about_done(tr::now));
|
||||||
_done = base::make_unique_q<Ui::RoundButton>(
|
_done = base::make_unique_q<Ui::RoundButton>(
|
||||||
this,
|
this,
|
||||||
tr::lng_export_done(),
|
tr::lng_export_done(),
|
||||||
st::exportDoneButton);
|
st::exportDoneButton);
|
||||||
const auto desired = std::min(
|
const auto desired = std::min(
|
||||||
st::exportDoneButton.font->width(lang(lng_export_done).toUpper())
|
st::exportDoneButton.font->width(tr::lng_export_done(tr::now).toUpper())
|
||||||
+ st::exportDoneButton.height
|
+ st::exportDoneButton.height
|
||||||
- st::exportDoneButton.font->height,
|
- st::exportDoneButton.font->height,
|
||||||
st::exportPanelSize.width() - 2 * st::exportCancelBottom);
|
st::exportPanelSize.width() - 2 * st::exportCancelBottom);
|
||||||
|
|
|
@ -135,35 +135,38 @@ void SettingsWidget::setupFullExportOptions(
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
addOptionWithAbout(
|
addOptionWithAbout(
|
||||||
container,
|
container,
|
||||||
lng_export_option_info,
|
tr::lng_export_option_info(tr::now),
|
||||||
Type::PersonalInfo | Type::Userpics,
|
Type::PersonalInfo | Type::Userpics,
|
||||||
lng_export_option_info_about);
|
tr::lng_export_option_info_about(tr::now));
|
||||||
addOptionWithAbout(
|
addOptionWithAbout(
|
||||||
container,
|
container,
|
||||||
lng_export_option_contacts,
|
tr::lng_export_option_contacts(tr::now),
|
||||||
Type::Contacts,
|
Type::Contacts,
|
||||||
lng_export_option_contacts_about);
|
tr::lng_export_option_contacts_about(tr::now));
|
||||||
addHeader(container, lng_export_header_chats);
|
addHeader(container, tr::lng_export_header_chats(tr::now));
|
||||||
addOption(
|
addOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_personal_chats,
|
tr::lng_export_option_personal_chats(tr::now),
|
||||||
Type::PersonalChats);
|
Type::PersonalChats);
|
||||||
addOption(container, lng_export_option_bot_chats, Type::BotChats);
|
addOption(
|
||||||
|
container,
|
||||||
|
tr::lng_export_option_bot_chats(tr::now),
|
||||||
|
Type::BotChats);
|
||||||
addChatOption(
|
addChatOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_private_groups,
|
tr::lng_export_option_private_groups(tr::now),
|
||||||
Type::PrivateGroups);
|
Type::PrivateGroups);
|
||||||
addChatOption(
|
addChatOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_private_channels,
|
tr::lng_export_option_private_channels(tr::now),
|
||||||
Type::PrivateChannels);
|
Type::PrivateChannels);
|
||||||
addChatOption(
|
addChatOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_public_groups,
|
tr::lng_export_option_public_groups(tr::now),
|
||||||
Type::PublicGroups);
|
Type::PublicGroups);
|
||||||
addChatOption(
|
addChatOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_public_channels,
|
tr::lng_export_option_public_channels(tr::now),
|
||||||
Type::PublicChannels);
|
Type::PublicChannels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +181,7 @@ void SettingsWidget::setupMediaOptions(
|
||||||
container,
|
container,
|
||||||
object_ptr<Ui::VerticalLayout>(container)));
|
object_ptr<Ui::VerticalLayout>(container)));
|
||||||
const auto media = mediaWrap->entity();
|
const auto media = mediaWrap->entity();
|
||||||
addHeader(media, lng_export_header_media);
|
addHeader(media, tr::lng_export_header_media(tr::now));
|
||||||
addMediaOptions(media);
|
addMediaOptions(media);
|
||||||
|
|
||||||
value() | rpl::map([](const Settings &data) {
|
value() | rpl::map([](const Settings &data) {
|
||||||
|
@ -201,17 +204,17 @@ void SettingsWidget::setupMediaOptions(
|
||||||
|
|
||||||
void SettingsWidget::setupOtherOptions(
|
void SettingsWidget::setupOtherOptions(
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
addHeader(container, lng_export_header_other);
|
addHeader(container, tr::lng_export_header_other(tr::now));
|
||||||
addOptionWithAbout(
|
addOptionWithAbout(
|
||||||
container,
|
container,
|
||||||
lng_export_option_sessions,
|
tr::lng_export_option_sessions(tr::now),
|
||||||
Type::Sessions,
|
Type::Sessions,
|
||||||
lng_export_option_sessions_about);
|
tr::lng_export_option_sessions_about(tr::now));
|
||||||
addOptionWithAbout(
|
addOptionWithAbout(
|
||||||
container,
|
container,
|
||||||
lng_export_option_other,
|
tr::lng_export_option_other(tr::now),
|
||||||
Type::OtherData,
|
Type::OtherData,
|
||||||
lng_export_option_other_about);
|
tr::lng_export_option_other_about(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWidget::setupPathAndFormat(
|
void SettingsWidget::setupPathAndFormat(
|
||||||
|
@ -228,20 +231,20 @@ void SettingsWidget::setupPathAndFormat(
|
||||||
data.format = format;
|
data.format = format;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const auto addFormatOption = [&](LangKey key, Format format) {
|
const auto addFormatOption = [&](QString label, Format format) {
|
||||||
const auto radio = container->add(
|
const auto radio = container->add(
|
||||||
object_ptr<Ui::Radioenum<Format>>(
|
object_ptr<Ui::Radioenum<Format>>(
|
||||||
container,
|
container,
|
||||||
formatGroup,
|
formatGroup,
|
||||||
format,
|
format,
|
||||||
lang(key),
|
label,
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::exportSettingPadding);
|
st::exportSettingPadding);
|
||||||
};
|
};
|
||||||
addHeader(container, lng_export_header_format);
|
addHeader(container, tr::lng_export_header_format(tr::now));
|
||||||
addLocationLabel(container);
|
addLocationLabel(container);
|
||||||
addFormatOption(lng_export_option_html, Format::Html);
|
addFormatOption(tr::lng_export_option_html(tr::now), Format::Html);
|
||||||
addFormatOption(lng_export_option_json, Format::Json);
|
addFormatOption(tr::lng_export_option_json(tr::now), Format::Json);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWidget::addLocationLabel(
|
void SettingsWidget::addLocationLabel(
|
||||||
|
@ -444,23 +447,23 @@ not_null<Ui::RpWidget*> SettingsWidget::setupButtons(
|
||||||
|
|
||||||
void SettingsWidget::addHeader(
|
void SettingsWidget::addHeader(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key) {
|
const QString &text) {
|
||||||
container->add(
|
container->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
container,
|
container,
|
||||||
lang(key),
|
text,
|
||||||
st::exportHeaderLabel),
|
st::exportHeaderLabel),
|
||||||
st::exportHeaderPadding);
|
st::exportHeaderPadding);
|
||||||
}
|
}
|
||||||
|
|
||||||
not_null<Ui::Checkbox*> SettingsWidget::addOption(
|
not_null<Ui::Checkbox*> SettingsWidget::addOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types) {
|
Types types) {
|
||||||
const auto checkbox = container->add(
|
const auto checkbox = container->add(
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
container,
|
container,
|
||||||
lang(key),
|
text,
|
||||||
((readData().types & types) == types),
|
((readData().types & types) == types),
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::exportSettingPadding);
|
st::exportSettingPadding);
|
||||||
|
@ -479,14 +482,14 @@ not_null<Ui::Checkbox*> SettingsWidget::addOption(
|
||||||
|
|
||||||
not_null<Ui::Checkbox*> SettingsWidget::addOptionWithAbout(
|
not_null<Ui::Checkbox*> SettingsWidget::addOptionWithAbout(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types,
|
Types types,
|
||||||
LangKey about) {
|
const QString &about) {
|
||||||
const auto result = addOption(container, key, types);
|
const auto result = addOption(container, text, types);
|
||||||
const auto label = container->add(
|
const auto label = container->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
container,
|
container,
|
||||||
lang(about),
|
about,
|
||||||
st::exportAboutOptionLabel),
|
st::exportAboutOptionLabel),
|
||||||
st::exportAboutOptionPadding);
|
st::exportAboutOptionPadding);
|
||||||
return result;
|
return result;
|
||||||
|
@ -494,15 +497,15 @@ not_null<Ui::Checkbox*> SettingsWidget::addOptionWithAbout(
|
||||||
|
|
||||||
void SettingsWidget::addChatOption(
|
void SettingsWidget::addChatOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types) {
|
Types types) {
|
||||||
const auto checkbox = addOption(container, key, types);
|
const auto checkbox = addOption(container, text, types);
|
||||||
const auto onlyMy = container->add(
|
const auto onlyMy = container->add(
|
||||||
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
object_ptr<Ui::SlideWrap<Ui::Checkbox>>(
|
||||||
container,
|
container,
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
container,
|
container,
|
||||||
lang(lng_export_option_only_my),
|
tr::lng_export_option_only_my(tr::now),
|
||||||
((readData().fullChats & types) != types),
|
((readData().fullChats & types) != types),
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::exportSubSettingPadding));
|
st::exportSubSettingPadding));
|
||||||
|
@ -528,36 +531,45 @@ void SettingsWidget::addChatOption(
|
||||||
|
|
||||||
void SettingsWidget::addMediaOptions(
|
void SettingsWidget::addMediaOptions(
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
addMediaOption(container, lng_export_option_photos, MediaType::Photo);
|
|
||||||
addMediaOption(
|
addMediaOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_video_files,
|
tr::lng_export_option_photos(tr::now),
|
||||||
|
MediaType::Photo);
|
||||||
|
addMediaOption(
|
||||||
|
container,
|
||||||
|
tr::lng_export_option_video_files(tr::now),
|
||||||
MediaType::Video);
|
MediaType::Video);
|
||||||
addMediaOption(
|
addMediaOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_voice_messages,
|
tr::lng_export_option_voice_messages(tr::now),
|
||||||
MediaType::VoiceMessage);
|
MediaType::VoiceMessage);
|
||||||
addMediaOption(
|
addMediaOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_video_messages,
|
tr::lng_export_option_video_messages(tr::now),
|
||||||
MediaType::VideoMessage);
|
MediaType::VideoMessage);
|
||||||
addMediaOption(
|
addMediaOption(
|
||||||
container,
|
container,
|
||||||
lng_export_option_stickers,
|
tr::lng_export_option_stickers(tr::now),
|
||||||
MediaType::Sticker);
|
MediaType::Sticker);
|
||||||
addMediaOption(container, lng_export_option_gifs, MediaType::GIF);
|
addMediaOption(
|
||||||
addMediaOption(container, lng_export_option_files, MediaType::File);
|
container,
|
||||||
|
tr::lng_export_option_gifs(tr::now),
|
||||||
|
MediaType::GIF);
|
||||||
|
addMediaOption(
|
||||||
|
container,
|
||||||
|
tr::lng_export_option_files(tr::now),
|
||||||
|
MediaType::File);
|
||||||
addSizeSlider(container);
|
addSizeSlider(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsWidget::addMediaOption(
|
void SettingsWidget::addMediaOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
MediaType type) {
|
MediaType type) {
|
||||||
const auto checkbox = container->add(
|
const auto checkbox = container->add(
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
container,
|
container,
|
||||||
lang(key),
|
text,
|
||||||
((readData().media.types & type) == type),
|
((readData().media.types & type) == type),
|
||||||
st::defaultBoxCheckbox),
|
st::defaultBoxCheckbox),
|
||||||
st::exportSettingPadding);
|
st::exportSettingPadding);
|
||||||
|
@ -675,7 +687,7 @@ void SettingsWidget::chooseFolder() {
|
||||||
};
|
};
|
||||||
FileDialog::GetFolder(
|
FileDialog::GetFolder(
|
||||||
this,
|
this,
|
||||||
lang(lng_export_folder),
|
tr::lng_export_folder(tr::now),
|
||||||
readData().path,
|
readData().path,
|
||||||
callback);
|
callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "export/export_settings.h"
|
#include "export/export_settings.h"
|
||||||
#include "ui/rp_widget.h"
|
#include "ui/rp_widget.h"
|
||||||
|
|
||||||
enum LangKey : int;
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class VerticalLayout;
|
class VerticalLayout;
|
||||||
class Checkbox;
|
class Checkbox;
|
||||||
|
@ -55,24 +53,24 @@ private:
|
||||||
void setupPathAndFormat(not_null<Ui::VerticalLayout*> container);
|
void setupPathAndFormat(not_null<Ui::VerticalLayout*> container);
|
||||||
void addHeader(
|
void addHeader(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key);
|
const QString &text);
|
||||||
not_null<Ui::Checkbox*> addOption(
|
not_null<Ui::Checkbox*> addOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types);
|
Types types);
|
||||||
not_null<Ui::Checkbox*> addOptionWithAbout(
|
not_null<Ui::Checkbox*> addOptionWithAbout(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types,
|
Types types,
|
||||||
LangKey about);
|
const QString &about);
|
||||||
void addChatOption(
|
void addChatOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
Types types);
|
Types types);
|
||||||
void addMediaOptions(not_null<Ui::VerticalLayout*> container);
|
void addMediaOptions(not_null<Ui::VerticalLayout*> container);
|
||||||
void addMediaOption(
|
void addMediaOption(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
LangKey key,
|
const QString &text,
|
||||||
MediaType type);
|
MediaType type);
|
||||||
void addSizeSlider(not_null<Ui::VerticalLayout*> container);
|
void addSizeSlider(not_null<Ui::VerticalLayout*> container);
|
||||||
void addLocationLabel(
|
void addLocationLabel(
|
||||||
|
|
|
@ -41,7 +41,7 @@ void TopBar::updateData(Content &&content) {
|
||||||
const auto &row = content.rows[0];
|
const auto &row = content.rows[0];
|
||||||
const auto clean = &TextUtilities::Clean;
|
const auto clean = &TextUtilities::Clean;
|
||||||
_info->setRichText(textcmdStartSemibold()
|
_info->setRichText(textcmdStartSemibold()
|
||||||
+ clean(lang(lng_export_progress_title))
|
+ clean(tr::lng_export_progress_title(tr::now))
|
||||||
+ textcmdStopSemibold()
|
+ textcmdStopSemibold()
|
||||||
+ QString::fromUtf8(" \xe2\x80\x93 ")
|
+ QString::fromUtf8(" \xe2\x80\x93 ")
|
||||||
+ clean(row.label)
|
+ clean(row.label)
|
||||||
|
|
|
@ -84,7 +84,7 @@ void activateBotCommand(
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ButtonType::Buy: {
|
case ButtonType::Buy: {
|
||||||
Ui::show(Box<InformBox>(lang(lng_payments_not_supported)));
|
Ui::show(Box<InformBox>(tr::lng_payments_not_supported(tr::now)));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ButtonType::Url: {
|
case ButtonType::Url: {
|
||||||
|
@ -104,14 +104,14 @@ void activateBotCommand(
|
||||||
|
|
||||||
case ButtonType::RequestLocation: {
|
case ButtonType::RequestLocation: {
|
||||||
hideSingleUseKeyboard(msg);
|
hideSingleUseKeyboard(msg);
|
||||||
Ui::show(Box<InformBox>(lang(lng_bot_share_location_unavailable)));
|
Ui::show(Box<InformBox>(tr::lng_bot_share_location_unavailable(tr::now)));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ButtonType::RequestPhone: {
|
case ButtonType::RequestPhone: {
|
||||||
hideSingleUseKeyboard(msg);
|
hideSingleUseKeyboard(msg);
|
||||||
const auto msgId = msg->id;
|
const auto msgId = msg->id;
|
||||||
const auto history = msg->history();
|
const auto history = msg->history();
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_bot_share_phone), lang(lng_bot_share_phone_confirm), [=] {
|
Ui::show(Box<ConfirmBox>(tr::lng_bot_share_phone(tr::now), tr::lng_bot_share_phone_confirm(tr::now), [=] {
|
||||||
Ui::showPeerHistory(history, ShowAtTheEndMsgId);
|
Ui::showPeerHistory(history, ShowAtTheEndMsgId);
|
||||||
auto options = ApiWrap::SendOptions(history);
|
auto options = ApiWrap::SendOptions(history);
|
||||||
options.replyTo = msgId;
|
options.replyTo = msgId;
|
||||||
|
|
|
@ -223,7 +223,7 @@ void FilterBox::Inner::createControls(const std::vector<not_null<UserData*>> &ad
|
||||||
|
|
||||||
void FilterBox::Inner::createAllActionsCheckbox(const FilterValue &filter) {
|
void FilterBox::Inner::createAllActionsCheckbox(const FilterValue &filter) {
|
||||||
auto checked = (filter.flags == 0);
|
auto checked = (filter.flags == 0);
|
||||||
_allFlags = addRow(object_ptr<Ui::Checkbox>(this, lang(lng_admin_log_filter_all_actions), checked, st::adminLogFilterCheckbox), st::adminLogFilterCheckbox.margin.top());
|
_allFlags = addRow(object_ptr<Ui::Checkbox>(this, tr::lng_admin_log_filter_all_actions(tr::now), checked, st::adminLogFilterCheckbox), st::adminLogFilterCheckbox.margin.top());
|
||||||
_allFlags->checkedChanges(
|
_allFlags->checkedChanges(
|
||||||
) | rpl::start_with_next([=](bool checked) {
|
) | rpl::start_with_next([=](bool checked) {
|
||||||
if (!std::exchange(_restoringInvariant, true)) {
|
if (!std::exchange(_restoringInvariant, true)) {
|
||||||
|
@ -266,21 +266,21 @@ void FilterBox::Inner::createActionsCheckboxes(const FilterValue &filter) {
|
||||||
};
|
};
|
||||||
auto isGroup = _channel->isMegagroup();
|
auto isGroup = _channel->isMegagroup();
|
||||||
if (isGroup) {
|
if (isGroup) {
|
||||||
addFlag(Flag::f_ban | Flag::f_unban | Flag::f_kick | Flag::f_unkick, lang(lng_admin_log_filter_restrictions));
|
addFlag(Flag::f_ban | Flag::f_unban | Flag::f_kick | Flag::f_unkick, tr::lng_admin_log_filter_restrictions(tr::now));
|
||||||
}
|
}
|
||||||
addFlag(Flag::f_promote | Flag::f_demote, lang(lng_admin_log_filter_admins_new));
|
addFlag(Flag::f_promote | Flag::f_demote, tr::lng_admin_log_filter_admins_new(tr::now));
|
||||||
addFlag(Flag::f_join | Flag::f_invite, lang(lng_admin_log_filter_members_new));
|
addFlag(Flag::f_join | Flag::f_invite, tr::lng_admin_log_filter_members_new(tr::now));
|
||||||
addFlag(Flag::f_info | Flag::f_settings, lang(_channel->isMegagroup() ? lng_admin_log_filter_info_group : lng_admin_log_filter_info_channel));
|
addFlag(Flag::f_info | Flag::f_settings, _channel->isMegagroup() ? tr::lng_admin_log_filter_info_group(tr::now) : tr::lng_admin_log_filter_info_channel(tr::now));
|
||||||
addFlag(Flag::f_delete, lang(lng_admin_log_filter_messages_deleted));
|
addFlag(Flag::f_delete, tr::lng_admin_log_filter_messages_deleted(tr::now));
|
||||||
addFlag(Flag::f_edit, lang(lng_admin_log_filter_messages_edited));
|
addFlag(Flag::f_edit, tr::lng_admin_log_filter_messages_edited(tr::now));
|
||||||
if (isGroup) {
|
if (isGroup) {
|
||||||
addFlag(Flag::f_pinned, lang(lng_admin_log_filter_messages_pinned));
|
addFlag(Flag::f_pinned, tr::lng_admin_log_filter_messages_pinned(tr::now));
|
||||||
}
|
}
|
||||||
addFlag(Flag::f_leave, lang(lng_admin_log_filter_members_removed));
|
addFlag(Flag::f_leave, tr::lng_admin_log_filter_members_removed(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilterBox::Inner::createAllUsersCheckbox(const FilterValue &filter) {
|
void FilterBox::Inner::createAllUsersCheckbox(const FilterValue &filter) {
|
||||||
_allUsers = addRow(object_ptr<Ui::Checkbox>(this, lang(lng_admin_log_filter_all_admins), filter.allUsers, st::adminLogFilterCheckbox), st::adminLogFilterSkip);
|
_allUsers = addRow(object_ptr<Ui::Checkbox>(this, tr::lng_admin_log_filter_all_admins(tr::now), filter.allUsers, st::adminLogFilterCheckbox), st::adminLogFilterSkip);
|
||||||
_allUsers->checkedChanges(
|
_allUsers->checkedChanges(
|
||||||
) | rpl::start_with_next([=](bool checked) {
|
) | rpl::start_with_next([=](bool checked) {
|
||||||
if (checked && !std::exchange(_restoringInvariant, true)) {
|
if (checked && !std::exchange(_restoringInvariant, true)) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "auth_session.h"
|
#include "auth_session.h"
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
|
#include "ui/text/text_utilities.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "boxes/peers/edit_participant_box.h"
|
#include "boxes/peers/edit_participant_box.h"
|
||||||
|
@ -451,11 +452,17 @@ void InnerWidget::updateEmptyText() {
|
||||||
options.flags |= TextParseMarkdown;
|
options.flags |= TextParseMarkdown;
|
||||||
auto hasSearch = !_searchQuery.isEmpty();
|
auto hasSearch = !_searchQuery.isEmpty();
|
||||||
auto hasFilter = (_filter.flags != 0) || !_filter.allUsers;
|
auto hasFilter = (_filter.flags != 0) || !_filter.allUsers;
|
||||||
auto text = TextWithEntities { lang((hasSearch || hasFilter) ? lng_admin_log_no_results_title : lng_admin_log_no_events_title) };
|
auto text = Ui::Text::Bold((hasSearch || hasFilter)
|
||||||
text.entities.append(EntityInText(EntityType::Bold, 0, text.text.size()));
|
? tr::lng_admin_log_no_results_title(tr::now)
|
||||||
|
: tr::lng_admin_log_no_events_title(tr::now));
|
||||||
auto description = hasSearch
|
auto description = hasSearch
|
||||||
? lng_admin_log_no_results_search_text(lt_query, TextUtilities::Clean(_searchQuery))
|
? tr::lng_admin_log_no_results_search_text(
|
||||||
: lang(hasFilter ? lng_admin_log_no_results_text : lng_admin_log_no_events_text);
|
tr::now,
|
||||||
|
lt_query,
|
||||||
|
TextUtilities::Clean(_searchQuery))
|
||||||
|
: hasFilter
|
||||||
|
? tr::lng_admin_log_no_results_text(tr::now)
|
||||||
|
: tr::lng_admin_log_no_events_text(tr::now);
|
||||||
text.text.append(qstr("\n\n") + description);
|
text.text.append(qstr("\n\n") + description);
|
||||||
_emptyText.setMarkedText(st::defaultTextStyle, text, options);
|
_emptyText.setMarkedText(st::defaultTextStyle, text, options);
|
||||||
}
|
}
|
||||||
|
@ -994,22 +1001,22 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
auto lnkIsAudio = lnkDocument ? lnkDocument->document()->isAudioFile() : false;
|
auto lnkIsAudio = lnkDocument ? lnkDocument->document()->isAudioFile() : false;
|
||||||
if (lnkPhoto || lnkDocument) {
|
if (lnkPhoto || lnkDocument) {
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
_menu->addAction(lang(lng_context_copy_selected), [=] {
|
_menu->addAction(tr::lng_context_copy_selected(tr::now), [=] {
|
||||||
copySelectedText();
|
copySelectedText();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (lnkPhoto) {
|
if (lnkPhoto) {
|
||||||
const auto photo = lnkPhoto->photo();
|
const auto photo = lnkPhoto->photo();
|
||||||
_menu->addAction(lang(lng_context_save_image), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
_menu->addAction(tr::lng_context_save_image(tr::now), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
||||||
savePhotoToFile(photo);
|
savePhotoToFile(photo);
|
||||||
}));
|
}));
|
||||||
_menu->addAction(lang(lng_context_copy_image), [=] {
|
_menu->addAction(tr::lng_context_copy_image(tr::now), [=] {
|
||||||
copyContextImage(photo);
|
copyContextImage(photo);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
auto document = lnkDocument->document();
|
auto document = lnkDocument->document();
|
||||||
if (document->loading()) {
|
if (document->loading()) {
|
||||||
_menu->addAction(lang(lng_context_cancel_download), [=] {
|
_menu->addAction(tr::lng_context_cancel_download(tr::now), [=] {
|
||||||
cancelContextDownload(document);
|
cancelContextDownload(document);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -1018,17 +1025,17 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto itemId = view
|
const auto itemId = view
|
||||||
? view->data()->fullId()
|
? view->data()->fullId()
|
||||||
: FullMsgId();
|
: FullMsgId();
|
||||||
_menu->addAction(lang(lng_context_open_gif), [=] {
|
_menu->addAction(tr::lng_context_open_gif(tr::now), [=] {
|
||||||
openContextGif(itemId);
|
openContextGif(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!document->filepath(DocumentData::FilePathResolve::Checked).isEmpty()) {
|
if (!document->filepath(DocumentData::FilePathResolve::Checked).isEmpty()) {
|
||||||
_menu->addAction(lang(Platform::IsMac() ? lng_context_show_in_finder : lng_context_show_in_folder), [=] {
|
_menu->addAction(Platform::IsMac() ? tr::lng_context_show_in_finder(tr::now) : tr::lng_context_show_in_folder(tr::now), [=] {
|
||||||
showContextInFolder(document);
|
showContextInFolder(document);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsVoice ? lng_context_save_audio : (lnkIsAudio ? lng_context_save_audio_file : lng_context_save_file))), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [this, document] {
|
_menu->addAction(lnkIsVideo ? tr::lng_context_save_video(tr::now) : (lnkIsVoice ? tr::lng_context_save_audio(tr::now) : (lnkIsAudio ? tr::lng_context_save_audio_file(tr::now) : tr::lng_context_save_file(tr::now))), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [this, document] {
|
||||||
saveDocumentToFile(document);
|
saveDocumentToFile(document);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -1045,20 +1052,20 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
|
|
||||||
auto msg = dynamic_cast<HistoryMessage*>(item);
|
auto msg = dynamic_cast<HistoryMessage*>(item);
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
_menu->addAction(lang(lng_context_copy_selected), [this] { copySelectedText(); });
|
_menu->addAction(tr::lng_context_copy_selected(tr::now), [this] { copySelectedText(); });
|
||||||
} else {
|
} else {
|
||||||
if (item && !isUponSelected) {
|
if (item && !isUponSelected) {
|
||||||
const auto media = view->media();
|
const auto media = view->media();
|
||||||
const auto mediaHasTextForCopy = media && media->hasTextForCopy();
|
const auto mediaHasTextForCopy = media && media->hasTextForCopy();
|
||||||
if (const auto document = media ? media->getDocument() : nullptr) {
|
if (const auto document = media ? media->getDocument() : nullptr) {
|
||||||
if (document->sticker()) {
|
if (document->sticker()) {
|
||||||
_menu->addAction(lang(lng_context_save_image), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [this, document] {
|
_menu->addAction(tr::lng_context_save_image(tr::now), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [this, document] {
|
||||||
saveDocumentToFile(document);
|
saveDocumentToFile(document);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg && !link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
if (msg && !link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
||||||
_menu->addAction(lang(lng_context_copy_text), [=] {
|
_menu->addAction(tr::lng_context_copy_text(tr::now), [=] {
|
||||||
copyContextText(itemId);
|
copyContextText(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1093,7 +1100,7 @@ void InnerWidget::savePhotoToFile(PhotoData *photo) {
|
||||||
auto filter = qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter();
|
auto filter = qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter();
|
||||||
FileDialog::GetWritePath(
|
FileDialog::GetWritePath(
|
||||||
this,
|
this,
|
||||||
lang(lng_save_photo),
|
tr::lng_save_photo(tr::now),
|
||||||
filter,
|
filter,
|
||||||
filedialogDefaultName(qsl("photo"), qsl(".jpg")),
|
filedialogDefaultName(qsl("photo"), qsl(".jpg")),
|
||||||
crl::guard(this, [=](const QString &result) {
|
crl::guard(this, [=](const QString &result) {
|
||||||
|
@ -1163,7 +1170,7 @@ void InnerWidget::suggestRestrictUser(not_null<UserData*> user) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lng_context_restrict_user), [=] {
|
_menu->addAction(tr::lng_context_restrict_user(tr::now), [=] {
|
||||||
auto editRestrictions = [=](bool hasAdminRights, const MTPChatBannedRights ¤tRights) {
|
auto editRestrictions = [=](bool hasAdminRights, const MTPChatBannedRights ¤tRights) {
|
||||||
auto weak = QPointer<InnerWidget>(this);
|
auto weak = QPointer<InnerWidget>(this);
|
||||||
auto weakBox = std::make_shared<QPointer<EditRestrictedBox>>();
|
auto weakBox = std::make_shared<QPointer<EditRestrictedBox>>();
|
||||||
|
|
|
@ -113,7 +113,7 @@ const auto CollectChanges = [](auto &phraseMap, auto plusFlags, auto minusFlags)
|
||||||
auto result = QString();
|
auto result = QString();
|
||||||
for (auto &phrase : phraseMap) {
|
for (auto &phrase : phraseMap) {
|
||||||
if (flags & phrase.first) {
|
if (flags & phrase.first) {
|
||||||
result.append('\n' + (prefix + lang(phrase.second)));
|
result.append('\n' + (prefix + phrase.second(tr::now)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -138,16 +138,18 @@ TextWithEntities GenerateAdminChangeText(
|
||||||
auto result = tr::lng_admin_log_promoted(tr::now, lt_user, user, Ui::Text::WithEntities);
|
auto result = tr::lng_admin_log_promoted(tr::now, lt_user, user, Ui::Text::WithEntities);
|
||||||
|
|
||||||
auto useInviteLinkPhrase = channel->isMegagroup() && channel->anyoneCanAddMembers();
|
auto useInviteLinkPhrase = channel->isMegagroup() && channel->anyoneCanAddMembers();
|
||||||
auto invitePhrase = (useInviteLinkPhrase ? lng_admin_log_admin_invite_link : lng_admin_log_admin_invite_users);
|
auto invitePhrase = useInviteLinkPhrase
|
||||||
static auto phraseMap = std::map<Flags, LangKey> {
|
? tr::lng_admin_log_admin_invite_link
|
||||||
{ Flag::f_change_info, lng_admin_log_admin_change_info },
|
: tr::lng_admin_log_admin_invite_users;
|
||||||
{ Flag::f_post_messages, lng_admin_log_admin_post_messages },
|
static auto phraseMap = std::map<Flags, tr::phrase<>> {
|
||||||
{ Flag::f_edit_messages, lng_admin_log_admin_edit_messages },
|
{ Flag::f_change_info, tr::lng_admin_log_admin_change_info },
|
||||||
{ Flag::f_delete_messages, lng_admin_log_admin_delete_messages },
|
{ Flag::f_post_messages, tr::lng_admin_log_admin_post_messages },
|
||||||
{ Flag::f_ban_users, lng_admin_log_admin_ban_users },
|
{ Flag::f_edit_messages, tr::lng_admin_log_admin_edit_messages },
|
||||||
|
{ Flag::f_delete_messages, tr::lng_admin_log_admin_delete_messages },
|
||||||
|
{ Flag::f_ban_users, tr::lng_admin_log_admin_ban_users },
|
||||||
{ Flag::f_invite_users, invitePhrase },
|
{ Flag::f_invite_users, invitePhrase },
|
||||||
{ Flag::f_pin_messages, lng_admin_log_admin_pin_messages },
|
{ Flag::f_pin_messages, tr::lng_admin_log_admin_pin_messages },
|
||||||
{ Flag::f_add_admins, lng_admin_log_admin_add_admins },
|
{ Flag::f_add_admins, tr::lng_admin_log_admin_add_admins },
|
||||||
};
|
};
|
||||||
phraseMap[Flag::f_invite_users] = invitePhrase;
|
phraseMap[Flag::f_invite_users] = invitePhrase;
|
||||||
|
|
||||||
|
@ -176,16 +178,16 @@ QString GenerateBannedChangeText(
|
||||||
|
|
||||||
auto newFlags = newRights ? newRights->c_chatBannedRights().vflags.v : Flags(0);
|
auto newFlags = newRights ? newRights->c_chatBannedRights().vflags.v : Flags(0);
|
||||||
auto prevFlags = prevRights ? prevRights->c_chatBannedRights().vflags.v : Flags(0);
|
auto prevFlags = prevRights ? prevRights->c_chatBannedRights().vflags.v : Flags(0);
|
||||||
static auto phraseMap = std::map<Flags, LangKey>{
|
static auto phraseMap = std::map<Flags, tr::phrase<>>{
|
||||||
{ Flag::f_view_messages, lng_admin_log_banned_view_messages },
|
{ Flag::f_view_messages, tr::lng_admin_log_banned_view_messages },
|
||||||
{ Flag::f_send_messages, lng_admin_log_banned_send_messages },
|
{ Flag::f_send_messages, tr::lng_admin_log_banned_send_messages },
|
||||||
{ Flag::f_send_media, lng_admin_log_banned_send_media },
|
{ Flag::f_send_media, tr::lng_admin_log_banned_send_media },
|
||||||
{ Flag::f_send_stickers | Flag::f_send_gifs | Flag::f_send_inline | Flag::f_send_games, lng_admin_log_banned_send_stickers },
|
{ Flag::f_send_stickers | Flag::f_send_gifs | Flag::f_send_inline | Flag::f_send_games, tr::lng_admin_log_banned_send_stickers },
|
||||||
{ Flag::f_embed_links, lng_admin_log_banned_embed_links },
|
{ Flag::f_embed_links, tr::lng_admin_log_banned_embed_links },
|
||||||
{ Flag::f_send_polls, lng_admin_log_banned_send_polls },
|
{ Flag::f_send_polls, tr::lng_admin_log_banned_send_polls },
|
||||||
{ Flag::f_change_info, lng_admin_log_admin_change_info },
|
{ Flag::f_change_info, tr::lng_admin_log_admin_change_info },
|
||||||
{ Flag::f_invite_users, lng_admin_log_admin_invite_users },
|
{ Flag::f_invite_users, tr::lng_admin_log_admin_invite_users },
|
||||||
{ Flag::f_pin_messages, lng_admin_log_admin_pin_messages },
|
{ Flag::f_pin_messages, tr::lng_admin_log_admin_pin_messages },
|
||||||
};
|
};
|
||||||
return CollectChanges(phraseMap, prevFlags, newFlags);
|
return CollectChanges(phraseMap, prevFlags, newFlags);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +311,7 @@ TextWithEntities GenerateParticipantChangeText(not_null<ChannelData*> channel, c
|
||||||
}
|
}
|
||||||
|
|
||||||
TextWithEntities GenerateDefaultBannedRightsChangeText(not_null<ChannelData*> channel, const MTPChatBannedRights &rights, const MTPChatBannedRights &oldRights) {
|
TextWithEntities GenerateDefaultBannedRightsChangeText(not_null<ChannelData*> channel, const MTPChatBannedRights &rights, const MTPChatBannedRights &oldRights) {
|
||||||
auto result = TextWithEntities{ lang(lng_admin_log_changed_default_permissions) };
|
auto result = TextWithEntities{ tr::lng_admin_log_changed_default_permissions(tr::now) };
|
||||||
const auto changes = GenerateBannedChangeText(&rights, &oldRights);
|
const auto changes = GenerateBannedChangeText(&rights, &oldRights);
|
||||||
if (!changes.isEmpty()) {
|
if (!changes.isEmpty()) {
|
||||||
result.text.append('\n' + changes);
|
result.text.append('\n' + changes);
|
||||||
|
@ -402,7 +404,7 @@ void GenerateItems(
|
||||||
auto body = history->owner().makeMessage(history, idManager->next(), bodyFlags, bodyReplyTo, bodyViaBotId, date, peerToUser(from->id), QString(), newDescription);
|
auto body = history->owner().makeMessage(history, idManager->next(), bodyFlags, bodyReplyTo, bodyViaBotId, date, peerToUser(from->id), QString(), newDescription);
|
||||||
if (!oldValue.isEmpty()) {
|
if (!oldValue.isEmpty()) {
|
||||||
auto oldDescription = PrepareText(oldValue, QString());
|
auto oldDescription = PrepareText(oldValue, QString());
|
||||||
body->addLogEntryOriginal(id, lang(lng_admin_log_previous_description), oldDescription);
|
body->addLogEntryOriginal(id, tr::lng_admin_log_previous_description(tr::now), oldDescription);
|
||||||
}
|
}
|
||||||
addPart(body);
|
addPart(body);
|
||||||
};
|
};
|
||||||
|
@ -423,7 +425,7 @@ void GenerateItems(
|
||||||
auto body = history->owner().makeMessage(history, idManager->next(), bodyFlags, bodyReplyTo, bodyViaBotId, date, peerToUser(from->id), QString(), newLink);
|
auto body = history->owner().makeMessage(history, idManager->next(), bodyFlags, bodyReplyTo, bodyViaBotId, date, peerToUser(from->id), QString(), newLink);
|
||||||
if (!oldValue.isEmpty()) {
|
if (!oldValue.isEmpty()) {
|
||||||
auto oldLink = PrepareText(Core::App().createInternalLinkFull(oldValue), QString());
|
auto oldLink = PrepareText(Core::App().createInternalLinkFull(oldValue), QString());
|
||||||
body->addLogEntryOriginal(id, lang(lng_admin_log_previous_link), oldLink);
|
body->addLogEntryOriginal(id, tr::lng_admin_log_previous_link(tr::now), oldLink);
|
||||||
}
|
}
|
||||||
addPart(body);
|
addPart(body);
|
||||||
};
|
};
|
||||||
|
@ -491,9 +493,15 @@ void GenerateItems(
|
||||||
date),
|
date),
|
||||||
detachExistingItem);
|
detachExistingItem);
|
||||||
if (oldValue.text.isEmpty()) {
|
if (oldValue.text.isEmpty()) {
|
||||||
oldValue = PrepareText(QString(), lang(lng_admin_log_empty_text));
|
oldValue = PrepareText(QString(), tr::lng_admin_log_empty_text(tr::now));
|
||||||
}
|
}
|
||||||
body->addLogEntryOriginal(id, lang(canHaveCaption ? lng_admin_log_previous_caption : lng_admin_log_previous_message), oldValue);
|
|
||||||
|
body->addLogEntryOriginal(
|
||||||
|
id,
|
||||||
|
(canHaveCaption
|
||||||
|
? tr::lng_admin_log_previous_caption
|
||||||
|
: tr::lng_admin_log_previous_message)(tr::now),
|
||||||
|
oldValue);
|
||||||
addPart(body);
|
addPart(body);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -556,7 +564,7 @@ void GenerateItems(
|
||||||
lt_from,
|
lt_from,
|
||||||
fromLinkText,
|
fromLinkText,
|
||||||
lt_sticker_set,
|
lt_sticker_set,
|
||||||
textcmdLink(2, lang(lng_admin_log_changed_stickers_set)));
|
textcmdLink(2, tr::lng_admin_log_changed_stickers_set(tr::now)));
|
||||||
auto setLink = std::make_shared<LambdaClickHandler>([set] {
|
auto setLink = std::make_shared<LambdaClickHandler>([set] {
|
||||||
Ui::show(Box<StickerSetBox>(set));
|
Ui::show(Box<StickerSetBox>(set));
|
||||||
});
|
});
|
||||||
|
|
|
@ -105,7 +105,7 @@ FixedBar::FixedBar(
|
||||||
, _controller(controller)
|
, _controller(controller)
|
||||||
, _channel(channel)
|
, _channel(channel)
|
||||||
, _field(this, st::historyAdminLogSearchField, tr::lng_dlg_filter())
|
, _field(this, st::historyAdminLogSearchField, tr::lng_dlg_filter())
|
||||||
, _backButton(this, lang(lng_admin_log_title_all))
|
, _backButton(this, tr::lng_admin_log_title_all(tr::now))
|
||||||
, _search(this, st::topBarSearch)
|
, _search(this, st::topBarSearch)
|
||||||
, _cancel(this, st::historyAdminLogCancelSearch)
|
, _cancel(this, st::historyAdminLogCancelSearch)
|
||||||
, _filter(this, tr::lng_admin_log_filter(), st::topBarButton) {
|
, _filter(this, tr::lng_admin_log_filter(), st::topBarButton) {
|
||||||
|
@ -125,9 +125,9 @@ FixedBar::FixedBar(
|
||||||
|
|
||||||
void FixedBar::applyFilter(const FilterValue &value) {
|
void FixedBar::applyFilter(const FilterValue &value) {
|
||||||
auto hasFilter = (value.flags != 0) || !value.allUsers;
|
auto hasFilter = (value.flags != 0) || !value.allUsers;
|
||||||
_backButton->setText(lang(hasFilter
|
_backButton->setText(hasFilter
|
||||||
? lng_admin_log_title_selected
|
? tr::lng_admin_log_title_selected(tr::now)
|
||||||
: lng_admin_log_title_all));
|
: tr::lng_admin_log_title_all(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedBar::goBack() {
|
void FixedBar::goBack() {
|
||||||
|
@ -254,7 +254,7 @@ Widget::Widget(QWidget *parent, not_null<Window::SessionController*> controller,
|
||||||
, _scroll(this, st::historyScroll, false)
|
, _scroll(this, st::historyScroll, false)
|
||||||
, _fixedBar(this, controller, channel)
|
, _fixedBar(this, controller, channel)
|
||||||
, _fixedBarShadow(this)
|
, _fixedBarShadow(this)
|
||||||
, _whatIsThis(this, lang(lng_admin_log_about).toUpper(), st::historyComposeButton) {
|
, _whatIsThis(this, tr::lng_admin_log_about(tr::now).toUpper(), st::historyComposeButton) {
|
||||||
_fixedBar->move(0, 0);
|
_fixedBar->move(0, 0);
|
||||||
_fixedBar->resizeToWidth(width());
|
_fixedBar->resizeToWidth(width());
|
||||||
subscribe(_fixedBar->showFilterSignal, [this] { showFilter(); });
|
subscribe(_fixedBar->showFilterSignal, [this] { showFilter(); });
|
||||||
|
@ -275,7 +275,7 @@ Widget::Widget(QWidget *parent, not_null<Window::SessionController*> controller,
|
||||||
|
|
||||||
connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); });
|
connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); });
|
||||||
|
|
||||||
_whatIsThis->setClickedCallback([=] { Ui::show(Box<InformBox>(lang(lng_admin_log_about_text))); });
|
_whatIsThis->setClickedCallback([=] { Ui::show(Box<InformBox>(tr::lng_admin_log_about_text(tr::now))); });
|
||||||
|
|
||||||
setupShortcuts();
|
setupShortcuts();
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,7 +488,7 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
(end(_typing) - 1)->first->firstName);
|
(end(_typing) - 1)->first->firstName);
|
||||||
} else if (typingCount) {
|
} else if (typingCount) {
|
||||||
newTypingString = peer->isUser()
|
newTypingString = peer->isUser()
|
||||||
? lang(lng_typing)
|
? tr::lng_typing(tr::now)
|
||||||
: lng_user_typing(
|
: lng_user_typing(
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_typing)->first->firstName);
|
begin(_typing)->first->firstName);
|
||||||
|
@ -497,16 +497,16 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
using Type = SendAction::Type;
|
using Type = SendAction::Type;
|
||||||
auto sendActionString = [](Type type, const QString &name) -> QString {
|
auto sendActionString = [](Type type, const QString &name) -> QString {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::RecordVideo: return name.isEmpty() ? lang(lng_send_action_record_video) : lng_user_action_record_video(lt_user, name);
|
case Type::RecordVideo: return name.isEmpty() ? tr::lng_send_action_record_video(tr::now) : lng_user_action_record_video(lt_user, name);
|
||||||
case Type::UploadVideo: return name.isEmpty() ? lang(lng_send_action_upload_video) : lng_user_action_upload_video(lt_user, name);
|
case Type::UploadVideo: return name.isEmpty() ? tr::lng_send_action_upload_video(tr::now) : lng_user_action_upload_video(lt_user, name);
|
||||||
case Type::RecordVoice: return name.isEmpty() ? lang(lng_send_action_record_audio) : lng_user_action_record_audio(lt_user, name);
|
case Type::RecordVoice: return name.isEmpty() ? tr::lng_send_action_record_audio(tr::now) : lng_user_action_record_audio(lt_user, name);
|
||||||
case Type::UploadVoice: return name.isEmpty() ? lang(lng_send_action_upload_audio) : lng_user_action_upload_audio(lt_user, name);
|
case Type::UploadVoice: return name.isEmpty() ? tr::lng_send_action_upload_audio(tr::now) : lng_user_action_upload_audio(lt_user, name);
|
||||||
case Type::RecordRound: return name.isEmpty() ? lang(lng_send_action_record_round) : lng_user_action_record_round(lt_user, name);
|
case Type::RecordRound: return name.isEmpty() ? tr::lng_send_action_record_round(tr::now) : lng_user_action_record_round(lt_user, name);
|
||||||
case Type::UploadRound: return name.isEmpty() ? lang(lng_send_action_upload_round) : lng_user_action_upload_round(lt_user, name);
|
case Type::UploadRound: return name.isEmpty() ? tr::lng_send_action_upload_round(tr::now) : lng_user_action_upload_round(lt_user, name);
|
||||||
case Type::UploadPhoto: return name.isEmpty() ? lang(lng_send_action_upload_photo) : lng_user_action_upload_photo(lt_user, name);
|
case Type::UploadPhoto: return name.isEmpty() ? tr::lng_send_action_upload_photo(tr::now) : lng_user_action_upload_photo(lt_user, name);
|
||||||
case Type::UploadFile: return name.isEmpty() ? lang(lng_send_action_upload_file) : lng_user_action_upload_file(lt_user, name);
|
case Type::UploadFile: return name.isEmpty() ? tr::lng_send_action_upload_file(tr::now) : lng_user_action_upload_file(lt_user, name);
|
||||||
case Type::ChooseLocation:
|
case Type::ChooseLocation:
|
||||||
case Type::ChooseContact: return name.isEmpty() ? lang(lng_typing) : lng_user_typing(lt_user, name);
|
case Type::ChooseContact: return name.isEmpty() ? tr::lng_typing(tr::now) : lng_user_typing(lt_user, name);
|
||||||
default: break;
|
default: break;
|
||||||
};
|
};
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -536,7 +536,7 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
(end(_sendActions) - 1)->first->firstName);
|
(end(_sendActions) - 1)->first->firstName);
|
||||||
} else {
|
} else {
|
||||||
newTypingString = peer->isUser()
|
newTypingString = peer->isUser()
|
||||||
? lang(lng_playing_game)
|
? tr::lng_playing_game(tr::now)
|
||||||
: lng_user_playing_game(
|
: lng_user_playing_game(
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_sendActions)->first->firstName);
|
begin(_sendActions)->first->firstName);
|
||||||
|
|
|
@ -560,7 +560,7 @@ void HistoryInner::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
p.setFont(st::msgNameFont);
|
p.setFont(st::msgNameFont);
|
||||||
p.setPen(st::dialogsNameFg);
|
p.setPen(st::dialogsNameFg);
|
||||||
p.drawText(_botAbout->rect.left() + st::msgPadding.left(), _botAbout->rect.top() + st::msgPadding.top() + st::msgNameFont->ascent, lang(lng_bot_description));
|
p.drawText(_botAbout->rect.left() + st::msgPadding.left(), _botAbout->rect.top() + st::msgPadding.top() + st::msgNameFont->ascent, tr::lng_bot_description(tr::now));
|
||||||
|
|
||||||
p.setPen(st::historyTextInFg);
|
p.setPen(st::historyTextInFg);
|
||||||
_botAbout->info->text.draw(p, _botAbout->rect.left() + st::msgPadding.left(), _botAbout->rect.top() + st::msgPadding.top() + st::msgNameFont->height + st::botDescSkip, _botAbout->width);
|
_botAbout->info->text.draw(p, _botAbout->rect.left() + st::msgPadding.left(), _botAbout->rect.top() + st::msgPadding.top() + st::msgNameFont->height + st::botDescSkip, _botAbout->width);
|
||||||
|
@ -1503,18 +1503,18 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
}
|
}
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
if (canSendMessages) {
|
if (canSendMessages) {
|
||||||
_menu->addAction(lang(lng_context_reply_msg), [=] {
|
_menu->addAction(tr::lng_context_reply_msg(tr::now), [=] {
|
||||||
_widget->replyToMessage(itemId);
|
_widget->replyToMessage(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item->allowsEdit(unixtime())) {
|
if (item->allowsEdit(unixtime())) {
|
||||||
_menu->addAction(lang(lng_context_edit_msg), [=] {
|
_menu->addAction(tr::lng_context_edit_msg(tr::now), [=] {
|
||||||
_widget->editMessage(itemId);
|
_widget->editMessage(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item->canPin()) {
|
if (item->canPin()) {
|
||||||
const auto isPinned = item->isPinned();
|
const auto isPinned = item->isPinned();
|
||||||
_menu->addAction(lang(isPinned ? lng_context_unpin_msg : lng_context_pin_msg), [=] {
|
_menu->addAction(isPinned ? tr::lng_context_unpin_msg(tr::now) : tr::lng_context_pin_msg(tr::now), [=] {
|
||||||
if (isPinned) {
|
if (isPinned) {
|
||||||
_widget->unpinMessage(itemId);
|
_widget->unpinMessage(itemId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1524,21 +1524,21 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const auto addPhotoActions = [&](not_null<PhotoData*> photo) {
|
const auto addPhotoActions = [&](not_null<PhotoData*> photo) {
|
||||||
_menu->addAction(lang(lng_context_save_image), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
_menu->addAction(tr::lng_context_save_image(tr::now), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
||||||
savePhotoToFile(photo);
|
savePhotoToFile(photo);
|
||||||
}));
|
}));
|
||||||
_menu->addAction(lang(lng_context_copy_image), [=] {
|
_menu->addAction(tr::lng_context_copy_image(tr::now), [=] {
|
||||||
copyContextImage(photo);
|
copyContextImage(photo);
|
||||||
});
|
});
|
||||||
if (photo->hasSticker) {
|
if (photo->hasSticker) {
|
||||||
_menu->addAction(lang(lng_context_attached_stickers), [=] {
|
_menu->addAction(tr::lng_context_attached_stickers(tr::now), [=] {
|
||||||
Auth().api().requestAttachedStickerSets(photo);
|
Auth().api().requestAttachedStickerSets(photo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const auto addDocumentActions = [&](not_null<DocumentData*> document) {
|
const auto addDocumentActions = [&](not_null<DocumentData*> document) {
|
||||||
if (document->loading()) {
|
if (document->loading()) {
|
||||||
_menu->addAction(lang(lng_context_cancel_download), [=] {
|
_menu->addAction(tr::lng_context_cancel_download(tr::now), [=] {
|
||||||
cancelContextDownload(document);
|
cancelContextDownload(document);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
@ -1550,20 +1550,20 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto lnkIsAudio = document->isAudioFile();
|
const auto lnkIsAudio = document->isAudioFile();
|
||||||
if (document->loaded() && document->isGifv()) {
|
if (document->loaded() && document->isGifv()) {
|
||||||
if (!cAutoPlayGif()) {
|
if (!cAutoPlayGif()) {
|
||||||
_menu->addAction(lang(lng_context_open_gif), [=] {
|
_menu->addAction(tr::lng_context_open_gif(tr::now), [=] {
|
||||||
openContextGif(itemId);
|
openContextGif(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lng_context_save_gif), [=] {
|
_menu->addAction(tr::lng_context_save_gif(tr::now), [=] {
|
||||||
saveContextGif(itemId);
|
saveContextGif(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!document->filepath(DocumentData::FilePathResolve::Checked).isEmpty()) {
|
if (!document->filepath(DocumentData::FilePathResolve::Checked).isEmpty()) {
|
||||||
_menu->addAction(lang(Platform::IsMac() ? lng_context_show_in_finder : lng_context_show_in_folder), [=] {
|
_menu->addAction(Platform::IsMac() ? tr::lng_context_show_in_finder(tr::now) : tr::lng_context_show_in_folder(tr::now), [=] {
|
||||||
showContextInFolder(document);
|
showContextInFolder(document);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lnkIsVideo ? lng_context_save_video : (lnkIsVoice ? lng_context_save_audio : (lnkIsAudio ? lng_context_save_audio_file : lng_context_save_file))), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
_menu->addAction(lnkIsVideo ? tr::lng_context_save_video(tr::now) : (lnkIsVoice ? tr::lng_context_save_audio(tr::now) : (lnkIsAudio ? tr::lng_context_save_audio_file(tr::now) : tr::lng_context_save_file(tr::now))), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
||||||
saveDocumentToFile(itemId, document);
|
saveDocumentToFile(itemId, document);
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
@ -1575,9 +1575,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto itemId = item ? item->fullId() : FullMsgId();
|
const auto itemId = item ? item->fullId() : FullMsgId();
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
lang((isUponSelected > 1)
|
(isUponSelected > 1
|
||||||
? lng_context_copy_selected_items
|
? tr::lng_context_copy_selected_items(tr::now)
|
||||||
: lng_context_copy_selected),
|
: tr::lng_context_copy_selected(tr::now)),
|
||||||
[=] { copySelectedText(); });
|
[=] { copySelectedText(); });
|
||||||
}
|
}
|
||||||
addItemActions(item);
|
addItemActions(item);
|
||||||
|
@ -1587,45 +1587,45 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
addDocumentActions(lnkDocument->document());
|
addDocumentActions(lnkDocument->document());
|
||||||
}
|
}
|
||||||
if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) {
|
if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) {
|
||||||
_menu->addAction(lang(item->history()->peer->isMegagroup() ? lng_context_copy_link : lng_context_copy_post_link), [=] {
|
_menu->addAction(item->history()->peer->isMegagroup() ? tr::lng_context_copy_link(tr::now) : tr::lng_context_copy_post_link(tr::now), [=] {
|
||||||
HistoryView::CopyPostLink(itemId);
|
HistoryView::CopyPostLink(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (isUponSelected > 1) {
|
if (isUponSelected > 1) {
|
||||||
if (selectedState.count > 0 && selectedState.canForwardCount == selectedState.count) {
|
if (selectedState.count > 0 && selectedState.canForwardCount == selectedState.count) {
|
||||||
_menu->addAction(lang(lng_context_forward_selected), [=] {
|
_menu->addAction(tr::lng_context_forward_selected(tr::now), [=] {
|
||||||
_widget->forwardSelected();
|
_widget->forwardSelected();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (selectedState.count > 0 && selectedState.canDeleteCount == selectedState.count) {
|
if (selectedState.count > 0 && selectedState.canDeleteCount == selectedState.count) {
|
||||||
_menu->addAction(lang(lng_context_delete_selected), [=] {
|
_menu->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
||||||
_widget->confirmDeleteSelected();
|
_widget->confirmDeleteSelected();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lng_context_clear_selection), [=] {
|
_menu->addAction(tr::lng_context_clear_selection(tr::now), [=] {
|
||||||
_widget->clearSelected();
|
_widget->clearSelected();
|
||||||
});
|
});
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
if (isUponSelected != -2) {
|
if (isUponSelected != -2) {
|
||||||
if (item->allowsForward()) {
|
if (item->allowsForward()) {
|
||||||
_menu->addAction(lang(lng_context_forward_msg), [=] {
|
_menu->addAction(tr::lng_context_forward_msg(tr::now), [=] {
|
||||||
forwardItem(itemId);
|
forwardItem(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item->canDelete()) {
|
if (item->canDelete()) {
|
||||||
_menu->addAction(lang(lng_context_delete_msg), [=] {
|
_menu->addAction(tr::lng_context_delete_msg(tr::now), [=] {
|
||||||
deleteItem(itemId);
|
deleteItem(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item->suggestReport()) {
|
if (item->suggestReport()) {
|
||||||
_menu->addAction(lang(lng_context_report_msg), [=] {
|
_menu->addAction(tr::lng_context_report_msg(tr::now), [=] {
|
||||||
reportItem(itemId);
|
reportItem(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IsServerMsgId(item->id) && !item->serviceMsg()) {
|
if (IsServerMsgId(item->id) && !item->serviceMsg()) {
|
||||||
_menu->addAction(lang(lng_context_select_msg), [=] {
|
_menu->addAction(tr::lng_context_select_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (const auto view = item->mainView()) {
|
if (const auto view = item->mainView()) {
|
||||||
changeSelection(&_selected, item, SelectAction::Select);
|
changeSelection(&_selected, item, SelectAction::Select);
|
||||||
|
@ -1661,9 +1661,9 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
const auto msg = dynamic_cast<HistoryMessage*>(item);
|
const auto msg = dynamic_cast<HistoryMessage*>(item);
|
||||||
if (isUponSelected > 0) {
|
if (isUponSelected > 0) {
|
||||||
_menu->addAction(
|
_menu->addAction(
|
||||||
lang((isUponSelected > 1)
|
((isUponSelected > 1)
|
||||||
? lng_context_copy_selected_items
|
? tr::lng_context_copy_selected_items(tr::now)
|
||||||
: lng_context_copy_selected),
|
: tr::lng_context_copy_selected(tr::now)),
|
||||||
[=] { copySelectedText(); });
|
[=] { copySelectedText(); });
|
||||||
addItemActions(item);
|
addItemActions(item);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1674,17 +1674,17 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
if (const auto document = media ? media->getDocument() : nullptr) {
|
if (const auto document = media ? media->getDocument() : nullptr) {
|
||||||
if (document->sticker()) {
|
if (document->sticker()) {
|
||||||
if (document->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
|
if (document->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
|
||||||
_menu->addAction(lang(document->isStickerSetInstalled() ? lng_context_pack_info : lng_context_pack_add), [=] {
|
_menu->addAction(document->isStickerSetInstalled() ? tr::lng_context_pack_info(tr::now) : tr::lng_context_pack_add(tr::now), [=] {
|
||||||
showStickerPackInfo(document);
|
showStickerPackInfo(document);
|
||||||
});
|
});
|
||||||
_menu->addAction(lang(Stickers::IsFaved(document) ? lng_faved_stickers_remove : lng_faved_stickers_add), [=] {
|
_menu->addAction(Stickers::IsFaved(document) ? tr::lng_faved_stickers_remove(tr::now) : tr::lng_faved_stickers_add(tr::now), [=] {
|
||||||
Auth().api().toggleFavedSticker(
|
Auth().api().toggleFavedSticker(
|
||||||
document,
|
document,
|
||||||
itemId,
|
itemId,
|
||||||
!Stickers::IsFaved(document));
|
!Stickers::IsFaved(document));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lng_context_save_image), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
_menu->addAction(tr::lng_context_save_image(tr::now), App::LambdaDelayed(st::defaultDropdownMenu.menu.ripple.hideDuration, this, [=] {
|
||||||
saveDocumentToFile(itemId, document);
|
saveDocumentToFile(itemId, document);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -1693,12 +1693,12 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
if (const auto poll = media->poll()) {
|
if (const auto poll = media->poll()) {
|
||||||
if (!poll->closed) {
|
if (!poll->closed) {
|
||||||
if (poll->voted()) {
|
if (poll->voted()) {
|
||||||
_menu->addAction(lang(lng_polls_retract), [=] {
|
_menu->addAction(tr::lng_polls_retract(tr::now), [=] {
|
||||||
Auth().api().sendPollVotes(itemId, {});
|
Auth().api().sendPollVotes(itemId, {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item->canStopPoll()) {
|
if (item->canStopPoll()) {
|
||||||
_menu->addAction(lang(lng_polls_stop), [=] {
|
_menu->addAction(tr::lng_polls_stop(tr::now), [=] {
|
||||||
HistoryView::StopPoll(itemId);
|
HistoryView::StopPoll(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1706,7 +1706,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg && view && !link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
if (msg && view && !link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
||||||
_menu->addAction(lang(lng_context_copy_text), [=] {
|
_menu->addAction(tr::lng_context_copy_text(tr::now), [=] {
|
||||||
copyContextText(itemId);
|
copyContextText(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1723,44 +1723,44 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
QApplication::clipboard()->setText(text);
|
QApplication::clipboard()->setText(text);
|
||||||
});
|
});
|
||||||
} else if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) {
|
} else if (item && item->hasDirectLink() && isUponSelected != 2 && isUponSelected != -2) {
|
||||||
_menu->addAction(lang(item->history()->peer->isMegagroup() ? lng_context_copy_link : lng_context_copy_post_link), [=] {
|
_menu->addAction(item->history()->peer->isMegagroup() ? tr::lng_context_copy_link(tr::now) : tr::lng_context_copy_post_link(tr::now), [=] {
|
||||||
HistoryView::CopyPostLink(itemId);
|
HistoryView::CopyPostLink(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (isUponSelected > 1) {
|
if (isUponSelected > 1) {
|
||||||
if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
|
if (selectedState.count > 0 && selectedState.count == selectedState.canForwardCount) {
|
||||||
_menu->addAction(lang(lng_context_forward_selected), [=] {
|
_menu->addAction(tr::lng_context_forward_selected(tr::now), [=] {
|
||||||
_widget->forwardSelected();
|
_widget->forwardSelected();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (selectedState.count > 0 && selectedState.count == selectedState.canDeleteCount) {
|
if (selectedState.count > 0 && selectedState.count == selectedState.canDeleteCount) {
|
||||||
_menu->addAction(lang(lng_context_delete_selected), [=] {
|
_menu->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
||||||
_widget->confirmDeleteSelected();
|
_widget->confirmDeleteSelected();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
_menu->addAction(lang(lng_context_clear_selection), [=] {
|
_menu->addAction(tr::lng_context_clear_selection(tr::now), [=] {
|
||||||
_widget->clearSelected();
|
_widget->clearSelected();
|
||||||
});
|
});
|
||||||
} else if (item && ((isUponSelected != -2 && (canForward || canDelete)) || item->id > 0)) {
|
} else if (item && ((isUponSelected != -2 && (canForward || canDelete)) || item->id > 0)) {
|
||||||
if (isUponSelected != -2) {
|
if (isUponSelected != -2) {
|
||||||
if (canForward) {
|
if (canForward) {
|
||||||
_menu->addAction(lang(lng_context_forward_msg), [=] {
|
_menu->addAction(tr::lng_context_forward_msg(tr::now), [=] {
|
||||||
forwardAsGroup(itemId);
|
forwardAsGroup(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (canDelete) {
|
if (canDelete) {
|
||||||
_menu->addAction(lang((msg && msg->uploading()) ? lng_context_cancel_upload : lng_context_delete_msg), [=] {
|
_menu->addAction((msg && msg->uploading()) ? tr::lng_context_cancel_upload(tr::now) : tr::lng_context_delete_msg(tr::now), [=] {
|
||||||
deleteAsGroup(itemId);
|
deleteAsGroup(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (canReport) {
|
if (canReport) {
|
||||||
_menu->addAction(lang(lng_context_report_msg), [=] {
|
_menu->addAction(tr::lng_context_report_msg(tr::now), [=] {
|
||||||
reportAsGroup(itemId);
|
reportAsGroup(itemId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item->id > 0 && !item->serviceMsg()) {
|
if (item->id > 0 && !item->serviceMsg()) {
|
||||||
_menu->addAction(lang(lng_context_select_msg), [=] {
|
_menu->addAction(tr::lng_context_select_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (const auto view = item->mainView()) {
|
if (const auto view = item->mainView()) {
|
||||||
changeSelectionAsGroup(&_selected, item, SelectAction::Select);
|
changeSelectionAsGroup(&_selected, item, SelectAction::Select);
|
||||||
|
@ -1775,7 +1775,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
&& IsServerMsgId(App::mousedItem()->data()->id)
|
&& IsServerMsgId(App::mousedItem()->data()->id)
|
||||||
&& !App::mousedItem()->data()->serviceMsg()) {
|
&& !App::mousedItem()->data()->serviceMsg()) {
|
||||||
const auto itemId = App::mousedItem()->data()->fullId();
|
const auto itemId = App::mousedItem()->data()->fullId();
|
||||||
_menu->addAction(lang(lng_context_select_msg), [=] {
|
_menu->addAction(tr::lng_context_select_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (const auto view = item->mainView()) {
|
if (const auto view = item->mainView()) {
|
||||||
changeSelectionAsGroup(&_selected, item, SelectAction::Select);
|
changeSelectionAsGroup(&_selected, item, SelectAction::Select);
|
||||||
|
@ -1806,7 +1806,7 @@ void HistoryInner::savePhotoToFile(not_null<PhotoData*> photo) {
|
||||||
auto filter = qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter();
|
auto filter = qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter();
|
||||||
FileDialog::GetWritePath(
|
FileDialog::GetWritePath(
|
||||||
this,
|
this,
|
||||||
lang(lng_save_photo),
|
tr::lng_save_photo(tr::now),
|
||||||
filter,
|
filter,
|
||||||
filedialogDefaultName(
|
filedialogDefaultName(
|
||||||
qsl("photo"),
|
qsl("photo"),
|
||||||
|
@ -2015,7 +2015,7 @@ void HistoryInner::recountHistoryGeometry() {
|
||||||
int32 tw = _scroll->width() - st::msgMargin.left() - st::msgMargin.right();
|
int32 tw = _scroll->width() - st::msgMargin.left() - st::msgMargin.right();
|
||||||
if (tw > st::msgMaxWidth) tw = st::msgMaxWidth;
|
if (tw > st::msgMaxWidth) tw = st::msgMaxWidth;
|
||||||
tw -= st::msgPadding.left() + st::msgPadding.right();
|
tw -= st::msgPadding.left() + st::msgPadding.right();
|
||||||
int32 mw = qMax(_botAbout->info->text.maxWidth(), st::msgNameFont->width(lang(lng_bot_description)));
|
int32 mw = qMax(_botAbout->info->text.maxWidth(), st::msgNameFont->width(tr::lng_bot_description(tr::now)));
|
||||||
if (tw > mw) tw = mw;
|
if (tw > mw) tw = mw;
|
||||||
|
|
||||||
_botAbout->width = tw;
|
_botAbout->width = tw;
|
||||||
|
@ -2062,7 +2062,7 @@ void HistoryInner::updateBotInfo(bool recount) {
|
||||||
int32 tw = _scroll->width() - st::msgMargin.left() - st::msgMargin.right();
|
int32 tw = _scroll->width() - st::msgMargin.left() - st::msgMargin.right();
|
||||||
if (tw > st::msgMaxWidth) tw = st::msgMaxWidth;
|
if (tw > st::msgMaxWidth) tw = st::msgMaxWidth;
|
||||||
tw -= st::msgPadding.left() + st::msgPadding.right();
|
tw -= st::msgPadding.left() + st::msgPadding.right();
|
||||||
int32 mw = qMax(_botAbout->info->text.maxWidth(), st::msgNameFont->width(lang(lng_bot_description)));
|
int32 mw = qMax(_botAbout->info->text.maxWidth(), st::msgNameFont->width(tr::lng_bot_description(tr::now)));
|
||||||
if (tw > mw) tw = mw;
|
if (tw > mw) tw = mw;
|
||||||
|
|
||||||
_botAbout->width = tw;
|
_botAbout->width = tw;
|
||||||
|
@ -2723,7 +2723,7 @@ void HistoryInner::mouseActionUpdate() {
|
||||||
|
|
||||||
ClickHandlerPtr HistoryInner::hiddenUserpicLink(FullMsgId id) {
|
ClickHandlerPtr HistoryInner::hiddenUserpicLink(FullMsgId id) {
|
||||||
static const auto result = std::make_shared<LambdaClickHandler>([] {
|
static const auto result = std::make_shared<LambdaClickHandler>([] {
|
||||||
Ui::Toast::Show(lang(lng_forwarded_hidden));
|
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,7 +727,7 @@ QString HistoryItem::inDialogsText(DrawInDialog way) const {
|
||||||
auto getText = [this]() {
|
auto getText = [this]() {
|
||||||
if (_media) {
|
if (_media) {
|
||||||
if (_groupId) {
|
if (_groupId) {
|
||||||
return textcmdLink(1, TextUtilities::Clean(lang(lng_in_dlg_album)));
|
return textcmdLink(1, TextUtilities::Clean(tr::lng_in_dlg_album(tr::now)));
|
||||||
}
|
}
|
||||||
return _media->chatListText();
|
return _media->chatListText();
|
||||||
} else if (!emptyText()) {
|
} else if (!emptyText()) {
|
||||||
|
@ -747,7 +747,7 @@ QString HistoryItem::inDialogsText(DrawInDialog way) const {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}();
|
}();
|
||||||
if (sender) {
|
if (sender) {
|
||||||
auto fromText = sender->isSelf() ? lang(lng_from_you) : sender->shortName();
|
auto fromText = sender->isSelf() ? tr::lng_from_you(tr::now) : sender->shortName();
|
||||||
auto fromWrapped = textcmdLink(1, lng_dialogs_text_from_wrapped(lt_from, TextUtilities::Clean(fromText)));
|
auto fromWrapped = textcmdLink(1, lng_dialogs_text_from_wrapped(lt_from, TextUtilities::Clean(fromText)));
|
||||||
return lng_dialogs_text_with_from(lt_from_part, fromWrapped, lt_message, plainText);
|
return lng_dialogs_text_with_from(lt_from_part, fromWrapped, lt_message, plainText);
|
||||||
}
|
}
|
||||||
|
@ -828,7 +828,7 @@ not_null<HistoryItem*> HistoryItem::Create(
|
||||||
data.vfrom_id.v);
|
data.vfrom_id.v);
|
||||||
} else if (checked == MediaCheckResult::Empty) {
|
} else if (checked == MediaCheckResult::Empty) {
|
||||||
const auto text = HistoryService::PreparedText {
|
const auto text = HistoryService::PreparedText {
|
||||||
lang(lng_message_empty)
|
tr::lng_message_empty(tr::now)
|
||||||
};
|
};
|
||||||
return history->owner().makeServiceMessage(
|
return history->owner().makeServiceMessage(
|
||||||
history,
|
history,
|
||||||
|
@ -848,7 +848,7 @@ not_null<HistoryItem*> HistoryItem::Create(
|
||||||
return history->owner().makeServiceMessage(history, data);
|
return history->owner().makeServiceMessage(history, data);
|
||||||
}, [&](const MTPDmessageEmpty &data) -> HistoryItem* {
|
}, [&](const MTPDmessageEmpty &data) -> HistoryItem* {
|
||||||
const auto text = HistoryService::PreparedText{
|
const auto text = HistoryService::PreparedText{
|
||||||
lang(lng_message_empty)
|
tr::lng_message_empty(tr::now)
|
||||||
};
|
};
|
||||||
return history->owner().makeServiceMessage(history, data.vid.v, TimeId(0), text);
|
return history->owner().makeServiceMessage(history, data.vid.v, TimeId(0), text);
|
||||||
});
|
});
|
||||||
|
|
|
@ -70,7 +70,7 @@ int HistoryMessageSigned::maxWidth() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessageEdited::refresh(const QString &date, bool displayed) {
|
void HistoryMessageEdited::refresh(const QString &date, bool displayed) {
|
||||||
const auto prefix = displayed ? (lang(lng_edited) + ' ') : QString();
|
const auto prefix = displayed ? (tr::lng_edited(tr::now) + ' ') : QString();
|
||||||
text.setText(st::msgDateTextStyle, prefix + date, Ui::NameTextOptions());
|
text.setText(st::msgDateTextStyle, prefix + date, Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
};
|
};
|
||||||
text.setText(st::fwdTextStyle, phrase, opts);
|
text.setText(st::fwdTextStyle, phrase, opts);
|
||||||
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
||||||
Ui::Toast::Show(lang(lng_forwarded_hidden));
|
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
||||||
});
|
});
|
||||||
|
|
||||||
text.setLink(1, fromChannel
|
text.setLink(1, fromChannel
|
||||||
|
@ -256,7 +256,7 @@ void HistoryMessageReply::updateName() const {
|
||||||
|
|
||||||
maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize)));
|
maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize)));
|
||||||
} else {
|
} else {
|
||||||
maxReplyWidth = st::msgDateFont->width(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message));
|
maxReplyWidth = st::msgDateFont->width(replyToMsgId ? tr::lng_profile_loading(tr::now) : tr::lng_deleted_message(tr::now));
|
||||||
}
|
}
|
||||||
maxReplyWidth = st::msgReplyPadding.left() + st::msgReplyBarSkip + maxReplyWidth + st::msgReplyPadding.right();
|
maxReplyWidth = st::msgReplyPadding.left() + st::msgReplyBarSkip + maxReplyWidth + st::msgReplyPadding.right();
|
||||||
}
|
}
|
||||||
|
@ -336,7 +336,7 @@ void HistoryMessageReply::paint(
|
||||||
p.setFont(st::msgDateFont);
|
p.setFont(st::msgDateFont);
|
||||||
auto &date = outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg);
|
auto &date = outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg);
|
||||||
p.setPen((flags & PaintFlag::InBubble) ? date : st::msgDateImgFg);
|
p.setPen((flags & PaintFlag::InBubble) ? date : st::msgDateImgFg);
|
||||||
p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(lang(replyToMsgId ? lng_profile_loading : lng_deleted_message), w - st::msgReplyBarSkip));
|
p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(replyToMsgId ? tr::lng_profile_loading(tr::now) : tr::lng_deleted_message(tr::now), w - st::msgReplyBarSkip));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ QString ReplyMarkupClickHandler::copyToClipboardContextItemText() const {
|
||||||
if (const auto button = getButton()) {
|
if (const auto button = getButton()) {
|
||||||
using Type = HistoryMessageMarkupButton::Type;
|
using Type = HistoryMessageMarkupButton::Type;
|
||||||
if (button->type == Type::Url || button->type == Type::Auth) {
|
if (button->type == Type::Url || button->type == Type::Auth) {
|
||||||
return lang(lng_context_copy_link);
|
return tr::lng_context_copy_link(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
|
|
@ -22,12 +22,12 @@ TextForMimeData WrapAsReply(
|
||||||
const auto name = to->author()->name;
|
const auto name = to->author()->name;
|
||||||
auto result = TextForMimeData();
|
auto result = TextForMimeData();
|
||||||
result.reserve(
|
result.reserve(
|
||||||
lang(lng_in_reply_to).size()
|
tr::lng_in_reply_to(tr::now).size()
|
||||||
+ name.size()
|
+ name.size()
|
||||||
+ 4
|
+ 4
|
||||||
+ text.expanded.size());
|
+ text.expanded.size());
|
||||||
return result.append('['
|
return result.append('['
|
||||||
).append(lang(lng_in_reply_to)
|
).append(tr::lng_in_reply_to(tr::now)
|
||||||
).append(' '
|
).append(' '
|
||||||
).append(name
|
).append(name
|
||||||
).append(qstr("]\n")
|
).append(qstr("]\n")
|
||||||
|
@ -123,6 +123,6 @@ TextForMimeData HistoryGroupText(not_null<const Data::Group*> group) {
|
||||||
return (++first == end) ? result : TextForMimeData();
|
return (++first == end) ? result : TextForMimeData();
|
||||||
}();
|
}();
|
||||||
return WrapAsItem(group->items.back(), Data::WithCaptionClipboardText(
|
return WrapAsItem(group->items.back(), Data::WithCaptionClipboardText(
|
||||||
lang(lng_in_dlg_album),
|
tr::lng_in_dlg_album(tr::now),
|
||||||
std::move(caption)));
|
std::move(caption)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ QString LocationClickHandler::copyToClipboardText() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LocationClickHandler::copyToClipboardContextItemText() const {
|
QString LocationClickHandler::copyToClipboardContextItemText() const {
|
||||||
return lang(lng_context_copy_link);
|
return tr::lng_context_copy_link(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationClickHandler::onClick(ClickContext context) const {
|
void LocationClickHandler::onClick(ClickContext context) const {
|
||||||
|
|
|
@ -141,7 +141,7 @@ void FastShareMessage(not_null<HistoryItem*> item) {
|
||||||
|
|
||||||
QApplication::clipboard()->setText(link);
|
QApplication::clipboard()->setText(link);
|
||||||
|
|
||||||
Ui::Toast::Show(lang(lng_share_game_link_copied));
|
Ui::Toast::Show(tr::lng_share_game_link_copied(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ void FastShareMessage(not_null<HistoryItem*> item) {
|
||||||
history->session().api().applyUpdates(updates);
|
history->session().api().applyUpdates(updates);
|
||||||
data->requests.remove(requestId);
|
data->requests.remove(requestId);
|
||||||
if (data->requests.empty()) {
|
if (data->requests.empty()) {
|
||||||
Ui::Toast::Show(lang(lng_share_done));
|
Ui::Toast::Show(tr::lng_share_done(tr::now));
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -276,7 +276,7 @@ QString GetErrorTextForForward(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
const HistoryItemsList &items) {
|
const HistoryItemsList &items) {
|
||||||
if (!peer->canWrite()) {
|
if (!peer->canWrite()) {
|
||||||
return lang(lng_forward_cant);
|
return tr::lng_forward_cant(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto item : items) {
|
for (const auto item : items) {
|
||||||
|
@ -287,12 +287,10 @@ QString GetErrorTextForForward(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto errorKey = Data::RestrictionErrorKey(
|
const auto error = Data::RestrictionError(
|
||||||
peer,
|
peer,
|
||||||
ChatRestriction::f_send_inline);
|
ChatRestriction::f_send_inline);
|
||||||
return (errorKey && HasInlineItems(items))
|
return (error && HasInlineItems(items)) ? *error : QString();
|
||||||
? lang(*errorKey)
|
|
||||||
: QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct HistoryMessage::CreateConfig {
|
struct HistoryMessage::CreateConfig {
|
||||||
|
@ -893,7 +891,7 @@ void HistoryMessage::replaceBuyWithReceiptInMarkup() {
|
||||||
for (auto &row : markup->rows) {
|
for (auto &row : markup->rows) {
|
||||||
for (auto &button : row) {
|
for (auto &button : row) {
|
||||||
if (button.type == HistoryMessageMarkupButton::Type::Buy) {
|
if (button.type == HistoryMessageMarkupButton::Type::Buy) {
|
||||||
button.text = lang(lng_payments_receipt_button);
|
button.text = tr::lng_payments_receipt_button(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareChannelCreate = [this](const MTPDmessageActionChannelCreate &action) {
|
auto prepareChannelCreate = [this](const MTPDmessageActionChannelCreate &action) {
|
||||||
auto result = PreparedText {};
|
auto result = PreparedText {};
|
||||||
if (isPost()) {
|
if (isPost()) {
|
||||||
result.text = lang(lng_action_created_channel);
|
result.text = tr::lng_action_created_channel(tr::now);
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_created_chat(lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
result.text = lng_action_created_chat(lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
||||||
|
@ -99,7 +99,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareChatDeletePhoto = [this] {
|
auto prepareChatDeletePhoto = [this] {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
if (isPost()) {
|
if (isPost()) {
|
||||||
result.text = lang(lng_action_removed_photo_channel);
|
result.text = tr::lng_action_removed_photo_channel(tr::now);
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_removed_photo(lt_from, fromLinkText());
|
result.text = lng_action_removed_photo(lt_from, fromLinkText());
|
||||||
|
@ -124,7 +124,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareChatEditPhoto = [this](const MTPDmessageActionChatEditPhoto &action) {
|
auto prepareChatEditPhoto = [this](const MTPDmessageActionChatEditPhoto &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
if (isPost()) {
|
if (isPost()) {
|
||||||
result.text = lang(lng_action_changed_photo_channel);
|
result.text = tr::lng_action_changed_photo_channel(tr::now);
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_changed_photo(lt_from, fromLinkText());
|
result.text = lng_action_changed_photo(lt_from, fromLinkText());
|
||||||
|
@ -146,7 +146,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareScreenshotTaken = [this] {
|
auto prepareScreenshotTaken = [this] {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
if (out()) {
|
if (out()) {
|
||||||
result.text = lang(lng_action_you_took_screenshot);
|
result.text = tr::lng_action_you_took_screenshot(tr::now);
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_took_screenshot(lt_from, fromLinkText());
|
result.text = lng_action_took_screenshot(lt_from, fromLinkText());
|
||||||
|
@ -176,24 +176,24 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
documents.push_back([&] {
|
documents.push_back([&] {
|
||||||
switch (type.type()) {
|
switch (type.type()) {
|
||||||
case mtpc_secureValueTypePersonalDetails:
|
case mtpc_secureValueTypePersonalDetails:
|
||||||
return lang(lng_action_secure_personal_details);
|
return tr::lng_action_secure_personal_details(tr::now);
|
||||||
case mtpc_secureValueTypePassport:
|
case mtpc_secureValueTypePassport:
|
||||||
case mtpc_secureValueTypeDriverLicense:
|
case mtpc_secureValueTypeDriverLicense:
|
||||||
case mtpc_secureValueTypeIdentityCard:
|
case mtpc_secureValueTypeIdentityCard:
|
||||||
case mtpc_secureValueTypeInternalPassport:
|
case mtpc_secureValueTypeInternalPassport:
|
||||||
return lang(lng_action_secure_proof_of_identity);
|
return tr::lng_action_secure_proof_of_identity(tr::now);
|
||||||
case mtpc_secureValueTypeAddress:
|
case mtpc_secureValueTypeAddress:
|
||||||
return lang(lng_action_secure_address);
|
return tr::lng_action_secure_address(tr::now);
|
||||||
case mtpc_secureValueTypeUtilityBill:
|
case mtpc_secureValueTypeUtilityBill:
|
||||||
case mtpc_secureValueTypeBankStatement:
|
case mtpc_secureValueTypeBankStatement:
|
||||||
case mtpc_secureValueTypeRentalAgreement:
|
case mtpc_secureValueTypeRentalAgreement:
|
||||||
case mtpc_secureValueTypePassportRegistration:
|
case mtpc_secureValueTypePassportRegistration:
|
||||||
case mtpc_secureValueTypeTemporaryRegistration:
|
case mtpc_secureValueTypeTemporaryRegistration:
|
||||||
return lang(lng_action_secure_proof_of_address);
|
return tr::lng_action_secure_proof_of_address(tr::now);
|
||||||
case mtpc_secureValueTypePhone:
|
case mtpc_secureValueTypePhone:
|
||||||
return lang(lng_action_secure_phone);
|
return tr::lng_action_secure_phone(tr::now);
|
||||||
case mtpc_secureValueTypeEmail:
|
case mtpc_secureValueTypeEmail:
|
||||||
return lang(lng_action_secure_email);
|
return tr::lng_action_secure_email(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("Type in prepareSecureValuesSent.");
|
Unexpected("Type in prepareSecureValuesSent.");
|
||||||
}());
|
}());
|
||||||
|
@ -257,12 +257,12 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
return prepareContactSignUp();
|
return prepareContactSignUp();
|
||||||
}, [](const MTPDmessageActionPaymentSentMe &) {
|
}, [](const MTPDmessageActionPaymentSentMe &) {
|
||||||
LOG(("API Error: messageActionPaymentSentMe received."));
|
LOG(("API Error: messageActionPaymentSentMe received."));
|
||||||
return PreparedText{ lang(lng_message_empty) };
|
return PreparedText{ tr::lng_message_empty(tr::now) };
|
||||||
}, [](const MTPDmessageActionSecureValuesSentMe &) {
|
}, [](const MTPDmessageActionSecureValuesSentMe &) {
|
||||||
LOG(("API Error: messageActionSecureValuesSentMe received."));
|
LOG(("API Error: messageActionSecureValuesSentMe received."));
|
||||||
return PreparedText{ lang(lng_message_empty) };
|
return PreparedText{ tr::lng_message_empty(tr::now) };
|
||||||
}, [](const MTPDmessageActionEmpty &) {
|
}, [](const MTPDmessageActionEmpty &) {
|
||||||
return PreparedText{ lang(lng_message_empty) };
|
return PreparedText{ tr::lng_message_empty(tr::now) };
|
||||||
});
|
});
|
||||||
|
|
||||||
setServiceText(messageText);
|
setServiceText(messageText);
|
||||||
|
@ -393,10 +393,10 @@ HistoryService::PreparedText HistoryService::preparePinnedText() {
|
||||||
} else if (pinned && pinned->msgId) {
|
} else if (pinned && pinned->msgId) {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.links.push_back(pinned->lnk);
|
result.links.push_back(pinned->lnk);
|
||||||
result.text = lng_action_pinned_media(lt_from, fromLinkText(), lt_media, textcmdLink(2, lang(lng_contacts_loading)));
|
result.text = lng_action_pinned_media(lt_from, fromLinkText(), lt_media, textcmdLink(2, tr::lng_contacts_loading(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_pinned_media(lt_from, fromLinkText(), lt_media, lang(lng_deleted_message));
|
result.text = lng_action_pinned_media(lt_from, fromLinkText(), lt_media, tr::lng_deleted_message(tr::now));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -420,9 +420,9 @@ HistoryService::PreparedText HistoryService::prepareGameScoreText() {
|
||||||
return textcmdLink(result.links.size(), titleText);
|
return textcmdLink(result.links.size(), titleText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lang(lng_deleted_message);
|
return tr::lng_deleted_message(tr::now);
|
||||||
} else if (gamescore && gamescore->msgId) {
|
} else if (gamescore && gamescore->msgId) {
|
||||||
return lang(lng_contacts_loading);
|
return tr::lng_contacts_loading(tr::now);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
};
|
};
|
||||||
|
@ -474,9 +474,9 @@ HistoryService::PreparedText HistoryService::preparePaymentSentText() {
|
||||||
return invoice->title;
|
return invoice->title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lang(lng_deleted_message);
|
return tr::lng_deleted_message(tr::now);
|
||||||
} else if (payment && payment->msgId) {
|
} else if (payment && payment->msgId) {
|
||||||
return lang(lng_contacts_loading);
|
return tr::lng_contacts_loading(tr::now);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}();
|
}();
|
||||||
|
@ -592,8 +592,8 @@ crl::time HistoryService::getSelfDestructIn(crl::time now) {
|
||||||
if (selfdestruct->destructAt <= now) {
|
if (selfdestruct->destructAt <= now) {
|
||||||
auto text = [selfdestruct] {
|
auto text = [selfdestruct] {
|
||||||
switch (selfdestruct->type) {
|
switch (selfdestruct->type) {
|
||||||
case HistoryServiceSelfDestruct::Type::Photo: return lang(lng_ttl_photo_expired);
|
case HistoryServiceSelfDestruct::Type::Photo: return tr::lng_ttl_photo_expired(tr::now);
|
||||||
case HistoryServiceSelfDestruct::Type::Video: return lang(lng_ttl_video_expired);
|
case HistoryServiceSelfDestruct::Type::Video: return tr::lng_ttl_video_expired(tr::now);
|
||||||
}
|
}
|
||||||
Unexpected("Type in HistoryServiceSelfDestruct::Type");
|
Unexpected("Type in HistoryServiceSelfDestruct::Type");
|
||||||
};
|
};
|
||||||
|
@ -615,7 +615,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
Assert(photo.has_ttl_seconds());
|
Assert(photo.has_ttl_seconds());
|
||||||
setSelfDestruct(HistoryServiceSelfDestruct::Type::Photo, photo.vttl_seconds.v);
|
setSelfDestruct(HistoryServiceSelfDestruct::Type::Photo, photo.vttl_seconds.v);
|
||||||
if (out()) {
|
if (out()) {
|
||||||
setServiceText({ lang(lng_ttl_photo_sent) });
|
setServiceText({ tr::lng_ttl_photo_sent(tr::now) });
|
||||||
} else {
|
} else {
|
||||||
auto result = PreparedText();
|
auto result = PreparedText();
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
|
@ -623,7 +623,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
setServiceText(std::move(result));
|
setServiceText(std::move(result));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setServiceText({ lang(lng_ttl_photo_expired) });
|
setServiceText({ tr::lng_ttl_photo_expired(tr::now) });
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case mtpc_messageMediaDocument: {
|
case mtpc_messageMediaDocument: {
|
||||||
|
@ -632,7 +632,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
Assert(document.has_ttl_seconds());
|
Assert(document.has_ttl_seconds());
|
||||||
setSelfDestruct(HistoryServiceSelfDestruct::Type::Video, document.vttl_seconds.v);
|
setSelfDestruct(HistoryServiceSelfDestruct::Type::Video, document.vttl_seconds.v);
|
||||||
if (out()) {
|
if (out()) {
|
||||||
setServiceText({ lang(lng_ttl_video_sent) });
|
setServiceText({ tr::lng_ttl_video_sent(tr::now) });
|
||||||
} else {
|
} else {
|
||||||
auto result = PreparedText();
|
auto result = PreparedText();
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
|
@ -640,7 +640,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
setServiceText(std::move(result));
|
setServiceText(std::move(result));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setServiceText({ lang(lng_ttl_video_expired) });
|
setServiceText({ tr::lng_ttl_video_expired(tr::now) });
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -767,7 +767,7 @@ HistoryService::PreparedText GenerateJoinedText(
|
||||||
textcmdLink(1, self->name));
|
textcmdLink(1, self->name));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return { lang(lng_action_you_joined) };
|
return { tr::lng_action_you_joined(tr::now) };
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryService *GenerateJoinedMessage(
|
HistoryService *GenerateJoinedMessage(
|
||||||
|
|
|
@ -252,15 +252,15 @@ HistoryWidget::HistoryWidget(
|
||||||
? object_ptr<Support::Autocomplete>(this, &session())
|
? object_ptr<Support::Autocomplete>(this, &session())
|
||||||
: nullptr)
|
: nullptr)
|
||||||
, _send(this)
|
, _send(this)
|
||||||
, _unblock(this, lang(lng_unblock_button).toUpper(), st::historyUnblock)
|
, _unblock(this, tr::lng_unblock_button(tr::now).toUpper(), st::historyUnblock)
|
||||||
, _botStart(this, lang(lng_bot_start).toUpper(), st::historyComposeButton)
|
, _botStart(this, tr::lng_bot_start(tr::now).toUpper(), st::historyComposeButton)
|
||||||
, _joinChannel(
|
, _joinChannel(
|
||||||
this,
|
this,
|
||||||
lang(lng_profile_join_channel).toUpper(),
|
tr::lng_profile_join_channel(tr::now).toUpper(),
|
||||||
st::historyComposeButton)
|
st::historyComposeButton)
|
||||||
, _muteUnmute(
|
, _muteUnmute(
|
||||||
this,
|
this,
|
||||||
lang(lng_channel_mute).toUpper(),
|
tr::lng_channel_mute(tr::now).toUpper(),
|
||||||
st::historyComposeButton)
|
st::historyComposeButton)
|
||||||
, _discuss(SetupDiscussButton(this, controller))
|
, _discuss(SetupDiscussButton(this, controller))
|
||||||
, _attachToggle(this, st::historyAttach)
|
, _attachToggle(this, st::historyAttach)
|
||||||
|
@ -273,7 +273,7 @@ HistoryWidget::HistoryWidget(
|
||||||
st::historyComposeField,
|
st::historyComposeField,
|
||||||
Ui::InputField::Mode::MultiLine,
|
Ui::InputField::Mode::MultiLine,
|
||||||
tr::lng_message_ph())
|
tr::lng_message_ph())
|
||||||
, _recordCancelWidth(st::historyRecordFont->width(lang(lng_record_cancel)))
|
, _recordCancelWidth(st::historyRecordFont->width(tr::lng_record_cancel(tr::now)))
|
||||||
, _recordingAnimation([=](crl::time now) {
|
, _recordingAnimation([=](crl::time now) {
|
||||||
return recordingAnimationCallback(now);
|
return recordingAnimationCallback(now);
|
||||||
})
|
})
|
||||||
|
@ -1693,16 +1693,16 @@ void HistoryWidget::showHistory(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_peer) {
|
if (_peer) {
|
||||||
_unblock->setText(lang((_peer->isUser()
|
_unblock->setText(((_peer->isUser()
|
||||||
&& _peer->asUser()->isBot()
|
&& _peer->asUser()->isBot()
|
||||||
&& !_peer->asUser()->isSupport())
|
&& !_peer->asUser()->isSupport())
|
||||||
? lng_restart_button
|
? tr::lng_restart_button(tr::now)
|
||||||
: lng_unblock_button).toUpper());
|
: tr::lng_unblock_button(tr::now)).toUpper());
|
||||||
if (const auto channel = _peer->asChannel()) {
|
if (const auto channel = _peer->asChannel()) {
|
||||||
channel->updateFull();
|
channel->updateFull();
|
||||||
_joinChannel->setText(lang(channel->isMegagroup()
|
_joinChannel->setText((channel->isMegagroup()
|
||||||
? lng_profile_join_group
|
? tr::lng_profile_join_group(tr::now)
|
||||||
: lng_profile_join_channel).toUpper());
|
: tr::lng_profile_join_channel(tr::now)).toUpper());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1841,9 +1841,9 @@ void HistoryWidget::updateFieldSubmitSettings() {
|
||||||
void HistoryWidget::updateNotifyControls() {
|
void HistoryWidget::updateNotifyControls() {
|
||||||
if (!_peer || !_peer->isChannel()) return;
|
if (!_peer || !_peer->isChannel()) return;
|
||||||
|
|
||||||
_muteUnmute->setText(lang(_history->mute()
|
_muteUnmute->setText((_history->mute()
|
||||||
? lng_channel_unmute
|
? tr::lng_channel_unmute(tr::now)
|
||||||
: lng_channel_mute).toUpper());
|
: tr::lng_channel_mute(tr::now)).toUpper());
|
||||||
if (!session().data().notifySilentPostsUnknown(_peer)) {
|
if (!session().data().notifySilentPostsUnknown(_peer)) {
|
||||||
if (_silent) {
|
if (_silent) {
|
||||||
_silent->setChecked(session().data().notifySilentPosts(_peer));
|
_silent->setChecked(session().data().notifySilentPosts(_peer));
|
||||||
|
@ -1878,9 +1878,9 @@ bool HistoryWidget::canWriteMessage() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<LangKey> HistoryWidget::writeRestrictionKey() const {
|
std::optional<QString> HistoryWidget::writeRestriction() const {
|
||||||
return _peer
|
return _peer
|
||||||
? Data::RestrictionErrorKey(_peer, ChatRestriction::f_send_messages)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_messages)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2096,7 +2096,7 @@ void HistoryWidget::refreshAboutProxyPromotion() {
|
||||||
this,
|
this,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
this,
|
this,
|
||||||
lang(lng_proxy_sponsor_about),
|
tr::lng_proxy_sponsor_about(tr::now),
|
||||||
st::historyAboutProxy),
|
st::historyAboutProxy),
|
||||||
st::historyAboutProxyPadding);
|
st::historyAboutProxyPadding);
|
||||||
}
|
}
|
||||||
|
@ -2178,7 +2178,7 @@ bool HistoryWidget::messagesFailed(const RPCError &error, mtpRequestId requestId
|
||||||
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
||||||
auto was = _peer;
|
auto was = _peer;
|
||||||
controller()->showBackFromStack();
|
controller()->showBackFromStack();
|
||||||
Ui::show(Box<InformBox>(lang((was && was->isMegagroup()) ? lng_group_not_accessible : lng_channel_not_accessible)));
|
Ui::show(Box<InformBox>((was && was->isMegagroup()) ? tr::lng_group_not_accessible(tr::now) : tr::lng_channel_not_accessible(tr::now)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2714,7 +2714,7 @@ void HistoryWidget::saveEditMsg() {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (!left.text.isEmpty()) {
|
} else if (!left.text.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_edit_too_long)));
|
Ui::show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2768,14 +2768,14 @@ bool HistoryWidget::saveEditMsgFail(History *history, const RPCError &error, mtp
|
||||||
|
|
||||||
const auto &err = error.type();
|
const auto &err = error.type();
|
||||||
if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) {
|
if (err == qstr("MESSAGE_ID_INVALID") || err == qstr("CHAT_ADMIN_REQUIRED") || err == qstr("MESSAGE_EDIT_TIME_EXPIRED")) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_edit_error)));
|
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
} else if (err == qstr("MESSAGE_NOT_MODIFIED")) {
|
} else if (err == qstr("MESSAGE_NOT_MODIFIED")) {
|
||||||
cancelEdit();
|
cancelEdit();
|
||||||
} else if (err == qstr("MESSAGE_EMPTY")) {
|
} else if (err == qstr("MESSAGE_EMPTY")) {
|
||||||
_field->selectAll();
|
_field->selectAll();
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(lang(lng_edit_error)));
|
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
|
@ -3005,16 +3005,16 @@ bool HistoryWidget::recordingAnimationCallback(crl::time now) {
|
||||||
void HistoryWidget::chooseAttach() {
|
void HistoryWidget::chooseAttach() {
|
||||||
if (!_peer || !_peer->canWrite()) {
|
if (!_peer || !_peer->canWrite()) {
|
||||||
return;
|
return;
|
||||||
} else if (const auto key = Data::RestrictionErrorKey(
|
} else if (const auto error = Data::RestrictionError(
|
||||||
_peer,
|
_peer,
|
||||||
ChatRestriction::f_send_media)) {
|
ChatRestriction::f_send_media)) {
|
||||||
Ui::show(Box<InformBox>(lang(*key)));
|
Ui::show(Box<InformBox>(*error));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto filter = FileDialog::AllFilesFilter() + qsl(";;Image files (*") + cImgExtensions().join(qsl(" *")) + qsl(")");
|
auto filter = FileDialog::AllFilesFilter() + qsl(";;Image files (*") + cImgExtensions().join(qsl(" *")) + qsl(")");
|
||||||
|
|
||||||
FileDialog::GetOpenPaths(this, lang(lng_choose_files), filter, crl::guard(this, [this](FileDialog::OpenResult &&result) {
|
FileDialog::GetOpenPaths(this, tr::lng_choose_files(tr::now), filter, crl::guard(this, [this](FileDialog::OpenResult &&result) {
|
||||||
if (result.paths.isEmpty() && result.remoteContent.isEmpty()) {
|
if (result.paths.isEmpty() && result.remoteContent.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3114,11 +3114,11 @@ void HistoryWidget::leaveToChildEvent(QEvent *e, QWidget *child) { // e -- from
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::recordStartCallback() {
|
void HistoryWidget::recordStartCallback() {
|
||||||
const auto errorKey = _peer
|
const auto error = _peer
|
||||||
? Data::RestrictionErrorKey(_peer, ChatRestriction::f_send_media)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (errorKey) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(lang(*errorKey)));
|
Ui::show(Box<InformBox>(*error));
|
||||||
return;
|
return;
|
||||||
} else if (!Media::Capture::instance()->available()) {
|
} else if (!Media::Capture::instance()->available()) {
|
||||||
return;
|
return;
|
||||||
|
@ -3400,18 +3400,18 @@ void HistoryWidget::updateDragAreas() {
|
||||||
_attachDragPhoto->otherLeave();
|
_attachDragPhoto->otherLeave();
|
||||||
break;
|
break;
|
||||||
case DragState::Files:
|
case DragState::Files:
|
||||||
_attachDragDocument->setText(lang(lng_drag_files_here), lang(lng_drag_to_send_files));
|
_attachDragDocument->setText(tr::lng_drag_files_here(tr::now), tr::lng_drag_to_send_files(tr::now));
|
||||||
_attachDragDocument->otherEnter();
|
_attachDragDocument->otherEnter();
|
||||||
_attachDragPhoto->hideFast();
|
_attachDragPhoto->hideFast();
|
||||||
break;
|
break;
|
||||||
case DragState::PhotoFiles:
|
case DragState::PhotoFiles:
|
||||||
_attachDragDocument->setText(lang(lng_drag_images_here), lang(lng_drag_to_send_no_compression));
|
_attachDragDocument->setText(tr::lng_drag_images_here(tr::now), tr::lng_drag_to_send_no_compression(tr::now));
|
||||||
_attachDragPhoto->setText(lang(lng_drag_photos_here), lang(lng_drag_to_send_quick));
|
_attachDragPhoto->setText(tr::lng_drag_photos_here(tr::now), tr::lng_drag_to_send_quick(tr::now));
|
||||||
_attachDragDocument->otherEnter();
|
_attachDragDocument->otherEnter();
|
||||||
_attachDragPhoto->otherEnter();
|
_attachDragPhoto->otherEnter();
|
||||||
break;
|
break;
|
||||||
case DragState::Image:
|
case DragState::Image:
|
||||||
_attachDragPhoto->setText(lang(lng_drag_images_here), lang(lng_drag_to_send_quick));
|
_attachDragPhoto->setText(tr::lng_drag_images_here(tr::now), tr::lng_drag_to_send_quick(tr::now));
|
||||||
_attachDragDocument->hideFast();
|
_attachDragDocument->hideFast();
|
||||||
_attachDragPhoto->otherEnter();
|
_attachDragPhoto->otherEnter();
|
||||||
break;
|
break;
|
||||||
|
@ -3921,15 +3921,15 @@ void HistoryWidget::updateFieldPlaceholder() {
|
||||||
bool HistoryWidget::showSendingFilesError(
|
bool HistoryWidget::showSendingFilesError(
|
||||||
const Storage::PreparedList &list) const {
|
const Storage::PreparedList &list) const {
|
||||||
const auto text = [&] {
|
const auto text = [&] {
|
||||||
const auto errorKey = _peer
|
const auto error = _peer
|
||||||
? Data::RestrictionErrorKey(
|
? Data::RestrictionError(
|
||||||
_peer,
|
_peer,
|
||||||
ChatRestriction::f_send_media)
|
ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (errorKey) {
|
if (error) {
|
||||||
return lang(*errorKey);
|
return *error;
|
||||||
} else if (!canWriteMessage()) {
|
} else if (!canWriteMessage()) {
|
||||||
return lang(lng_forward_send_files_cant);
|
return tr::lng_forward_send_files_cant(tr::now);
|
||||||
}
|
}
|
||||||
using Error = Storage::PreparedList::Error;
|
using Error = Storage::PreparedList::Error;
|
||||||
switch (list.error) {
|
switch (list.error) {
|
||||||
|
@ -3943,7 +3943,7 @@ bool HistoryWidget::showSendingFilesError(
|
||||||
lt_name,
|
lt_name,
|
||||||
list.errorData);
|
list.errorData);
|
||||||
}
|
}
|
||||||
return lang(lng_forward_send_files_cant);
|
return tr::lng_forward_send_files_cant(tr::now);
|
||||||
}();
|
}();
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -4743,7 +4743,7 @@ void HistoryWidget::updateHistoryGeometry(bool initial, bool loadedDown, const S
|
||||||
} else {
|
} else {
|
||||||
if (editingMessage() || _canSendMessages) {
|
if (editingMessage() || _canSendMessages) {
|
||||||
newScrollHeight -= (_field->height() + 2 * st::historySendPadding);
|
newScrollHeight -= (_field->height() + 2 * st::historySendPadding);
|
||||||
} else if (writeRestrictionKey().has_value()) {
|
} else if (writeRestriction().has_value()) {
|
||||||
newScrollHeight -= _unblock->height();
|
newScrollHeight -= _unblock->height();
|
||||||
}
|
}
|
||||||
if (_editMsgId || replyToId() || readyToForward() || (_previewData && _previewData->pendingTill >= 0)) {
|
if (_editMsgId || replyToId() || readyToForward() || (_previewData && _previewData->pendingTill >= 0)) {
|
||||||
|
@ -5400,11 +5400,11 @@ void HistoryWidget::destroyPinnedBar() {
|
||||||
bool HistoryWidget::sendExistingDocument(
|
bool HistoryWidget::sendExistingDocument(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
TextWithEntities caption) {
|
TextWithEntities caption) {
|
||||||
const auto errorKey = _peer
|
const auto error = _peer
|
||||||
? Data::RestrictionErrorKey(_peer, ChatRestriction::f_send_stickers)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (errorKey) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(lang(*errorKey)), LayerOption::KeepOther);
|
Ui::show(Box<InformBox>(*error), LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (!_peer || !_peer->canWrite()) {
|
} else if (!_peer || !_peer->canWrite()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5435,11 +5435,11 @@ bool HistoryWidget::sendExistingDocument(
|
||||||
bool HistoryWidget::sendExistingPhoto(
|
bool HistoryWidget::sendExistingPhoto(
|
||||||
not_null<PhotoData*> photo,
|
not_null<PhotoData*> photo,
|
||||||
TextWithEntities caption) {
|
TextWithEntities caption) {
|
||||||
const auto errorKey = _peer
|
const auto error = _peer
|
||||||
? Data::RestrictionErrorKey(_peer, ChatRestriction::f_send_media)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (errorKey) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(lang(*errorKey)), LayerOption::KeepOther);
|
Ui::show(Box<InformBox>(*error), LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (!_peer || !_peer->canWrite()) {
|
} else if (!_peer || !_peer->canWrite()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5562,10 +5562,10 @@ void HistoryWidget::replyToMessage(not_null<HistoryItem*> item) {
|
||||||
}
|
}
|
||||||
if (item->history() == _migrated) {
|
if (item->history() == _migrated) {
|
||||||
if (item->serviceMsg()) {
|
if (item->serviceMsg()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_reply_cant)));
|
Ui::show(Box<InformBox>(tr::lng_reply_cant(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_reply_cant_forward), lang(lng_selected_forward), crl::guard(this, [=] {
|
Ui::show(Box<ConfirmBox>(tr::lng_reply_cant_forward(tr::now), tr::lng_selected_forward(tr::now), crl::guard(this, [=] {
|
||||||
App::main()->setForwardDraft(
|
App::main()->setForwardDraft(
|
||||||
_peer->id,
|
_peer->id,
|
||||||
{ 1, itemId });
|
{ 1, itemId });
|
||||||
|
@ -5683,7 +5683,7 @@ void HistoryWidget::unpinMessage(FullMsgId itemId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::show(Box<ConfirmBox>(lang(lng_pinned_unpin_sure), lang(lng_pinned_unpin), crl::guard(this, [=] {
|
Ui::show(Box<ConfirmBox>(tr::lng_pinned_unpin_sure(tr::now), tr::lng_pinned_unpin(tr::now), crl::guard(this, [=] {
|
||||||
peer->clearPinnedMessage();
|
peer->clearPinnedMessage();
|
||||||
|
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
|
@ -5944,7 +5944,7 @@ void HistoryWidget::updatePreview() {
|
||||||
if (_previewData->pendingTill) {
|
if (_previewData->pendingTill) {
|
||||||
_previewTitle.setText(
|
_previewTitle.setText(
|
||||||
st::msgNameStyle,
|
st::msgNameStyle,
|
||||||
lang(lng_preview_loading),
|
tr::lng_preview_loading(tr::now),
|
||||||
Ui::NameTextOptions());
|
Ui::NameTextOptions());
|
||||||
#ifndef OS_MAC_OLD
|
#ifndef OS_MAC_OLD
|
||||||
auto linkText = _previewLinks.splitRef(' ').at(0).toString();
|
auto linkText = _previewLinks.splitRef(' ').at(0).toString();
|
||||||
|
@ -5979,9 +5979,9 @@ void HistoryWidget::updatePreview() {
|
||||||
}
|
}
|
||||||
if (title.isEmpty()) {
|
if (title.isEmpty()) {
|
||||||
if (_previewData->document) {
|
if (_previewData->document) {
|
||||||
title = lang(lng_attach_file);
|
title = tr::lng_attach_file(tr::now);
|
||||||
} else if (_previewData->photo) {
|
} else if (_previewData->photo) {
|
||||||
title = lang(lng_attach_photo);
|
title = tr::lng_attach_photo(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_previewTitle.setText(
|
_previewTitle.setText(
|
||||||
|
@ -6103,9 +6103,9 @@ void HistoryWidget::escape() {
|
||||||
if (_replyEditMsg
|
if (_replyEditMsg
|
||||||
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lang(lng_cancel_edit_post_sure),
|
tr::lng_cancel_edit_post_sure(tr::now),
|
||||||
lang(lng_cancel_edit_post_yes),
|
tr::lng_cancel_edit_post_yes(tr::now),
|
||||||
lang(lng_cancel_edit_post_no),
|
tr::lng_cancel_edit_post_no(tr::now),
|
||||||
crl::guard(this, [this] {
|
crl::guard(this, [this] {
|
||||||
if (_editMsgId) {
|
if (_editMsgId) {
|
||||||
cancelEdit();
|
cancelEdit();
|
||||||
|
@ -6362,7 +6362,7 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) {
|
||||||
} else {
|
} else {
|
||||||
p.setFont(st::msgDateFont);
|
p.setFont(st::msgDateFont);
|
||||||
p.setPen(st::historyComposeAreaFgService);
|
p.setPen(st::historyComposeAreaFgService);
|
||||||
p.drawText(replyLeft, backy + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()));
|
p.drawText(replyLeft, backy + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(tr::lng_profile_loading(tr::now), width() - replyLeft - _fieldBarCancel->width() - st::msgReplyPadding.right()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (hasForward) {
|
} else if (hasForward) {
|
||||||
|
@ -6435,7 +6435,7 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setFont(st::msgServiceNameFont);
|
p.setFont(st::msgServiceNameFont);
|
||||||
p.drawTextLeft(left, top + st::msgReplyPadding.top(), width(), lang(lng_edit_message));
|
p.drawTextLeft(left, top + st::msgReplyPadding.top(), width(), tr::lng_edit_message(tr::now));
|
||||||
|
|
||||||
if (!_replyEditMsg || _replyEditMsg->history()->peer->isSelf()) return;
|
if (!_replyEditMsg || _replyEditMsg->history()->peer->isSelf()) return;
|
||||||
|
|
||||||
|
@ -6466,7 +6466,7 @@ void HistoryWidget::paintEditHeader(Painter &p, const QRect &rect, int left, int
|
||||||
if (!editTimeLeftText.isEmpty()) {
|
if (!editTimeLeftText.isEmpty()) {
|
||||||
p.setFont(st::normalFont);
|
p.setFont(st::normalFont);
|
||||||
p.setPen(st::historyComposeAreaFgService);
|
p.setPen(st::historyComposeAreaFgService);
|
||||||
p.drawText(left + st::msgServiceNameFont->width(lang(lng_edit_message)) + st::normalFont->spacew, top + st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, editTimeLeftText);
|
p.drawText(left + st::msgServiceNameFont->width(tr::lng_edit_message(tr::now)) + st::normalFont->spacew, top + st::msgReplyPadding.top() + st::msgServiceNameFont->ascent, editTimeLeftText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6491,7 +6491,7 @@ void HistoryWidget::drawRecording(Painter &p, float64 recordActive) {
|
||||||
int32 right = width() - _send->width();
|
int32 right = width() - _send->width();
|
||||||
|
|
||||||
p.setPen(anim::pen(st::historyRecordCancel, st::historyRecordCancelActive, 1. - recordActive));
|
p.setPen(anim::pen(st::historyRecordCancel, st::historyRecordCancelActive, 1. - recordActive));
|
||||||
p.drawText(left + (right - left - _recordCancelWidth) / 2, _attachToggle->y() + st::historyRecordTextTop + st::historyRecordFont->ascent, lang(lng_record_cancel));
|
p.drawText(left + (right - left - _recordCancelWidth) / 2, _attachToggle->y() + st::historyRecordTextTop + st::historyRecordFont->ascent, tr::lng_record_cancel(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::drawPinnedBar(Painter &p) {
|
void HistoryWidget::drawPinnedBar(Painter &p) {
|
||||||
|
@ -6518,7 +6518,7 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
|
||||||
}
|
}
|
||||||
p.setPen(st::historyReplyNameFg);
|
p.setPen(st::historyReplyNameFg);
|
||||||
p.setFont(st::msgServiceNameFont);
|
p.setFont(st::msgServiceNameFont);
|
||||||
p.drawText(left, top + st::msgServiceNameFont->ascent, lang((media && media->poll()) ? lng_pinned_poll : lng_pinned_message));
|
p.drawText(left, top + st::msgServiceNameFont->ascent, (media && media->poll()) ? tr::lng_pinned_poll(tr::now) : tr::lng_pinned_message(tr::now));
|
||||||
|
|
||||||
p.setPen(st::historyComposeAreaFg);
|
p.setPen(st::historyComposeAreaFg);
|
||||||
p.setTextPalette(st::historyComposeAreaPalette);
|
p.setTextPalette(st::historyComposeAreaPalette);
|
||||||
|
@ -6527,7 +6527,7 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
|
||||||
} else {
|
} else {
|
||||||
p.setFont(st::msgDateFont);
|
p.setFont(st::msgDateFont);
|
||||||
p.setPen(st::historyComposeAreaFgService);
|
p.setPen(st::historyComposeAreaFgService);
|
||||||
p.drawText(left, top + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(lang(lng_profile_loading), width() - left - _pinnedBar->cancel->width() - st::msgReplyPadding.right()));
|
p.drawText(left, top + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2 + st::msgDateFont->ascent, st::msgDateFont->elided(tr::lng_profile_loading(tr::now), width() - left - _pinnedBar->cancel->width() - st::msgReplyPadding.right()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6577,8 +6577,8 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||||
if (!_send->isHidden() && _recording) {
|
if (!_send->isHidden() && _recording) {
|
||||||
drawRecording(p, _send->recordActiveRatio());
|
drawRecording(p, _send->recordActiveRatio());
|
||||||
}
|
}
|
||||||
} else if (const auto errorKey = writeRestrictionKey()) {
|
} else if (const auto error = writeRestriction()) {
|
||||||
drawRestrictedWrite(p, lang(*errorKey));
|
drawRestrictedWrite(p, *error);
|
||||||
}
|
}
|
||||||
if (_aboutProxyPromotion) {
|
if (_aboutProxyPromotion) {
|
||||||
p.fillRect(_aboutProxyPromotion->geometry(), st::historyReplyBg);
|
p.fillRect(_aboutProxyPromotion->geometry(), st::historyReplyBg);
|
||||||
|
@ -6587,7 +6587,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||||
drawPinnedBar(p);
|
drawPinnedBar(p);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto w = st::msgServiceFont->width(lang(lng_willbe_history))
|
const auto w = st::msgServiceFont->width(tr::lng_willbe_history(tr::now))
|
||||||
+ st::msgPadding.left()
|
+ st::msgPadding.left()
|
||||||
+ st::msgPadding.right();
|
+ st::msgPadding.right();
|
||||||
const auto h = st::msgServiceFont->height
|
const auto h = st::msgServiceFont->height
|
||||||
|
@ -6607,7 +6607,7 @@ void HistoryWidget::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
p.setPen(st::msgServiceFg);
|
p.setPen(st::msgServiceFg);
|
||||||
p.setFont(st::msgServiceFont->f);
|
p.setFont(st::msgServiceFont->f);
|
||||||
p.drawTextLeft(tr.left() + st::msgPadding.left(), tr.top() + st::msgServicePadding.top(), width(), lang(lng_willbe_history));
|
p.drawTextLeft(tr.left() + st::msgPadding.left(), tr.top() + st::msgServicePadding.top(), width(), tr::lng_willbe_history(tr::now));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -453,7 +453,7 @@ private:
|
||||||
void checkTabbedSelectorToggleTooltip();
|
void checkTabbedSelectorToggleTooltip();
|
||||||
|
|
||||||
bool canWriteMessage() const;
|
bool canWriteMessage() const;
|
||||||
std::optional<LangKey> writeRestrictionKey() const;
|
std::optional<QString> writeRestriction() const;
|
||||||
void orderWidgets();
|
void orderWidgets();
|
||||||
|
|
||||||
void clearInlineBot();
|
void clearInlineBot();
|
||||||
|
|
|
@ -109,10 +109,10 @@ QSize HistoryContact::countOptimalSize() {
|
||||||
}
|
}
|
||||||
if (_contact && _contact->isContact()) {
|
if (_contact && _contact->isContact()) {
|
||||||
_linkl = sendMessageClickHandler(_contact);
|
_linkl = sendMessageClickHandler(_contact);
|
||||||
_link = lang(lng_profile_send_message).toUpper();
|
_link = tr::lng_profile_send_message(tr::now).toUpper();
|
||||||
} else if (_userId) {
|
} else if (_userId) {
|
||||||
_linkl = addContactClickHandler(_parent->data());
|
_linkl = addContactClickHandler(_parent->data());
|
||||||
_link = lang(lng_profile_add_contact).toUpper();
|
_link = tr::lng_profile_add_contact(tr::now).toUpper();
|
||||||
}
|
}
|
||||||
_linkw = _link.isEmpty() ? 0 : st::semiboldFont->width(_link);
|
_linkw = _link.isEmpty() ? 0 : st::semiboldFont->width(_link);
|
||||||
|
|
||||||
|
|
|
@ -672,15 +672,15 @@ void HistoryDocument::setStatusSize(int newSize, qint64 realDuration) const {
|
||||||
HistoryFileMedia::setStatusSize(newSize, _data->size, duration, realDuration);
|
HistoryFileMedia::setStatusSize(newSize, _data->size, duration, realDuration);
|
||||||
if (auto thumbed = Get<HistoryDocumentThumbed>()) {
|
if (auto thumbed = Get<HistoryDocumentThumbed>()) {
|
||||||
if (_statusSize == FileStatusSizeReady) {
|
if (_statusSize == FileStatusSizeReady) {
|
||||||
thumbed->_link = lang(lng_media_download).toUpper();
|
thumbed->_link = tr::lng_media_download(tr::now).toUpper();
|
||||||
} else if (_statusSize == FileStatusSizeLoaded) {
|
} else if (_statusSize == FileStatusSizeLoaded) {
|
||||||
thumbed->_link = lang(lng_media_open_with).toUpper();
|
thumbed->_link = tr::lng_media_open_with(tr::now).toUpper();
|
||||||
} else if (_statusSize == FileStatusSizeFailed) {
|
} else if (_statusSize == FileStatusSizeFailed) {
|
||||||
thumbed->_link = lang(lng_media_download).toUpper();
|
thumbed->_link = tr::lng_media_download(tr::now).toUpper();
|
||||||
} else if (_statusSize >= 0) {
|
} else if (_statusSize >= 0) {
|
||||||
thumbed->_link = lang(lng_media_cancel).toUpper();
|
thumbed->_link = tr::lng_media_cancel(tr::now).toUpper();
|
||||||
} else {
|
} else {
|
||||||
thumbed->_link = lang(lng_media_open_with).toUpper();
|
thumbed->_link = tr::lng_media_open_with(tr::now).toUpper();
|
||||||
}
|
}
|
||||||
thumbed->_linkw = st::semiboldFont->width(thumbed->_link);
|
thumbed->_linkw = st::semiboldFont->width(thumbed->_link);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ void HistoryFileMedia::setStatusSize(int newSize, int fullSize, int duration, qi
|
||||||
} else if (_statusSize == FileStatusSizeLoaded) {
|
} else if (_statusSize == FileStatusSizeLoaded) {
|
||||||
_statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
_statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
||||||
} else if (_statusSize == FileStatusSizeFailed) {
|
} else if (_statusSize == FileStatusSizeFailed) {
|
||||||
_statusText = lang(lng_attach_failed);
|
_statusText = tr::lng_attach_failed(tr::now);
|
||||||
} else if (_statusSize >= 0) {
|
} else if (_statusSize >= 0) {
|
||||||
_statusText = formatDownloadText(_statusSize, fullSize);
|
_statusText = formatDownloadText(_statusSize, fullSize);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -123,7 +123,7 @@ QSize HistoryGame::countOptimalSize() {
|
||||||
minHeight += padding.top() + padding.bottom();
|
minHeight += padding.top() + padding.bottom();
|
||||||
|
|
||||||
if (!_gameTagWidth) {
|
if (!_gameTagWidth) {
|
||||||
_gameTagWidth = st::msgDateFont->width(lang(lng_game_tag).toUpper());
|
_gameTagWidth = st::msgDateFont->width(tr::lng_game_tag(tr::now).toUpper());
|
||||||
}
|
}
|
||||||
return { maxWidth, minHeight };
|
return { maxWidth, minHeight };
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ void HistoryGame::draw(Painter &p, const QRect &r, TextSelection selection, crl:
|
||||||
|
|
||||||
p.setFont(st::msgDateFont);
|
p.setFont(st::msgDateFont);
|
||||||
p.setPen(st::msgDateImgFg);
|
p.setPen(st::msgDateImgFg);
|
||||||
p.drawTextLeft(gameX + st::msgDateImgPadding.x(), gameY + st::msgDateImgPadding.y(), pixwidth, lang(lng_game_tag).toUpper());
|
p.drawTextLeft(gameX + st::msgDateImgPadding.x(), gameY + st::msgDateImgPadding.y(), pixwidth, tr::lng_game_tag(tr::now).toUpper());
|
||||||
|
|
||||||
p.translate(-attachLeft, -attachTop);
|
p.translate(-attachLeft, -attachTop);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ QSize HistoryGif::countOptimalSize() {
|
||||||
}
|
}
|
||||||
if (_gif && _gif->state() == Media::Clip::State::Error) {
|
if (_gif && _gif->state() == Media::Clip::State::Error) {
|
||||||
if (!_gif->autoplay()) {
|
if (!_gif->autoplay()) {
|
||||||
Ui::show(Box<InformBox>(lang(lng_gif_error)));
|
Ui::show(Box<InformBox>(tr::lng_gif_error(tr::now)));
|
||||||
}
|
}
|
||||||
setClipReader(Media::Clip::ReaderPointer::Bad());
|
setClipReader(Media::Clip::ReaderPointer::Bad());
|
||||||
}
|
}
|
||||||
|
@ -713,7 +713,7 @@ int HistoryGif::additionalWidth() const {
|
||||||
|
|
||||||
QString HistoryGif::mediaTypeString() const {
|
QString HistoryGif::mediaTypeString() const {
|
||||||
return _data->isVideoMessage()
|
return _data->isVideoMessage()
|
||||||
? lang(lng_in_dlg_video_message)
|
? tr::lng_in_dlg_video_message(tr::now)
|
||||||
: qsl("GIF");
|
: qsl("GIF");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,13 +45,13 @@ void HistoryInvoice::fillFromData(not_null<Data::Invoice*> invoice) {
|
||||||
auto labelText = [&] {
|
auto labelText = [&] {
|
||||||
if (invoice->receiptMsgId) {
|
if (invoice->receiptMsgId) {
|
||||||
if (invoice->isTest) {
|
if (invoice->isTest) {
|
||||||
return lang(lng_payments_receipt_label_test);
|
return tr::lng_payments_receipt_label_test(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_payments_receipt_label);
|
return tr::lng_payments_receipt_label(tr::now);
|
||||||
} else if (invoice->isTest) {
|
} else if (invoice->isTest) {
|
||||||
return lang(lng_payments_invoice_label_test);
|
return tr::lng_payments_invoice_label_test(tr::now);
|
||||||
}
|
}
|
||||||
return lang(lng_payments_invoice_label);
|
return tr::lng_payments_invoice_label(tr::now);
|
||||||
};
|
};
|
||||||
auto statusText = TextWithEntities {
|
auto statusText = TextWithEntities {
|
||||||
FillAmountAndCurrency(invoice->amount, invoice->currency),
|
FillAmountAndCurrency(invoice->amount, invoice->currency),
|
||||||
|
|
|
@ -304,7 +304,7 @@ void HistoryPoll::updateTexts() {
|
||||||
_closed = _poll->closed;
|
_closed = _poll->closed;
|
||||||
_subtitle.setText(
|
_subtitle.setText(
|
||||||
st::msgDateTextStyle,
|
st::msgDateTextStyle,
|
||||||
lang(_closed ? lng_polls_closed : lng_polls_anonymous));
|
_closed ? tr::lng_polls_closed(tr::now) : tr::lng_polls_anonymous(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAnswers();
|
updateAnswers();
|
||||||
|
@ -386,8 +386,8 @@ void HistoryPoll::updateTotalVotes() {
|
||||||
}
|
}
|
||||||
_totalVotes = _poll->totalVoters;
|
_totalVotes = _poll->totalVoters;
|
||||||
const auto string = !_totalVotes
|
const auto string = !_totalVotes
|
||||||
? lang(lng_polls_votes_none)
|
? tr::lng_polls_votes_none(tr::now)
|
||||||
: lng_polls_votes_count(lt_count_short, _totalVotes);
|
: tr::lng_polls_votes_count(tr::now, lt_count_short, _totalVotes);
|
||||||
_totalVotesLabel.setText(st::msgDateTextStyle, string);
|
_totalVotesLabel.setText(st::msgDateTextStyle, string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -811,7 +811,7 @@ TextState HistoryPoll::textState(QPoint point, StateRequest request) const {
|
||||||
if (request.flags & Flag::LookupCustomTooltip) {
|
if (request.flags & Flag::LookupCustomTooltip) {
|
||||||
result.customTooltipText = answer.votes
|
result.customTooltipText = answer.votes
|
||||||
? lng_polls_votes_count(lt_count_decimal, answer.votes)
|
? lng_polls_votes_count(lt_count_decimal, answer.votes)
|
||||||
: lang(lng_polls_votes_none);
|
: tr::lng_polls_votes_none(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -726,7 +726,7 @@ int HistoryWebPage::bottomInfoPadding() const {
|
||||||
|
|
||||||
QString HistoryWebPage::displayedSiteName() const {
|
QString HistoryWebPage::displayedSiteName() const {
|
||||||
return (_data->document && _data->document->isWallPaper())
|
return (_data->document && _data->document->isWallPaper())
|
||||||
? lang(lng_media_chat_background)
|
? tr::lng_media_chat_background(tr::now)
|
||||||
: _data->siteName;
|
: _data->siteName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,15 +66,15 @@ ContactStatus::Bar::Bar(QWidget *parent, const QString &name)
|
||||||
st::historyContactStatusButton)
|
st::historyContactStatusButton)
|
||||||
, _block(
|
, _block(
|
||||||
this,
|
this,
|
||||||
lang(lng_new_contact_block).toUpper(),
|
tr::lng_new_contact_block(tr::now).toUpper(),
|
||||||
st::historyContactStatusBlock)
|
st::historyContactStatusBlock)
|
||||||
, _share(
|
, _share(
|
||||||
this,
|
this,
|
||||||
lang(lng_new_contact_share).toUpper(),
|
tr::lng_new_contact_share(tr::now).toUpper(),
|
||||||
st::historyContactStatusButton)
|
st::historyContactStatusButton)
|
||||||
, _report(
|
, _report(
|
||||||
this,
|
this,
|
||||||
lang(lng_report_spam_and_leave).toUpper(),
|
tr::lng_report_spam_and_leave(tr::now).toUpper(),
|
||||||
st::historyContactStatusBlock)
|
st::historyContactStatusBlock)
|
||||||
, _close(this, st::historyReplyCancel) {
|
, _close(this, st::historyReplyCancel) {
|
||||||
resize(_close->size());
|
resize(_close->size());
|
||||||
|
@ -87,7 +87,7 @@ void ContactStatus::Bar::showState(State state) {
|
||||||
_report->setVisible(state == State::ReportSpam);
|
_report->setVisible(state == State::ReportSpam);
|
||||||
_add->setText((state == State::Add)
|
_add->setText((state == State::Add)
|
||||||
? lng_new_contact_add_name(lt_user, _name).toUpper()
|
? lng_new_contact_add_name(lt_user, _name).toUpper()
|
||||||
: lang(lng_new_contact_add).toUpper());
|
: tr::lng_new_contact_add(tr::now).toUpper());
|
||||||
updateButtonsGeometry();
|
updateButtonsGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ void ContactStatus::setupReportHandler(not_null<PeerData*> peer) {
|
||||||
peer->session().api().deleteConversation(peer, false);
|
peer->session().api().deleteConversation(peer, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
Ui::Toast::Show(lang(lng_report_spam_done));
|
Ui::Toast::Show(tr::lng_report_spam_done(tr::now));
|
||||||
|
|
||||||
// Destroys _bar.
|
// Destroys _bar.
|
||||||
_window->sessionController()->showBackFromStack();
|
_window->sessionController()->showBackFromStack();
|
||||||
|
@ -352,12 +352,12 @@ void ContactStatus::setupReportHandler(not_null<PeerData*> peer) {
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
peer->session().api().blockUser(user);
|
peer->session().api().blockUser(user);
|
||||||
}
|
}
|
||||||
const auto text = lang((peer->isChat() || peer->isMegagroup())
|
const auto text = ((peer->isChat() || peer->isMegagroup())
|
||||||
? lng_report_spam_sure_group
|
? tr::lng_report_spam_sure_group
|
||||||
: lng_report_spam_sure_channel);
|
: tr::lng_report_spam_sure_channel)(tr::now);
|
||||||
_window->show(Box<ConfirmBox>(
|
_window->show(Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
lang(lng_report_spam_ok),
|
tr::lng_report_spam_ok(tr::now),
|
||||||
st::attentionBoxButton,
|
st::attentionBoxButton,
|
||||||
callback));
|
callback));
|
||||||
}, _bar.lifetime());
|
}, _bar.lifetime());
|
||||||
|
|
|
@ -48,7 +48,7 @@ constexpr auto kExportLocalTimeout = crl::time(1000);
|
||||||
// if (const auto channel = peer->asChannel()) {
|
// if (const auto channel = peer->asChannel()) {
|
||||||
// const auto grouped = (channel->feed() != nullptr);
|
// const auto grouped = (channel->feed() != nullptr);
|
||||||
// menu->addAction( // #feed
|
// menu->addAction( // #feed
|
||||||
// lang(grouped ? lng_feed_ungroup : lng_feed_group),
|
// grouped ? tr::lng_feed_ungroup(tr::now) : tr::lng_feed_group(tr::now),
|
||||||
// [=] { Window::ToggleChannelGrouping(channel, !grouped); });
|
// [=] { Window::ToggleChannelGrouping(channel, !grouped); });
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
@ -60,7 +60,7 @@ void SavePhotoToFile(not_null<PhotoData*> photo) {
|
||||||
|
|
||||||
FileDialog::GetWritePath(
|
FileDialog::GetWritePath(
|
||||||
Core::App().getFileDialogParent(),
|
Core::App().getFileDialogParent(),
|
||||||
lang(lng_save_photo),
|
tr::lng_save_photo(tr::now),
|
||||||
qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter(),
|
qsl("JPEG Image (*.jpg);;") + FileDialog::AllFilesFilter(),
|
||||||
filedialogDefaultName(qsl("photo"), qsl(".jpg")),
|
filedialogDefaultName(qsl("photo"), qsl(".jpg")),
|
||||||
crl::guard(&Auth(), [=](const QString &result) {
|
crl::guard(&Auth(), [=](const QString &result) {
|
||||||
|
@ -95,12 +95,12 @@ void AddPhotoActions(
|
||||||
not_null<Ui::PopupMenu*> menu,
|
not_null<Ui::PopupMenu*> menu,
|
||||||
not_null<PhotoData*> photo) {
|
not_null<PhotoData*> photo) {
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(lng_context_save_image),
|
tr::lng_context_save_image(tr::now),
|
||||||
App::LambdaDelayed(
|
App::LambdaDelayed(
|
||||||
st::defaultDropdownMenu.menu.ripple.hideDuration,
|
st::defaultDropdownMenu.menu.ripple.hideDuration,
|
||||||
&Auth(),
|
&Auth(),
|
||||||
[=] { SavePhotoToFile(photo); }));
|
[=] { SavePhotoToFile(photo); }));
|
||||||
menu->addAction(lang(lng_context_copy_image), [=] {
|
menu->addAction(tr::lng_context_copy_image(tr::now), [=] {
|
||||||
CopyImage(photo);
|
CopyImage(photo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -133,16 +133,17 @@ void AddSaveDocumentAction(
|
||||||
document,
|
document,
|
||||||
DocumentSaveClickHandler::Mode::ToNewFile);
|
DocumentSaveClickHandler::Mode::ToNewFile);
|
||||||
};
|
};
|
||||||
|
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(document->isVideoFile()
|
(document->isVideoFile()
|
||||||
? lng_context_save_video
|
? tr::lng_context_save_video(tr::now)
|
||||||
: (document->isVoiceMessage()
|
: (document->isVoiceMessage()
|
||||||
? lng_context_save_audio
|
? tr::lng_context_save_audio(tr::now)
|
||||||
: (document->isAudioFile()
|
: (document->isAudioFile()
|
||||||
? lng_context_save_audio_file
|
? tr::lng_context_save_audio_file(tr::now)
|
||||||
: (document->sticker()
|
: (document->sticker()
|
||||||
? lng_context_save_image
|
? tr::lng_context_save_image(tr::now)
|
||||||
: lng_context_save_file)))),
|
: tr::lng_context_save_file(tr::now))))),
|
||||||
App::LambdaDelayed(
|
App::LambdaDelayed(
|
||||||
st::defaultDropdownMenu.menu.ripple.hideDuration,
|
st::defaultDropdownMenu.menu.ripple.hideDuration,
|
||||||
&Auth(),
|
&Auth(),
|
||||||
|
@ -154,14 +155,14 @@ void AddDocumentActions(
|
||||||
not_null<DocumentData*> document,
|
not_null<DocumentData*> document,
|
||||||
FullMsgId contextId) {
|
FullMsgId contextId) {
|
||||||
if (document->loading()) {
|
if (document->loading()) {
|
||||||
menu->addAction(lang(lng_context_cancel_download), [=] {
|
menu->addAction(tr::lng_context_cancel_download(tr::now), [=] {
|
||||||
document->cancel();
|
document->cancel();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (document->loaded() && document->isGifv()) {
|
if (document->loaded() && document->isGifv()) {
|
||||||
if (!cAutoPlayGif()) {
|
if (!cAutoPlayGif()) {
|
||||||
menu->addAction(lang(lng_context_open_gif), [=] {
|
menu->addAction(tr::lng_context_open_gif(tr::now), [=] {
|
||||||
OpenGif(contextId);
|
OpenGif(contextId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -169,22 +170,22 @@ void AddDocumentActions(
|
||||||
if (document->sticker()
|
if (document->sticker()
|
||||||
&& document->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
|
&& document->sticker()->set.type() != mtpc_inputStickerSetEmpty) {
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(document->isStickerSetInstalled()
|
(document->isStickerSetInstalled()
|
||||||
? lng_context_pack_info
|
? tr::lng_context_pack_info(tr::now)
|
||||||
: lng_context_pack_add),
|
: tr::lng_context_pack_add(tr::now)),
|
||||||
[=] { ShowStickerPackInfo(document); });
|
[=] { ShowStickerPackInfo(document); });
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(Stickers::IsFaved(document)
|
(Stickers::IsFaved(document)
|
||||||
? lng_faved_stickers_remove
|
? tr::lng_faved_stickers_remove(tr::now)
|
||||||
: lng_faved_stickers_add),
|
: tr::lng_faved_stickers_add(tr::now)),
|
||||||
[=] { ToggleFavedSticker(document, contextId); });
|
[=] { ToggleFavedSticker(document, contextId); });
|
||||||
}
|
}
|
||||||
if (!document->filepath(
|
if (!document->filepath(
|
||||||
DocumentData::FilePathResolve::Checked).isEmpty()) {
|
DocumentData::FilePathResolve::Checked).isEmpty()) {
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(Platform::IsMac()
|
(Platform::IsMac()
|
||||||
? lng_context_show_in_finder
|
? tr::lng_context_show_in_finder(tr::now)
|
||||||
: lng_context_show_in_folder),
|
: tr::lng_context_show_in_folder(tr::now)),
|
||||||
[=] { ShowInFolder(document); });
|
[=] { ShowInFolder(document); });
|
||||||
}
|
}
|
||||||
AddSaveDocumentAction(menu, contextId, document);
|
AddSaveDocumentAction(menu, contextId, document);
|
||||||
|
@ -204,9 +205,9 @@ void AddPostLinkAction(
|
||||||
}
|
}
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
menu->addAction(
|
menu->addAction(
|
||||||
lang(item->history()->peer->isMegagroup()
|
(item->history()->peer->isMegagroup()
|
||||||
? lng_context_copy_link
|
? tr::lng_context_copy_link
|
||||||
: lng_context_copy_post_link),
|
: tr::lng_context_copy_post_link)(tr::now),
|
||||||
[=] { CopyPostLink(itemId); });
|
[=] { CopyPostLink(itemId); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +232,7 @@ bool AddForwardSelectedAction(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->addAction(lang(lng_context_forward_selected), [=] {
|
menu->addAction(tr::lng_context_forward_selected(tr::now), [=] {
|
||||||
const auto weak = make_weak(list);
|
const auto weak = make_weak(list);
|
||||||
auto items = ExtractIdsList(request.selectedItems);
|
auto items = ExtractIdsList(request.selectedItems);
|
||||||
Window::ShowForwardMessagesBox(std::move(items), [=] {
|
Window::ShowForwardMessagesBox(std::move(items), [=] {
|
||||||
|
@ -264,7 +265,7 @@ bool AddForwardMessageAction(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
menu->addAction(lang(lng_context_forward_msg), [=] {
|
menu->addAction(tr::lng_context_forward_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
Window::ShowForwardMessagesBox(asGroup
|
Window::ShowForwardMessagesBox(asGroup
|
||||||
? Auth().data().itemOrItsGroup(item)
|
? Auth().data().itemOrItsGroup(item)
|
||||||
|
@ -295,7 +296,7 @@ bool AddDeleteSelectedAction(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
menu->addAction(lang(lng_context_delete_selected), [=] {
|
menu->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
||||||
const auto weak = make_weak(list);
|
const auto weak = make_weak(list);
|
||||||
auto items = ExtractIdsList(request.selectedItems);
|
auto items = ExtractIdsList(request.selectedItems);
|
||||||
const auto box = Ui::show(Box<DeleteMessagesBox>(std::move(items)));
|
const auto box = Ui::show(Box<DeleteMessagesBox>(std::move(items)));
|
||||||
|
@ -329,7 +330,7 @@ bool AddDeleteMessageAction(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
menu->addAction(lang(lng_context_delete_msg), [=] {
|
menu->addAction(tr::lng_context_delete_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (asGroup) {
|
if (asGroup) {
|
||||||
if (const auto group = Auth().data().groups().find(item)) {
|
if (const auto group = Auth().data().groups().find(item)) {
|
||||||
|
@ -367,7 +368,7 @@ bool AddClearSelectionAction(
|
||||||
if (!request.overSelection || request.selectedItems.empty()) {
|
if (!request.overSelection || request.selectedItems.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
menu->addAction(lang(lng_context_clear_selection), [=] {
|
menu->addAction(tr::lng_context_clear_selection(tr::now), [=] {
|
||||||
list->cancelSelection();
|
list->cancelSelection();
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
@ -385,7 +386,7 @@ bool AddSelectMessageAction(
|
||||||
}
|
}
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
const auto asGroup = (request.pointState != PointState::GroupPart);
|
const auto asGroup = (request.pointState != PointState::GroupPart);
|
||||||
menu->addAction(lang(lng_context_select_msg), [=] {
|
menu->addAction(tr::lng_context_select_msg(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (asGroup) {
|
if (asGroup) {
|
||||||
list->selectItemAsGroup(item);
|
list->selectItemAsGroup(item);
|
||||||
|
@ -458,9 +459,9 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
||||||
|| !request.selectedText.empty();
|
|| !request.selectedText.empty();
|
||||||
|
|
||||||
if (request.overSelection) {
|
if (request.overSelection) {
|
||||||
const auto text = lang(request.selectedItems.empty()
|
const auto text = request.selectedItems.empty()
|
||||||
? lng_context_copy_selected
|
? tr::lng_context_copy_selected(tr::now)
|
||||||
: lng_context_copy_selected_items);
|
: tr::lng_context_copy_selected_items(tr::now);
|
||||||
result->addAction(text, [=] {
|
result->addAction(text, [=] {
|
||||||
SetClipboardText(list->getSelectedText());
|
SetClipboardText(list->getSelectedText());
|
||||||
});
|
});
|
||||||
|
@ -490,7 +491,7 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
||||||
}
|
}
|
||||||
if (!link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
if (!link && (view->hasVisibleText() || mediaHasTextForCopy)) {
|
||||||
const auto asGroup = (request.pointState != PointState::GroupPart);
|
const auto asGroup = (request.pointState != PointState::GroupPart);
|
||||||
result->addAction(lang(lng_context_copy_text), [=] {
|
result->addAction(tr::lng_context_copy_text(tr::now), [=] {
|
||||||
if (const auto item = Auth().data().message(itemId)) {
|
if (const auto item = Auth().data().message(itemId)) {
|
||||||
if (asGroup) {
|
if (asGroup) {
|
||||||
if (const auto group = Auth().data().groups().find(item)) {
|
if (const auto group = Auth().data().groups().find(item)) {
|
||||||
|
@ -520,9 +521,9 @@ void CopyPostLink(FullMsgId itemId) {
|
||||||
const auto channel = item->history()->peer->asChannel();
|
const auto channel = item->history()->peer->asChannel();
|
||||||
Assert(channel != nullptr);
|
Assert(channel != nullptr);
|
||||||
|
|
||||||
Ui::Toast::Show(lang(channel->isPublic()
|
Ui::Toast::Show(channel->isPublic()
|
||||||
? lng_channel_public_link_copied
|
? tr::lng_channel_public_link_copied(tr::now)
|
||||||
: lng_context_about_private_link));
|
: tr::lng_context_about_private_link(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
void StopPoll(FullMsgId itemId) {
|
void StopPoll(FullMsgId itemId) {
|
||||||
|
@ -533,9 +534,9 @@ void StopPoll(FullMsgId itemId) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lang(lng_polls_stop_warning),
|
tr::lng_polls_stop_warning(tr::now),
|
||||||
lang(lng_polls_stop_sure),
|
tr::lng_polls_stop_sure(tr::now),
|
||||||
lang(lng_cancel),
|
tr::lng_cancel(tr::now),
|
||||||
stop));
|
stop));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ void UnreadBar::init(int newCount) {
|
||||||
}
|
}
|
||||||
count = newCount;
|
count = newCount;
|
||||||
text = /*(count == kCountUnknown) // #feed
|
text = /*(count == kCountUnknown) // #feed
|
||||||
? lang(lng_unread_bar_some)
|
? tr::lng_unread_bar_some(tr::now)
|
||||||
: */lng_unread_bar(lt_count, count);
|
: */lng_unread_bar(lt_count, count);
|
||||||
width = st::semiboldFont->width(text);
|
width = st::semiboldFont->width(text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2248,7 +2248,7 @@ void ListWidget::mouseActionUpdate() {
|
||||||
|
|
||||||
ClickHandlerPtr ListWidget::hiddenUserpicLink(FullMsgId id) {
|
ClickHandlerPtr ListWidget::hiddenUserpicLink(FullMsgId id) {
|
||||||
static const auto result = std::make_shared<LambdaClickHandler>([] {
|
static const auto result = std::make_shared<LambdaClickHandler>([] {
|
||||||
Ui::Toast::Show(lang(lng_forwarded_hidden));
|
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,13 +124,13 @@ int KeyboardStyle::minButtonWidth(
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MessageBadgeText(not_null<const HistoryMessage*> message) {
|
QString MessageBadgeText(not_null<const HistoryMessage*> message) {
|
||||||
return lang(message->hasAdminBadge()
|
return message->hasAdminBadge()
|
||||||
? lng_admin_badge
|
? tr::lng_admin_badge(tr::now)
|
||||||
: lng_channel_badge);
|
: tr::lng_channel_badge(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FastReplyText() {
|
QString FastReplyText() {
|
||||||
return lang(lng_fast_reply);
|
return tr::lng_fast_reply(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintBubble(Painter &p, QRect rect, int outerWidth, bool selected, bool outbg, RectPart tailSide) {
|
void PaintBubble(Painter &p, QRect rect, int outerWidth, bool selected, bool outbg, RectPart tailSide) {
|
||||||
|
@ -899,7 +899,7 @@ bool Message::getStateFromName(
|
||||||
&& point.x() < availableLeft + availableWidth
|
&& point.x() < availableLeft + availableWidth
|
||||||
&& point.x() < availableLeft + nameText->maxWidth()) {
|
&& point.x() < availableLeft + nameText->maxWidth()) {
|
||||||
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
static const auto hidden = std::make_shared<LambdaClickHandler>([] {
|
||||||
Ui::Toast::Show(lang(lng_forwarded_hidden));
|
Ui::Toast::Show(tr::lng_forwarded_hidden(tr::now));
|
||||||
});
|
});
|
||||||
outResult->link = from ? from->openLink() : hidden;
|
outResult->link = from ? from->openLink() : hidden;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -548,10 +548,10 @@ EmptyPainter::EmptyPainter(not_null<History*> history) : _history(history) {
|
||||||
|
|
||||||
void EmptyPainter::fillAboutGroup() {
|
void EmptyPainter::fillAboutGroup() {
|
||||||
const auto phrases = {
|
const auto phrases = {
|
||||||
lang(lng_group_about1),
|
tr::lng_group_about1(tr::now),
|
||||||
lang(lng_group_about2),
|
tr::lng_group_about2(tr::now),
|
||||||
lang(lng_group_about3),
|
tr::lng_group_about3(tr::now),
|
||||||
lang(lng_group_about4),
|
tr::lng_group_about4(tr::now),
|
||||||
};
|
};
|
||||||
const auto setText = [](Ui::Text::String &text, const QString &content) {
|
const auto setText = [](Ui::Text::String &text, const QString &content) {
|
||||||
text.setText(
|
text.setText(
|
||||||
|
@ -559,8 +559,8 @@ void EmptyPainter::fillAboutGroup() {
|
||||||
content,
|
content,
|
||||||
Ui::NameTextOptions());
|
Ui::NameTextOptions());
|
||||||
};
|
};
|
||||||
setText(_header, lang(lng_group_about_header));
|
setText(_header, tr::lng_group_about_header(tr::now));
|
||||||
setText(_text, lang(lng_group_about_text));
|
setText(_text, tr::lng_group_about_text(tr::now));
|
||||||
for (const auto &text : phrases) {
|
for (const auto &text : phrases) {
|
||||||
_phrases.emplace_back(st::msgMinWidth);
|
_phrases.emplace_back(st::msgMinWidth);
|
||||||
setText(_phrases.back(), text);
|
setText(_phrases.back(), text);
|
||||||
|
|
|
@ -322,7 +322,7 @@ void TopBarWidget::paintTopBar(Painter &p) {
|
||||||
width(),
|
width(),
|
||||||
text);
|
text);
|
||||||
} else if (_activeChat.peer()->isSelf()) {
|
} else if (_activeChat.peer()->isSelf()) {
|
||||||
auto text = lang(lng_saved_messages);
|
auto text = tr::lng_saved_messages(tr::now);
|
||||||
auto textWidth = st::historySavedFont->width(text);
|
auto textWidth = st::historySavedFont->width(text);
|
||||||
if (namewidth < textWidth) {
|
if (namewidth < textWidth) {
|
||||||
text = st::historySavedFont->elided(text, namewidth);
|
text = st::historySavedFont->elided(text, namewidth);
|
||||||
|
@ -373,7 +373,7 @@ bool TopBarWidget::paintConnectingState(
|
||||||
+ st::topBarConnectingAnimation.size.width()
|
+ st::topBarConnectingAnimation.size.width()
|
||||||
+ st::topBarConnectingSkip;
|
+ st::topBarConnectingSkip;
|
||||||
p.setPen(st::historyStatusFg);
|
p.setPen(st::historyStatusFg);
|
||||||
p.drawTextLeft(left, top, outerWidth, lang(lng_status_connecting));
|
p.drawTextLeft(left, top, outerWidth, tr::lng_status_connecting(tr::now));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,12 +764,12 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
}
|
}
|
||||||
} else if (const auto chat = _activeChat.peer()->asChat()) {
|
} else if (const auto chat = _activeChat.peer()->asChat()) {
|
||||||
if (!chat->amIn()) {
|
if (!chat->amIn()) {
|
||||||
text = lang(lng_chat_status_unaccessible);
|
text = tr::lng_chat_status_unaccessible(tr::now);
|
||||||
} else if (chat->participants.empty()) {
|
} else if (chat->participants.empty()) {
|
||||||
if (!_titlePeerText.isEmpty()) {
|
if (!_titlePeerText.isEmpty()) {
|
||||||
text = _titlePeerText.toString();
|
text = _titlePeerText.toString();
|
||||||
} else if (chat->count <= 0) {
|
} else if (chat->count <= 0) {
|
||||||
text = lang(lng_group_status);
|
text = tr::lng_group_status(tr::now);
|
||||||
} else {
|
} else {
|
||||||
text = lng_chat_status_members(lt_count_decimal, chat->count);
|
text = lng_chat_status_members(lt_count_decimal, chat->count);
|
||||||
}
|
}
|
||||||
|
@ -790,7 +790,7 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
} else if (chat->participants.size() > 0) {
|
} else if (chat->participants.size() > 0) {
|
||||||
text = lng_chat_status_members(lt_count_decimal, chat->participants.size());
|
text = lng_chat_status_members(lt_count_decimal, chat->participants.size());
|
||||||
} else {
|
} else {
|
||||||
text = lang(lng_group_status);
|
text = tr::lng_group_status(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (const auto channel = _activeChat.peer()->asChannel()) {
|
} else if (const auto channel = _activeChat.peer()->asChannel()) {
|
||||||
|
@ -816,12 +816,13 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
} else if (channel->membersCount() > 0) {
|
} else if (channel->membersCount() > 0) {
|
||||||
text = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
text = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
||||||
} else {
|
} else {
|
||||||
text = lang(lng_group_status);
|
text = tr::lng_group_status(tr::now);
|
||||||
}
|
}
|
||||||
} else if (channel->membersCount() > 0) {
|
} else if (channel->membersCount() > 0) {
|
||||||
text = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
text = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
text = lang(channel->isMegagroup() ? lng_group_status : lng_channel_status);
|
text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_titlePeerText.toString() != text) {
|
if (_titlePeerText.toString() != text) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ std::unique_ptr<PeerListRow> ListController::createRow(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListController::prepare() {
|
void ListController::prepare() {
|
||||||
setSearchNoResultsText(lang(lng_bot_groups_not_found));
|
setSearchNoResultsText(tr::lng_bot_groups_not_found(tr::now));
|
||||||
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
||||||
delegate()->peerListSetTitle(tr::lng_profile_common_groups_section());
|
delegate()->peerListSetTitle(tr::lng_profile_common_groups_section());
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,8 +227,8 @@ Dialogs::RowDescriptor WrapWidget::activeChat() const {
|
||||||
//void WrapWidget::createTabs() {
|
//void WrapWidget::createTabs() {
|
||||||
// _topTabs.create(this, st::infoTabs);
|
// _topTabs.create(this, st::infoTabs);
|
||||||
// auto sections = QStringList();
|
// auto sections = QStringList();
|
||||||
// sections.push_back(lang(lng_profile_info_section).toUpper());
|
// sections.push_back(tr::lng_profile_info_section(tr::now).toUpper());
|
||||||
// sections.push_back(lang(lng_info_tab_media).toUpper());
|
// sections.push_back(tr::lng_info_tab_media(tr::now).toUpper());
|
||||||
// _topTabs->setSections(sections);
|
// _topTabs->setSections(sections);
|
||||||
// _topTabs->setActiveSection(static_cast<int>(_tab));
|
// _topTabs->setActiveSection(static_cast<int>(_tab));
|
||||||
// _topTabs->finishAnimating();
|
// _topTabs->finishAnimating();
|
||||||
|
@ -424,8 +424,8 @@ void WrapWidget::checkBeforeClose(Fn<void()> close) {
|
||||||
};
|
};
|
||||||
if (_controller->canSaveChangesNow()) {
|
if (_controller->canSaveChangesNow()) {
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lang(lng_settings_close_sure),
|
tr::lng_settings_close_sure(tr::now),
|
||||||
lang(lng_close),
|
tr::lng_close(tr::now),
|
||||||
confirmed));
|
confirmed));
|
||||||
} else {
|
} else {
|
||||||
confirmed();
|
confirmed();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue