mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove all legacy global namespace langs.
This commit is contained in:
parent
edcd09c29f
commit
4917ca7b32
96 changed files with 638 additions and 407 deletions
|
@ -551,7 +551,8 @@ void ApiWrap::sendMessageFail(const RPCError &error) {
|
||||||
const auto link = textcmdLink(
|
const auto link = textcmdLink(
|
||||||
Core::App().createInternalLinkFull(qsl("spambot")),
|
Core::App().createInternalLinkFull(qsl("spambot")),
|
||||||
tr::lng_cant_more_info(tr::now));
|
tr::lng_cant_more_info(tr::now));
|
||||||
Ui::show(Box<InformBox>(lng_error_public_groups_denied(
|
Ui::show(Box<InformBox>(tr::lng_error_public_groups_denied(
|
||||||
|
tr::now,
|
||||||
lt_more_info,
|
lt_more_info,
|
||||||
link)));
|
link)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ rpl::producer<TextWithEntities> Text3() {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AboutBox::AboutBox(QWidget *parent)
|
AboutBox::AboutBox(QWidget *parent)
|
||||||
: _version(this, lng_about_version(lt_version, currentVersionText()), st::aboutVersionLink)
|
: _version(this, tr::lng_about_version(tr::now, lt_version, currentVersionText()), st::aboutVersionLink)
|
||||||
, _text1(this, Text1(), st::aboutLabel)
|
, _text1(this, Text1(), st::aboutLabel)
|
||||||
, _text2(this, Text2(), st::aboutLabel)
|
, _text2(this, Text2(), st::aboutLabel)
|
||||||
, _text3(this, Text3(), st::aboutLabel) {
|
, _text3(this, Text3(), st::aboutLabel) {
|
||||||
|
|
|
@ -69,9 +69,9 @@ QString PeerFloodErrorText(PeerFloodType type) {
|
||||||
Core::App().createInternalLinkFull(qsl("spambot")),
|
Core::App().createInternalLinkFull(qsl("spambot")),
|
||||||
tr::lng_cant_more_info(tr::now));
|
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 tr::lng_cant_invite_not_contact(tr::now, lt_more_info, link);
|
||||||
}
|
}
|
||||||
return lng_cant_send_to_not_contact(lt_more_info, link);
|
return tr::lng_cant_send_to_not_contact(tr::now, lt_more_info, link);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowAddParticipantsError(
|
void ShowAddParticipantsError(
|
||||||
|
@ -245,7 +245,7 @@ void AddContactBox::paintEvent(QPaintEvent *e) {
|
||||||
p.setPen(st::boxTextFg);
|
p.setPen(st::boxTextFg);
|
||||||
p.setFont(st::boxTextFont);
|
p.setFont(st::boxTextFont);
|
||||||
auto textHeight = height() - st::contactPadding.top() - st::contactPadding.bottom() - st::boxPadding.bottom();
|
auto textHeight = height() - st::contactPadding.top() - st::contactPadding.bottom() - st::boxPadding.bottom();
|
||||||
p.drawText(QRect(st::boxPadding.left(), st::contactPadding.top(), width() - st::boxPadding.left() - st::boxPadding.right(), textHeight), lng_contact_not_joined(lt_name, _sentName), style::al_topleft);
|
p.drawText(QRect(st::boxPadding.left(), st::contactPadding.top(), width() - st::boxPadding.left() - st::boxPadding.right(), textHeight), tr::lng_contact_not_joined(tr::now, lt_name, _sentName), style::al_topleft);
|
||||||
} else {
|
} else {
|
||||||
st::contactUserIcon.paint(
|
st::contactUserIcon.paint(
|
||||||
p,
|
p,
|
||||||
|
@ -1348,8 +1348,15 @@ void RevokePublicLinkBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
auto pressed = base::take(_pressed);
|
auto pressed = base::take(_pressed);
|
||||||
setCursor((_selected || _pressed) ? style::cur_pointer : style::cur_default);
|
setCursor((_selected || _pressed) ? style::cur_pointer : style::cur_default);
|
||||||
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()
|
||||||
auto text = text_method(lt_link, Core::App().createInternalLink(pressed->userName()), lt_group, pressed->name);
|
? tr::lng_channels_too_much_public_revoke_confirm_group
|
||||||
|
: tr::lng_channels_too_much_public_revoke_confirm_channel;
|
||||||
|
auto text = text_method(
|
||||||
|
tr::now,
|
||||||
|
lt_link,
|
||||||
|
Core::App().createInternalLink(pressed->userName()),
|
||||||
|
lt_group,
|
||||||
|
pressed->name);
|
||||||
auto confirmText = tr::lng_channels_too_much_public_revoke(tr::now);
|
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;
|
||||||
|
|
|
@ -102,7 +102,8 @@ void AutoDownloadBox::setupContent() {
|
||||||
limits->events_starting_with_copy(
|
limits->events_starting_with_copy(
|
||||||
initialLimit
|
initialLimit
|
||||||
) | rpl::map([](int value) {
|
) | rpl::map([](int value) {
|
||||||
return lng_media_size_up_to(
|
return tr::lng_media_size_up_to(
|
||||||
|
tr::now,
|
||||||
lt_size,
|
lt_size,
|
||||||
QString::number(value / kMegabyte) + " MB");
|
QString::number(value / kMegabyte) + " MB");
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -25,7 +25,7 @@ void AutoLockBox::prepare() {
|
||||||
auto count = int(options.size());
|
auto count = int(options.size());
|
||||||
_options.reserve(count);
|
_options.reserve(count);
|
||||||
for (auto seconds : options) {
|
for (auto seconds : options) {
|
||||||
_options.emplace_back(this, group, seconds, (seconds % 3600) ? lng_passcode_autolock_minutes(lt_count, seconds / 60) : lng_passcode_autolock_hours(lt_count, seconds / 3600), st::autolockButton);
|
_options.emplace_back(this, group, seconds, (seconds % 3600) ? tr::lng_passcode_autolock_minutes(tr::now, lt_count, seconds / 60) : tr::lng_passcode_autolock_hours(tr::now, lt_count, seconds / 3600), st::autolockButton);
|
||||||
_options.back()->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), y);
|
_options.back()->moveToLeft(st::boxPadding.left() + st::boxOptionListPadding.left(), y);
|
||||||
y += _options.back()->heightNoMargins() + st::boxOptionListSkip;
|
y += _options.back()->heightNoMargins() + st::boxOptionListSkip;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,8 @@ bool ChangePhoneBox::EnterPhone::sendPhoneFail(const QString &phoneNumber, const
|
||||||
return true;
|
return true;
|
||||||
} else if (error.type() == qstr("PHONE_NUMBER_OCCUPIED")) {
|
} else if (error.type() == qstr("PHONE_NUMBER_OCCUPIED")) {
|
||||||
Ui::show(Box<InformBox>(
|
Ui::show(Box<InformBox>(
|
||||||
lng_change_phone_occupied(
|
tr::lng_change_phone_occupied(
|
||||||
|
tr::now,
|
||||||
lt_phone,
|
lt_phone,
|
||||||
App::formatPhone(phoneNumber)),
|
App::formatPhone(phoneNumber)),
|
||||||
tr::lng_box_ok(tr::now)));
|
tr::lng_box_ok(tr::now)));
|
||||||
|
|
|
@ -315,7 +315,7 @@ InformBox::InformBox(QWidget*, const TextWithEntities &text, const QString &done
|
||||||
|
|
||||||
MaxInviteBox::MaxInviteBox(QWidget*, not_null<ChannelData*> channel) : BoxContent()
|
MaxInviteBox::MaxInviteBox(QWidget*, not_null<ChannelData*> channel) : BoxContent()
|
||||||
, _channel(channel)
|
, _channel(channel)
|
||||||
, _text(st::boxLabelStyle, lng_participant_invite_sorry(lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) {
|
, _text(st::boxLabelStyle, tr::lng_participant_invite_sorry(tr::now, lt_count, Global::ChatSizeMax()), _confirmBoxTextOptions, st::boxWidth - st::boxPadding.left() - st::boxButtonPadding.right()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaxInviteBox::prepare() {
|
void MaxInviteBox::prepare() {
|
||||||
|
@ -496,8 +496,8 @@ void DeleteMessagesBox::prepare() {
|
||||||
details.text = peer->isSelf()
|
details.text = peer->isSelf()
|
||||||
? tr::lng_sure_delete_saved_messages(tr::now)
|
? 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)
|
||||||
: lng_sure_delete_group_history(lt_group, peer->name);
|
: tr::lng_sure_delete_group_history(tr::now, lt_group, peer->name);
|
||||||
deleteStyle = &st::attentionBoxButton;
|
deleteStyle = &st::attentionBoxButton;
|
||||||
} else {
|
} else {
|
||||||
details.text = peer->isSelf()
|
details.text = peer->isSelf()
|
||||||
|
@ -534,7 +534,7 @@ void DeleteMessagesBox::prepare() {
|
||||||
} else {
|
} else {
|
||||||
details.text = (_ids.size() == 1)
|
details.text = (_ids.size() == 1)
|
||||||
? tr::lng_selected_delete_sure_this(tr::now)
|
? tr::lng_selected_delete_sure_this(tr::now)
|
||||||
: lng_selected_delete_sure(lt_count, _ids.size());
|
: tr::lng_selected_delete_sure(tr::now, lt_count, _ids.size());
|
||||||
if (const auto peer = checkFromSinglePeer()) {
|
if (const auto peer = checkFromSinglePeer()) {
|
||||||
auto count = int(_ids.size());
|
auto count = int(_ids.size());
|
||||||
if (auto revoke = revokeText(peer)) {
|
if (auto revoke = revokeText(peer)) {
|
||||||
|
@ -542,12 +542,12 @@ void DeleteMessagesBox::prepare() {
|
||||||
appendDetails(std::move(revoke->description));
|
appendDetails(std::move(revoke->description));
|
||||||
} else if (peer && peer->isChannel()) {
|
} else if (peer && peer->isChannel()) {
|
||||||
if (peer->isMegagroup()) {
|
if (peer->isMegagroup()) {
|
||||||
appendDetails({ lng_delete_for_everyone_hint(lt_count, count) });
|
appendDetails({ tr::lng_delete_for_everyone_hint(tr::now, lt_count, count) });
|
||||||
}
|
}
|
||||||
} else if (peer->isChat()) {
|
} else if (peer->isChat()) {
|
||||||
appendDetails({ lng_delete_for_me_chat_hint(lt_count, count) });
|
appendDetails({ tr::lng_delete_for_me_chat_hint(tr::now, lt_count, count) });
|
||||||
} else if (!peer->isSelf()) {
|
} else if (!peer->isSelf()) {
|
||||||
appendDetails({ lng_delete_for_me_hint(lt_count, count) });
|
appendDetails({ tr::lng_delete_for_me_hint(tr::now, lt_count, count) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,8 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||||
if (!peer->canRevokeFullHistory()) {
|
if (!peer->canRevokeFullHistory()) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
} else if (const auto user = peer->asUser()) {
|
} else if (const auto user = peer->asUser()) {
|
||||||
result.checkbox = lng_delete_for_other_check(
|
result.checkbox = tr::lng_delete_for_other_check(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName);
|
user->firstName);
|
||||||
} else {
|
} else {
|
||||||
|
@ -637,7 +638,8 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||||
|
|
||||||
if (canRevokeAll) {
|
if (canRevokeAll) {
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
result.checkbox = lng_delete_for_other_check(
|
result.checkbox = tr::lng_delete_for_other_check(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName);
|
user->firstName);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -181,9 +181,9 @@ QString SentCodeCall::getText() const {
|
||||||
switch (_status.state) {
|
switch (_status.state) {
|
||||||
case State::Waiting: {
|
case State::Waiting: {
|
||||||
if (_status.timeout >= 3600) {
|
if (_status.timeout >= 3600) {
|
||||||
return lng_code_call(lt_minutes, qsl("%1:%2").arg(_status.timeout / 3600).arg((_status.timeout / 60) % 60, 2, 10, QChar('0')), lt_seconds, qsl("%1").arg(_status.timeout % 60, 2, 10, QChar('0')));
|
return tr::lng_code_call(tr::now, lt_minutes, qsl("%1:%2").arg(_status.timeout / 3600).arg((_status.timeout / 60) % 60, 2, 10, QChar('0')), 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')));
|
return tr::lng_code_call(tr::now, 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 tr::lng_code_calling(tr::now);
|
case State::Calling: return tr::lng_code_calling(tr::now);
|
||||||
case State::Called: return tr::lng_code_called(tr::now);
|
case State::Called: return tr::lng_code_called(tr::now);
|
||||||
|
@ -271,7 +271,7 @@ void ConfirmPhoneBox::prepare() {
|
||||||
_about.create(this, st::confirmPhoneAboutLabel);
|
_about.create(this, st::confirmPhoneAboutLabel);
|
||||||
TextWithEntities aboutText;
|
TextWithEntities aboutText;
|
||||||
auto formattedPhone = App::formatPhone(_phone);
|
auto formattedPhone = App::formatPhone(_phone);
|
||||||
aboutText.text = lng_confirm_phone_about(lt_phone, formattedPhone);
|
aboutText.text = tr::lng_confirm_phone_about(tr::now, lt_phone, formattedPhone);
|
||||||
auto phonePosition = aboutText.text.indexOf(formattedPhone);
|
auto phonePosition = aboutText.text.indexOf(formattedPhone);
|
||||||
if (phonePosition >= 0) {
|
if (phonePosition >= 0) {
|
||||||
aboutText.entities.push_back({ EntityType::Bold, phonePosition, formattedPhone.size() });
|
aboutText.entities.push_back({ EntityType::Bold, phonePosition, formattedPhone.size() });
|
||||||
|
@ -321,7 +321,7 @@ void ConfirmPhoneBox::sendCode() {
|
||||||
|
|
||||||
void ConfirmPhoneBox::confirmDone(const MTPBool &result) {
|
void ConfirmPhoneBox::confirmDone(const MTPBool &result) {
|
||||||
_sendCodeRequestId = 0;
|
_sendCodeRequestId = 0;
|
||||||
Ui::show(Box<InformBox>(lng_confirm_phone_success(lt_phone, App::formatPhone(_phone))));
|
Ui::show(Box<InformBox>(tr::lng_confirm_phone_success(tr::now, lt_phone, App::formatPhone(_phone))));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfirmPhoneBox::confirmFail(const RPCError &error) {
|
bool ConfirmPhoneBox::confirmFail(const RPCError &error) {
|
||||||
|
|
|
@ -304,7 +304,8 @@ void ProxyRow::paintEvent(QPaintEvent *e) {
|
||||||
const auto status = [&] {
|
const auto status = [&] {
|
||||||
switch (_view.state) {
|
switch (_view.state) {
|
||||||
case State::Available:
|
case State::Available:
|
||||||
return lng_proxy_available(
|
return tr::lng_proxy_available(
|
||||||
|
tr::now,
|
||||||
lt_ping,
|
lt_ping,
|
||||||
QString::number(_view.ping));
|
QString::number(_view.ping));
|
||||||
case State::Checking:
|
case State::Checking:
|
||||||
|
@ -952,7 +953,8 @@ void ProxiesBoxController::ShowApplyConfirmation(
|
||||||
}
|
}
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||||
const auto text = lng_sure_enable_socks(
|
const auto text = tr::lng_sure_enable_socks(
|
||||||
|
tr::now,
|
||||||
lt_server,
|
lt_server,
|
||||||
server,
|
server,
|
||||||
lt_port,
|
lt_port,
|
||||||
|
|
|
@ -654,7 +654,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
||||||
setCloseByOutsideClick(!count);
|
setCloseByOutsideClick(!count);
|
||||||
}) | rpl::map([=](int count) {
|
}) | rpl::map([=](int count) {
|
||||||
return (count < kMaxOptionsCount)
|
return (count < kMaxOptionsCount)
|
||||||
? lng_polls_create_limit(lt_count, kMaxOptionsCount - count)
|
? tr::lng_polls_create_limit(tr::now, lt_count, kMaxOptionsCount - count)
|
||||||
: tr::lng_polls_create_maximum(tr::now);
|
: tr::lng_polls_create_maximum(tr::now);
|
||||||
}) | rpl::after_next([=] {
|
}) | rpl::after_next([=] {
|
||||||
container->resizeToWidth(container->widthNoMargins());
|
container->resizeToWidth(container->widthNoMargins());
|
||||||
|
|
|
@ -95,7 +95,7 @@ std::unique_ptr<PrivacyExceptionsBoxController::Row> PrivacyExceptionsBoxControl
|
||||||
}();
|
}();
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
result->setCustomStatus(
|
result->setCustomStatus(
|
||||||
lng_chat_status_members(lt_count_decimal, count));
|
tr::lng_chat_status_members(tr::now, lt_count_decimal, count));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -302,7 +302,7 @@ void EditPrivacyBox::setupContent() {
|
||||||
return Settings::ExceptionUsersCount(exceptions(exception));
|
return Settings::ExceptionUsersCount(exceptions(exception));
|
||||||
}) | rpl::map([](int count) {
|
}) | rpl::map([](int count) {
|
||||||
return count
|
return count
|
||||||
? lng_edit_privacy_exceptions_count(lt_count, count)
|
? tr::lng_edit_privacy_exceptions_count(tr::now, lt_count, count)
|
||||||
: tr::lng_edit_privacy_exceptions_add(tr::now);
|
: tr::lng_edit_privacy_exceptions_add(tr::now);
|
||||||
});
|
});
|
||||||
auto text = _controller->exceptionButtonTextKey(exception);
|
auto text = _controller->exceptionButtonTextKey(exception);
|
||||||
|
|
|
@ -103,9 +103,9 @@ QString TimeLimitText(size_type limit) {
|
||||||
const auto weeks = (days / 7);
|
const auto weeks = (days / 7);
|
||||||
const auto months = (days / 29);
|
const auto months = (days / 29);
|
||||||
return (months > 0)
|
return (months > 0)
|
||||||
? lng_local_storage_limit_months(lt_count, months)
|
? tr::lng_local_storage_limit_months(tr::now, lt_count, months)
|
||||||
: (limit > 0)
|
: (limit > 0)
|
||||||
? lng_local_storage_limit_weeks(lt_count, weeks)
|
? tr::lng_local_storage_limit_weeks(tr::now, lt_count, weeks)
|
||||||
: tr::lng_local_storage_limit_never(tr::now);
|
: tr::lng_local_storage_limit_never(tr::now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ void LocalStorageBox::setupControls() {
|
||||||
const auto &data = (i != end(_stats.tagged)) ? i->second : empty;
|
const auto &data = (i != end(_stats.tagged)) ? i->second : empty;
|
||||||
auto factory = std::forward<decltype(titleFactory)>(titleFactory);
|
auto factory = std::forward<decltype(titleFactory)>(titleFactory);
|
||||||
auto title = [factory = std::move(factory)](size_type count) {
|
auto title = [factory = std::move(factory)](size_type count) {
|
||||||
return factory(lt_count, count);
|
return factory(tr::now, lt_count, count);
|
||||||
};
|
};
|
||||||
tracker.track(createRow(
|
tracker.track(createRow(
|
||||||
tag,
|
tag,
|
||||||
|
@ -414,11 +414,11 @@ void LocalStorageBox::setupControls() {
|
||||||
container,
|
container,
|
||||||
object_ptr<Ui::PlainShadow>(container),
|
object_ptr<Ui::PlainShadow>(container),
|
||||||
st::localStorageRowPadding));
|
st::localStorageRowPadding));
|
||||||
createTagRow(Data::kImageCacheTag, lng_local_storage_image);
|
createTagRow(Data::kImageCacheTag, tr::lng_local_storage_image);
|
||||||
createTagRow(Data::kStickerCacheTag, lng_local_storage_sticker);
|
createTagRow(Data::kStickerCacheTag, tr::lng_local_storage_sticker);
|
||||||
createTagRow(Data::kVoiceMessageCacheTag, lng_local_storage_voice);
|
createTagRow(Data::kVoiceMessageCacheTag, tr::lng_local_storage_voice);
|
||||||
createTagRow(Data::kVideoMessageCacheTag, lng_local_storage_round);
|
createTagRow(Data::kVideoMessageCacheTag, tr::lng_local_storage_round);
|
||||||
createTagRow(Data::kAnimationCacheTag, lng_local_storage_animation);
|
createTagRow(Data::kAnimationCacheTag, tr::lng_local_storage_animation);
|
||||||
tracker.track(createRow(
|
tracker.track(createRow(
|
||||||
kFakeMediaCacheTag,
|
kFakeMediaCacheTag,
|
||||||
std::move(mediaCacheTitle),
|
std::move(mediaCacheTitle),
|
||||||
|
@ -506,14 +506,14 @@ void LocalStorageBox::updateTotalLabel() {
|
||||||
Expects(_totalLabel != nullptr);
|
Expects(_totalLabel != nullptr);
|
||||||
|
|
||||||
const auto text = SizeLimitText(_totalSizeLimit);
|
const auto text = SizeLimitText(_totalSizeLimit);
|
||||||
_totalLabel->setText(lng_local_storage_size_limit(lt_size, text));
|
_totalLabel->setText(tr::lng_local_storage_size_limit(tr::now, lt_size, text));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalStorageBox::updateMediaLabel() {
|
void LocalStorageBox::updateMediaLabel() {
|
||||||
Expects(_mediaLabel != nullptr);
|
Expects(_mediaLabel != nullptr);
|
||||||
|
|
||||||
const auto text = SizeLimitText(_mediaSizeLimit);
|
const auto text = SizeLimitText(_mediaSizeLimit);
|
||||||
_mediaLabel->setText(lng_local_storage_media_limit(lt_size, text));
|
_mediaLabel->setText(tr::lng_local_storage_media_limit(tr::now, lt_size, text));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) {
|
void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) {
|
||||||
|
@ -555,7 +555,7 @@ void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) {
|
||||||
[=](not_null<Ui::LabelSimple*> label, size_type limit) {
|
[=](not_null<Ui::LabelSimple*> label, size_type limit) {
|
||||||
_timeLimit = ValueToLimit(limit);
|
_timeLimit = ValueToLimit(limit);
|
||||||
const auto text = TimeLimitText(_timeLimit);
|
const auto text = TimeLimitText(_timeLimit);
|
||||||
label->setText(lng_local_storage_time_limit(lt_limit, text));
|
label->setText(tr::lng_local_storage_time_limit(tr::now, lt_limit, text));
|
||||||
limitsChanged();
|
limitsChanged();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,9 +56,9 @@ void MuteSettingsBox::prepare() {
|
||||||
for (const auto hours : { 1, 4, 18, 72, kForeverHours }) {
|
for (const auto hours : { 1, 4, 18, 72, kForeverHours }) {
|
||||||
const auto text = [&] {
|
const auto text = [&] {
|
||||||
if (hours < 24) {
|
if (hours < 24) {
|
||||||
return lng_mute_duration_hours(lt_count, hours);
|
return tr::lng_mute_duration_hours(tr::now, lt_count, hours);
|
||||||
} else if (hours < kForeverHours) {
|
} else if (hours < kForeverHours) {
|
||||||
return lng_mute_duration_days(lt_count, hours / 24);
|
return tr::lng_mute_duration_days(tr::now, lt_count, hours / 24);
|
||||||
} else {
|
} else {
|
||||||
return tr::lng_mute_duration_forever(tr::now);
|
return tr::lng_mute_duration_forever(tr::now);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ PasscodeBox::PasscodeBox(QWidget*, const CloudFields &fields)
|
||||||
if (!_cloudFields.hint.isEmpty()) {
|
if (!_cloudFields.hint.isEmpty()) {
|
||||||
_hintText.setText(
|
_hintText.setText(
|
||||||
st::passcodeTextStyle,
|
st::passcodeTextStyle,
|
||||||
lng_signin_hint(lt_password_hint, _cloudFields.hint));
|
tr::lng_signin_hint(tr::now, lt_password_hint, _cloudFields.hint));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -912,7 +912,7 @@ RecoverBox::RecoverBox(
|
||||||
QWidget*,
|
QWidget*,
|
||||||
const QString &pattern,
|
const QString &pattern,
|
||||||
bool notEmptyPassport)
|
bool notEmptyPassport)
|
||||||
: _pattern(st::normalFont->elided(lng_signin_recover_hint(lt_recover_email, pattern), st::boxWidth - st::boxPadding.left() * 1.5))
|
: _pattern(st::normalFont->elided(tr::lng_signin_recover_hint(tr::now, lt_recover_email, pattern), st::boxWidth - st::boxPadding.left() * 1.5))
|
||||||
, _notEmptyPassport(notEmptyPassport)
|
, _notEmptyPassport(notEmptyPassport)
|
||||||
, _recoverCode(this, st::defaultInputField, tr::lng_signin_code()) {
|
, _recoverCode(this, st::defaultInputField, tr::lng_signin_code()) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ void PeerListRow::refreshStatus() {
|
||||||
if (!chat->amIn()) {
|
if (!chat->amIn()) {
|
||||||
setStatusText(tr::lng_chat_status_unaccessible(tr::now));
|
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(tr::lng_chat_status_members(tr::now, lt_count_decimal, chat->count));
|
||||||
} else {
|
} else {
|
||||||
setStatusText(tr::lng_group_status(tr::now));
|
setStatusText(tr::lng_group_status(tr::now));
|
||||||
}
|
}
|
||||||
|
|
|
@ -418,9 +418,9 @@ void AddBotToGroupBoxController::shareBotGame(not_null<PeerData*> chat) {
|
||||||
});
|
});
|
||||||
auto confirmText = [chat] {
|
auto confirmText = [chat] {
|
||||||
if (chat->isUser()) {
|
if (chat->isUser()) {
|
||||||
return lng_bot_sure_share_game(lt_user, App::peerName(chat));
|
return tr::lng_bot_sure_share_game(tr::now, lt_user, App::peerName(chat));
|
||||||
}
|
}
|
||||||
return lng_bot_sure_share_game_group(lt_group, chat->name);
|
return tr::lng_bot_sure_share_game_group(tr::now, lt_group, chat->name);
|
||||||
}();
|
}();
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<ConfirmBox>(confirmText, std::move(send)),
|
Box<ConfirmBox>(confirmText, std::move(send)),
|
||||||
|
@ -439,7 +439,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
|
||||||
auto send = crl::guard(this, [bot = _bot, chat] {
|
auto send = crl::guard(this, [bot = _bot, chat] {
|
||||||
AddBotToGroup(bot, chat);
|
AddBotToGroup(bot, chat);
|
||||||
});
|
});
|
||||||
auto confirmText = lng_bot_sure_invite(lt_group, chat->name);
|
auto confirmText = tr::lng_bot_sure_invite(tr::now, lt_group, chat->name);
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<ConfirmBox>(confirmText, send),
|
Box<ConfirmBox>(confirmText, send),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
|
|
@ -731,8 +731,11 @@ void AddSpecialBoxController::kickUser(
|
||||||
// Finally kick him.
|
// Finally kick him.
|
||||||
if (!sure) {
|
if (!sure) {
|
||||||
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
||||||
? lng_profile_sure_kick
|
? tr::lng_profile_sure_kick
|
||||||
: lng_profile_sure_kick_channel)(lt_user, App::peerName(user));
|
: tr::lng_profile_sure_kick_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
App::peerName(user));
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(text, kickUserSure),
|
Box<ConfirmBox>(text, kickUserSure),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
|
|
|
@ -203,7 +203,7 @@ void Controller::sendRequest(const QString &first, const QString &last) {
|
||||||
weak->closeBox();
|
weak->closeBox();
|
||||||
}
|
}
|
||||||
if (!wasContact) {
|
if (!wasContact) {
|
||||||
Ui::Toast::Show(lng_new_contact_add_done(lt_user, first));
|
Ui::Toast::Show(tr::lng_new_contact_add_done(tr::now, lt_user, first));
|
||||||
}
|
}
|
||||||
}).fail([=](const RPCError &error) {
|
}).fail([=](const RPCError &error) {
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -216,7 +216,7 @@ void Controller::setupWarning() {
|
||||||
_box->addRow(
|
_box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_box,
|
_box,
|
||||||
lng_contact_phone_after(lt_user, _user->shortName()),
|
tr::lng_contact_phone_after(tr::now, lt_user, _user->shortName()),
|
||||||
st::changePhoneLabel),
|
st::changePhoneLabel),
|
||||||
st::addContactWarningMargin);
|
st::addContactWarningMargin);
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ void Controller::setupSharePhoneNumber() {
|
||||||
_box->addRow(
|
_box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_box,
|
_box,
|
||||||
lng_contact_phone_will_be_shared(lt_user, _user->shortName()),
|
tr::lng_contact_phone_will_be_shared(tr::now, lt_user, _user->shortName()),
|
||||||
st::changePhoneLabel),
|
st::changePhoneLabel),
|
||||||
st::addContactWarningMargin);
|
st::addContactWarningMargin);
|
||||||
|
|
||||||
|
|
|
@ -519,8 +519,11 @@ void EditAdminBox::sendTransferRequestFrom(
|
||||||
)).done([=](const MTPUpdates &result) {
|
)).done([=](const MTPUpdates &result) {
|
||||||
api->applyUpdates(result);
|
api->applyUpdates(result);
|
||||||
Ui::Toast::Show((channel->isBroadcast()
|
Ui::Toast::Show((channel->isBroadcast()
|
||||||
? lng_rights_transfer_done_channel
|
? tr::lng_rights_transfer_done_channel
|
||||||
: lng_rights_transfer_done_group)(lt_user, user->shortName()));
|
: tr::lng_rights_transfer_done_group)(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
user->shortName()));
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
}).fail(crl::guard(this, [=](const RPCError &error) {
|
}).fail(crl::guard(this, [=](const RPCError &error) {
|
||||||
if (weak) {
|
if (weak) {
|
||||||
|
@ -744,7 +747,8 @@ void EditRestrictedBox::createUntilVariants() {
|
||||||
&& until <= to) {
|
&& until <= to) {
|
||||||
addVariant(
|
addVariant(
|
||||||
until,
|
until,
|
||||||
lng_rights_chat_banned_custom_date(
|
tr::lng_rights_chat_banned_custom_date(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
langDayOfMonthFull(ParseDateTime(until).date())));
|
langDayOfMonthFull(ParseDateTime(until).date())));
|
||||||
}
|
}
|
||||||
|
@ -765,9 +769,9 @@ void EditRestrictedBox::createUntilVariants() {
|
||||||
auto nextDay = now + kSecondsInDay;
|
auto nextDay = now + kSecondsInDay;
|
||||||
auto nextWeek = now + kSecondsInWeek;
|
auto nextWeek = now + kSecondsInWeek;
|
||||||
addCurrentVariant(0, nextDay);
|
addCurrentVariant(0, nextDay);
|
||||||
addVariant(kUntilOneDay, lng_rights_chat_banned_day(lt_count, 1));
|
addVariant(kUntilOneDay, tr::lng_rights_chat_banned_day(tr::now, lt_count, 1));
|
||||||
addCurrentVariant(nextDay, nextWeek);
|
addCurrentVariant(nextDay, nextWeek);
|
||||||
addVariant(kUntilOneWeek, lng_rights_chat_banned_week(lt_count, 1));
|
addVariant(kUntilOneWeek, tr::lng_rights_chat_banned_week(tr::now, lt_count, 1));
|
||||||
addCurrentVariant(nextWeek, INT_MAX);
|
addCurrentVariant(nextWeek, INT_MAX);
|
||||||
addVariant(kUntilCustom, tr::lng_rights_chat_banned_custom(tr::now));
|
addVariant(kUntilCustom, tr::lng_rights_chat_banned_custom(tr::now));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1554,8 +1554,11 @@ void ParticipantsBoxController::editRestrictedDone(
|
||||||
|
|
||||||
void ParticipantsBoxController::kickMember(not_null<UserData*> user) {
|
void ParticipantsBoxController::kickMember(not_null<UserData*> user) {
|
||||||
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
const auto text = ((_peer->isChat() || _peer->isMegagroup())
|
||||||
? lng_profile_sure_kick
|
? tr::lng_profile_sure_kick
|
||||||
: lng_profile_sure_kick_channel)(lt_user, user->firstName);
|
: tr::lng_profile_sure_kick_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_user,
|
||||||
|
user->firstName);
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
|
@ -1598,7 +1601,8 @@ void ParticipantsBoxController::kickMemberSure(not_null<UserData*> user) {
|
||||||
void ParticipantsBoxController::removeAdmin(not_null<UserData*> user) {
|
void ParticipantsBoxController::removeAdmin(not_null<UserData*> user) {
|
||||||
_editBox = Ui::show(
|
_editBox = Ui::show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
lng_profile_sure_remove_admin(
|
tr::lng_profile_sure_remove_admin(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
user->firstName),
|
user->firstName),
|
||||||
tr::lng_box_remove(tr::now),
|
tr::lng_box_remove(tr::now),
|
||||||
|
@ -1752,7 +1756,8 @@ void ParticipantsBoxController::refreshCustomStatus(
|
||||||
const auto user = row->peer()->asUser();
|
const auto user = row->peer()->asUser();
|
||||||
if (_role == Role::Admins) {
|
if (_role == Role::Admins) {
|
||||||
if (const auto by = _additional.adminPromotedBy(user)) {
|
if (const auto by = _additional.adminPromotedBy(user)) {
|
||||||
row->setCustomStatus(lng_channel_admin_status_promoted_by(
|
row->setCustomStatus(tr::lng_channel_admin_status_promoted_by(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
App::peerName(by)));
|
App::peerName(by)));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1767,10 +1772,11 @@ void ParticipantsBoxController::refreshCustomStatus(
|
||||||
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
} else if (_role == Role::Kicked || _role == Role::Restricted) {
|
||||||
const auto by = _additional.restrictedBy(user);
|
const auto by = _additional.restrictedBy(user);
|
||||||
row->setCustomStatus((_role == Role::Kicked
|
row->setCustomStatus((_role == Role::Kicked
|
||||||
? lng_channel_banned_status_removed_by
|
? tr::lng_channel_banned_status_removed_by
|
||||||
: lng_channel_banned_status_restricted_by)(
|
: tr::lng_channel_banned_status_restricted_by)(
|
||||||
lt_user,
|
tr::now,
|
||||||
by ? App::peerName(by) : "Unknown"));
|
lt_user,
|
||||||
|
by ? App::peerName(by) : "Unknown"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,8 @@ void SelfDestructionBox::showContent() {
|
||||||
|
|
||||||
QString SelfDestructionBox::DaysLabel(int days) {
|
QString SelfDestructionBox::DaysLabel(int days) {
|
||||||
return (days > 364)
|
return (days > 364)
|
||||||
? lng_self_destruct_years(lt_count, days / 365)
|
? tr::lng_self_destruct_years(tr::now, lt_count, days / 365)
|
||||||
: lng_self_destruct_months(lt_count, qMax(days / 30, 1));
|
: tr::lng_self_destruct_months(tr::now, lt_count, qMax(days / 30, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelfDestructionBox::prepare() {
|
void SelfDestructionBox::prepare() {
|
||||||
|
|
|
@ -1550,11 +1550,11 @@ void SendFilesBox::setupSendWayControls() {
|
||||||
? tr::lng_send_separate_photos_videos(tr::now)
|
? tr::lng_send_separate_photos_videos(tr::now)
|
||||||
: (_list.albumIsPossible
|
: (_list.albumIsPossible
|
||||||
? tr::lng_send_separate_photos(tr::now)
|
? tr::lng_send_separate_photos(tr::now)
|
||||||
: lng_send_photos(lt_count, _list.files.size())));
|
: tr::lng_send_photos(tr::now, lt_count, _list.files.size())));
|
||||||
}
|
}
|
||||||
addRadio(_sendFiles, SendFilesWay::Files, (_list.files.size() == 1)
|
addRadio(_sendFiles, SendFilesWay::Files, (_list.files.size() == 1)
|
||||||
? tr::lng_send_file(tr::now)
|
? tr::lng_send_file(tr::now)
|
||||||
: lng_send_files(lt_count, _list.files.size()));
|
: tr::lng_send_files(tr::now, lt_count, _list.files.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendFilesBox::applyAlbumOrder() {
|
void SendFilesBox::applyAlbumOrder() {
|
||||||
|
@ -1753,8 +1753,8 @@ void SendFilesBox::setupTitleText() {
|
||||||
const auto onlyImages = (_compressConfirm != CompressConfirm::None)
|
const auto onlyImages = (_compressConfirm != CompressConfirm::None)
|
||||||
&& (_albumVideosCount == 0);
|
&& (_albumVideosCount == 0);
|
||||||
_titleText = onlyImages
|
_titleText = onlyImages
|
||||||
? lng_send_images_selected(lt_count, _list.files.size())
|
? tr::lng_send_images_selected(tr::now, lt_count, _list.files.size())
|
||||||
: lng_send_files_selected(lt_count, _list.files.size());
|
: tr::lng_send_files_selected(tr::now, lt_count, _list.files.size());
|
||||||
_titleHeight = st::boxTitleHeight;
|
_titleHeight = st::boxTitleHeight;
|
||||||
} else {
|
} else {
|
||||||
_titleText = QString();
|
_titleText = QString();
|
||||||
|
|
|
@ -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) : tr::lng_contacts_loading(tr::now);
|
auto statusText = (set->count > 0) ? tr::lng_stickers_count(tr::now, 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);
|
||||||
|
|
|
@ -148,7 +148,7 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
|
||||||
result->add(
|
result->add(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
result,
|
result,
|
||||||
lng_url_auth_open_confirm(lt_link, url),
|
tr::lng_url_auth_open_confirm(tr::now, lt_link, url),
|
||||||
st::boxLabel),
|
st::boxLabel),
|
||||||
st::boxPadding);
|
st::boxPadding);
|
||||||
const auto addCheckbox = [&](const QString &text) {
|
const auto addCheckbox = [&](const QString &text) {
|
||||||
|
@ -168,7 +168,8 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
|
||||||
return checkbox;
|
return checkbox;
|
||||||
};
|
};
|
||||||
const auto auth = addCheckbox(
|
const auto auth = addCheckbox(
|
||||||
lng_url_auth_login_option(
|
tr::lng_url_auth_login_option(
|
||||||
|
tr::now,
|
||||||
lt_domain,
|
lt_domain,
|
||||||
textcmdStartSemibold() + domain + textcmdStopSemibold(),
|
textcmdStartSemibold() + domain + textcmdStopSemibold(),
|
||||||
lt_user,
|
lt_user,
|
||||||
|
@ -176,7 +177,8 @@ not_null<Ui::RpWidget*> UrlAuthBox::setupContent(
|
||||||
+ App::peerName(Auth().user())
|
+ App::peerName(Auth().user())
|
||||||
+ textcmdStopSemibold())));
|
+ textcmdStopSemibold())));
|
||||||
const auto allow = bot
|
const auto allow = bot
|
||||||
? addCheckbox(lng_url_auth_allow_messages(
|
? addCheckbox(tr::lng_url_auth_allow_messages(
|
||||||
|
tr::now,
|
||||||
lt_bot,
|
lt_bot,
|
||||||
textcmdStartSemibold() + bot->firstName + textcmdStopSemibold()))
|
textcmdStartSemibold() + bot->firstName + textcmdStopSemibold()))
|
||||||
: nullptr;
|
: nullptr;
|
||||||
|
|
|
@ -165,11 +165,11 @@ void BoxController::Row::refreshStatus() {
|
||||||
auto time = ItemDateTime(_items.front()).time().toString(cTimeFormat());
|
auto time = ItemDateTime(_items.front()).time().toString(cTimeFormat());
|
||||||
auto today = QDateTime::currentDateTime().date();
|
auto today = QDateTime::currentDateTime().date();
|
||||||
if (_date == today) {
|
if (_date == today) {
|
||||||
return lng_call_box_status_today(lt_time, time);
|
return tr::lng_call_box_status_today(tr::now, lt_time, time);
|
||||||
} else if (_date.addDays(1) == today) {
|
} else if (_date.addDays(1) == today) {
|
||||||
return lng_call_box_status_yesterday(lt_time, time);
|
return tr::lng_call_box_status_yesterday(tr::now, lt_time, time);
|
||||||
}
|
}
|
||||||
return lng_call_box_status_date(lt_date, langDayOfMonthFull(_date), lt_time, time);
|
return tr::lng_call_box_status_date(tr::now, lt_date, langDayOfMonthFull(_date), lt_time, time);
|
||||||
};
|
};
|
||||||
setCustomStatus((_items.size() > 1)
|
setCustomStatus((_items.size() > 1)
|
||||||
? tr::lng_call_box_status_group(
|
? tr::lng_call_box_status_group(
|
||||||
|
|
|
@ -872,9 +872,9 @@ void Call::setFailedQueued(int error) {
|
||||||
|
|
||||||
void Call::handleRequestError(const RPCError &error) {
|
void Call::handleRequestError(const RPCError &error) {
|
||||||
if (error.type() == qstr("USER_PRIVACY_RESTRICTED")) {
|
if (error.type() == qstr("USER_PRIVACY_RESTRICTED")) {
|
||||||
Ui::show(Box<InformBox>(lng_call_error_not_available(lt_user, App::peerName(_user))));
|
Ui::show(Box<InformBox>(tr::lng_call_error_not_available(tr::now, lt_user, App::peerName(_user))));
|
||||||
} else if (error.type() == qstr("PARTICIPANT_VERSION_OUTDATED")) {
|
} else if (error.type() == qstr("PARTICIPANT_VERSION_OUTDATED")) {
|
||||||
Ui::show(Box<InformBox>(lng_call_error_outdated(lt_user, App::peerName(_user))));
|
Ui::show(Box<InformBox>(tr::lng_call_error_outdated(tr::now, lt_user, App::peerName(_user))));
|
||||||
} else if (error.type() == qstr("CALL_PROTOCOL_LAYER_INVALID")) {
|
} else if (error.type() == qstr("CALL_PROTOCOL_LAYER_INVALID")) {
|
||||||
Ui::show(Box<InformBox>(Lang::Hard::CallErrorIncompatible().replace("{user}", App::peerName(_user))));
|
Ui::show(Box<InformBox>(Lang::Hard::CallErrorIncompatible().replace("{user}", App::peerName(_user))));
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ void Instance::startOutgoingCall(not_null<UserData*> user) {
|
||||||
if (user->callsStatus() == UserData::CallsStatus::Private) {
|
if (user->callsStatus() == UserData::CallsStatus::Private) {
|
||||||
// Request full user once more to refresh the setting in case it was changed.
|
// Request full user once more to refresh the setting in case it was changed.
|
||||||
Auth().api().requestFullPeer(user);
|
Auth().api().requestFullPeer(user);
|
||||||
Ui::show(Box<InformBox>(lng_call_error_not_available(lt_user, App::peerName(user))));
|
Ui::show(Box<InformBox>(tr::lng_call_error_not_available(tr::now, lt_user, App::peerName(user))));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
requestMicrophonePermissionOrFail(crl::guard(this, [=] {
|
requestMicrophonePermissionOrFail(crl::guard(this, [=] {
|
||||||
|
|
|
@ -811,7 +811,7 @@ void Panel::leaveToChildEvent(QEvent *e, QWidget *child) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Panel::tooltipText() const {
|
QString Panel::tooltipText() const {
|
||||||
return lng_call_fingerprint_tooltip(lt_user, App::peerName(_user));
|
return tr::lng_call_fingerprint_tooltip(tr::now, lt_user, App::peerName(_user));
|
||||||
}
|
}
|
||||||
|
|
||||||
QPoint Panel::tooltipPos() const {
|
QPoint Panel::tooltipPos() const {
|
||||||
|
|
|
@ -167,7 +167,7 @@ SetState ComputeState(int id) {
|
||||||
|
|
||||||
QString StateDescription(const SetState &state) {
|
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 tr::lng_emoji_set_download(tr::now, lt_size, formatSizeText(data.size));
|
||||||
}, [](const Ready &data) -> QString {
|
}, [](const Ready &data) -> QString {
|
||||||
return tr::lng_emoji_set_ready(tr::now);
|
return tr::lng_emoji_set_ready(tr::now);
|
||||||
}, [](const Active &data) -> QString {
|
}, [](const Active &data) -> QString {
|
||||||
|
@ -176,7 +176,8 @@ QString StateDescription(const SetState &state) {
|
||||||
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.)
|
||||||
: 0.;
|
: 0.;
|
||||||
return lng_emoji_set_loading(
|
return tr::lng_emoji_set_loading(
|
||||||
|
tr::now,
|
||||||
lt_percent,
|
lt_percent,
|
||||||
QString::number(int(std::round(percent))) + '%',
|
QString::number(int(std::round(percent))) + '%',
|
||||||
lt_progress,
|
lt_progress,
|
||||||
|
|
|
@ -1241,7 +1241,7 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto statusText = (size > 0) ? lng_stickers_count(lt_count, size) : tr::lng_contacts_loading(tr::now);
|
auto statusText = (size > 0) ? tr::lng_stickers_count(tr::now, 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);
|
||||||
|
@ -2435,7 +2435,7 @@ void StickersListWidget::removeSet(uint64 setId) {
|
||||||
auto it = sets.constFind(setId);
|
auto it = sets.constFind(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 = tr::lng_stickers_remove_pack(tr::now, lt_sticker_pack, it->title);
|
||||||
Ui::show(Box<ConfirmBox>(text, tr::lng_stickers_remove_pack_confirm(tr::now), 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();
|
||||||
|
|
|
@ -108,7 +108,6 @@ bool Generator::writeHeader() {
|
||||||
writeHeaderTagTypes();
|
writeHeaderTagTypes();
|
||||||
writeHeaderInterface();
|
writeHeaderInterface();
|
||||||
writeHeaderReactiveInterface();
|
writeHeaderReactiveInterface();
|
||||||
writeHeaderTaggedMethods();
|
|
||||||
|
|
||||||
return header_->finalize();
|
return header_->finalize();
|
||||||
}
|
}
|
||||||
|
@ -116,8 +115,8 @@ bool Generator::writeHeader() {
|
||||||
void Generator::writeHeaderForwardDeclarations() {
|
void Generator::writeHeaderForwardDeclarations() {
|
||||||
header_->pushNamespace("Lang").stream() << "\
|
header_->pushNamespace("Lang").stream() << "\
|
||||||
\n\
|
\n\
|
||||||
inline constexpr ushort kTagsCount = " << langpack_.tags.size() << ";\n\
|
inline constexpr auto kTagsCount = ushort(" << langpack_.tags.size() << ");\n\
|
||||||
inline constexpr ushort kKeysCount = " << langpack_.entries.size() << ";\n\
|
inline constexpr auto kKeysCount = ushort(" << langpack_.entries.size() << ");\n\
|
||||||
\n";
|
\n";
|
||||||
header_->popNamespace().newline();
|
header_->popNamespace().newline();
|
||||||
}
|
}
|
||||||
|
@ -141,27 +140,6 @@ void Generator::writeHeaderTagTypes() {
|
||||||
header_->newline();
|
header_->newline();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Generator::writeHeaderTaggedMethods() {
|
|
||||||
for (auto &entry : langpack_.entries) {
|
|
||||||
auto isPlural = !entry.keyBase.isEmpty();
|
|
||||||
auto &key = entry.key;
|
|
||||||
auto params = QStringList();
|
|
||||||
auto args = QStringList();
|
|
||||||
for (auto &tagData : entry.tags) {
|
|
||||||
auto &tag = tagData.tag;
|
|
||||||
auto isPluralTag = isPlural && (tag == kPluralTags[0]);
|
|
||||||
params.push_back("lngtag_" + tag + (isPluralTag ? " type" : "") + ", " + (isPluralTag ? "float64 " : "const QString &") + tag + "__val");
|
|
||||||
args.push_back((isPluralTag ? "type" : ("lt_" + tag)) + ", " + tag + "__val");
|
|
||||||
}
|
|
||||||
if (!entry.tags.empty() && (!isPlural || key == ComputePluralKey(entry.keyBase, 0))) {
|
|
||||||
header_->stream() << "\
|
|
||||||
inline QString " << (isPlural ? entry.keyBase : key) << "(" << params.join(QString(", ")) << ") {\n\
|
|
||||||
return tr::" << (isPlural ? entry.keyBase : key) << "(tr::now, " << args.join(QString(", ")) << ");\n\
|
|
||||||
}\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Generator::writeHeaderInterface() {
|
void Generator::writeHeaderInterface() {
|
||||||
header_->pushNamespace("Lang").stream() << "\
|
header_->pushNamespace("Lang").stream() << "\
|
||||||
\n\
|
\n\
|
||||||
|
@ -219,6 +197,12 @@ struct now_t {\n\
|
||||||
\n\
|
\n\
|
||||||
inline constexpr now_t now{};\n\
|
inline constexpr now_t now{};\n\
|
||||||
\n\
|
\n\
|
||||||
|
inline auto to_count() {\n\
|
||||||
|
return rpl::map([](auto value) {\n\
|
||||||
|
return float64(value);\n\
|
||||||
|
});\n\
|
||||||
|
}\n\
|
||||||
|
\n\
|
||||||
template <typename ...Tags>\n\
|
template <typename ...Tags>\n\
|
||||||
struct phrase;\n\
|
struct phrase;\n\
|
||||||
\n";
|
\n";
|
||||||
|
@ -297,6 +281,7 @@ inline constexpr phrase<" << tags.join(", ") << "> " << (isPlural ? entry.keyBas
|
||||||
}
|
}
|
||||||
|
|
||||||
void Generator::writeSourceLangKeyConstants() {
|
void Generator::writeSourceLangKeyConstants() {
|
||||||
|
source_->newline();
|
||||||
auto index = 0;
|
auto index = 0;
|
||||||
for (auto &entry : langpack_.entries) {
|
for (auto &entry : langpack_.entries) {
|
||||||
source_->stream() << "constexpr auto " << getFullKey(entry) << " = ushort(" << (index++) << ");\n";
|
source_->stream() << "constexpr auto " << getFullKey(entry) << " = ushort(" << (index++) << ");\n";
|
||||||
|
@ -312,7 +297,6 @@ bool Generator::writeSource() {
|
||||||
writeSourceLangKeyConstants();
|
writeSourceLangKeyConstants();
|
||||||
|
|
||||||
source_->stream() << "\
|
source_->stream() << "\
|
||||||
\n\
|
|
||||||
QChar DefaultData[] = {";
|
QChar DefaultData[] = {";
|
||||||
auto count = 0;
|
auto count = 0;
|
||||||
auto fulllength = 0;
|
auto fulllength = 0;
|
||||||
|
|
|
@ -31,7 +31,6 @@ public:
|
||||||
private:
|
private:
|
||||||
void writeHeaderForwardDeclarations();
|
void writeHeaderForwardDeclarations();
|
||||||
void writeHeaderTagTypes();
|
void writeHeaderTagTypes();
|
||||||
void writeHeaderTaggedMethods();
|
|
||||||
void writeHeaderInterface();
|
void writeHeaderInterface();
|
||||||
void writeHeaderTagValueLookup();
|
void writeHeaderTagValueLookup();
|
||||||
void writeHeaderReactiveInterface();
|
void writeHeaderReactiveInterface();
|
||||||
|
|
|
@ -122,7 +122,8 @@ void Changelogs::addLocalLogs() {
|
||||||
addBetaLogs();
|
addBetaLogs();
|
||||||
}
|
}
|
||||||
if (!_addedSomeLocal) {
|
if (!_addedSomeLocal) {
|
||||||
const auto text = lng_new_version_wrap(
|
const auto text = tr::lng_new_version_wrap(
|
||||||
|
tr::now,
|
||||||
lt_version,
|
lt_version,
|
||||||
QString::fromLatin1(AppVersionStr),
|
QString::fromLatin1(AppVersionStr),
|
||||||
lt_changes,
|
lt_changes,
|
||||||
|
|
|
@ -193,7 +193,7 @@ void BotGameUrlClickHandler::onClick(ClickContext context) const {
|
||||||
open();
|
open();
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lng_allow_bot_pass(lt_bot_name, _bot->name),
|
tr::lng_allow_bot_pass(tr::now, lt_bot_name, _bot->name),
|
||||||
tr::lng_allow_bot(tr::now),
|
tr::lng_allow_bot(tr::now),
|
||||||
callback));
|
callback));
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,15 +90,15 @@ QString WithCaptionDialogsText(
|
||||||
return textcmdLink(1, TextUtilities::Clean(attachType));
|
return textcmdLink(1, TextUtilities::Clean(attachType));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto captionText = TextUtilities::Clean(caption);
|
return tr::lng_dialogs_text_media(
|
||||||
auto attachTypeWrapped = textcmdLink(1, lng_dialogs_text_media_wrapped(
|
tr::now,
|
||||||
lt_media,
|
|
||||||
TextUtilities::Clean(attachType)));
|
|
||||||
return lng_dialogs_text_media(
|
|
||||||
lt_media_part,
|
lt_media_part,
|
||||||
attachTypeWrapped,
|
textcmdLink(1, tr::lng_dialogs_text_media_wrapped(
|
||||||
|
tr::now,
|
||||||
|
lt_media,
|
||||||
|
TextUtilities::Clean(attachType))),
|
||||||
lt_caption,
|
lt_caption,
|
||||||
captionText);
|
TextUtilities::Clean(caption));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WithCaptionNotificationText(
|
QString WithCaptionNotificationText(
|
||||||
|
@ -108,12 +108,13 @@ QString WithCaptionNotificationText(
|
||||||
return attachType;
|
return attachType;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto attachTypeWrapped = lng_dialogs_text_media_wrapped(
|
return tr::lng_dialogs_text_media(
|
||||||
lt_media,
|
tr::now,
|
||||||
attachType);
|
|
||||||
return lng_dialogs_text_media(
|
|
||||||
lt_media_part,
|
lt_media_part,
|
||||||
attachTypeWrapped,
|
tr::lng_dialogs_text_media_wrapped(
|
||||||
|
tr::now,
|
||||||
|
lt_media,
|
||||||
|
attachType),
|
||||||
lt_caption,
|
lt_caption,
|
||||||
caption);
|
caption);
|
||||||
}
|
}
|
||||||
|
@ -586,7 +587,7 @@ QString MediaFile::notificationText() const {
|
||||||
if (const auto sticker = _document->sticker()) {
|
if (const auto sticker = _document->sticker()) {
|
||||||
return _emoji.isEmpty()
|
return _emoji.isEmpty()
|
||||||
? tr::lng_in_dlg_sticker(tr::now)
|
? tr::lng_in_dlg_sticker(tr::now)
|
||||||
: lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
: tr::lng_in_dlg_sticker_emoji(tr::now, lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
const auto type = [&] {
|
const auto type = [&] {
|
||||||
if (_document->isVideoMessage()) {
|
if (_document->isVideoMessage()) {
|
||||||
|
@ -610,7 +611,7 @@ QString MediaFile::notificationText() const {
|
||||||
QString MediaFile::pinnedTextSubstring() const {
|
QString MediaFile::pinnedTextSubstring() const {
|
||||||
if (const auto sticker = _document->sticker()) {
|
if (const auto sticker = _document->sticker()) {
|
||||||
if (!_emoji.isEmpty()) {
|
if (!_emoji.isEmpty()) {
|
||||||
return lng_action_pinned_media_emoji_sticker(lt_emoji, _emoji);
|
return tr::lng_action_pinned_media_emoji_sticker(tr::now, lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
return tr::lng_action_pinned_media_sticker(tr::now);
|
return tr::lng_action_pinned_media_sticker(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
|
@ -636,7 +637,7 @@ TextForMimeData MediaFile::clipboardText() const {
|
||||||
: QString();
|
: QString();
|
||||||
if (const auto sticker = _document->sticker()) {
|
if (const auto sticker = _document->sticker()) {
|
||||||
if (!_emoji.isEmpty()) {
|
if (!_emoji.isEmpty()) {
|
||||||
return lng_in_dlg_sticker_emoji(lt_emoji, _emoji);
|
return tr::lng_in_dlg_sticker_emoji(tr::now, lt_emoji, _emoji);
|
||||||
}
|
}
|
||||||
return tr::lng_in_dlg_sticker(tr::now);
|
return tr::lng_in_dlg_sticker(tr::now);
|
||||||
} else if (_document->isAnimation()) {
|
} else if (_document->isAnimation()) {
|
||||||
|
@ -816,7 +817,8 @@ QString MediaContact::pinnedTextSubstring() const {
|
||||||
|
|
||||||
TextForMimeData MediaContact::clipboardText() const {
|
TextForMimeData MediaContact::clipboardText() const {
|
||||||
const auto text = qsl("[ ") + tr::lng_in_dlg_contact(tr::now) + qsl(" ]\n")
|
const auto text = qsl("[ ") + tr::lng_in_dlg_contact(tr::now) + qsl(" ]\n")
|
||||||
+ lng_full_name(
|
+ tr::lng_full_name(
|
||||||
|
tr::now,
|
||||||
lt_first_name,
|
lt_first_name,
|
||||||
_contact.firstName,
|
_contact.firstName,
|
||||||
lt_last_name,
|
lt_last_name,
|
||||||
|
@ -953,7 +955,8 @@ const Call *MediaCall::call() const {
|
||||||
QString MediaCall::notificationText() const {
|
QString MediaCall::notificationText() const {
|
||||||
auto result = Text(parent(), _call.finishReason);
|
auto result = Text(parent(), _call.finishReason);
|
||||||
if (_call.duration > 0) {
|
if (_call.duration > 0) {
|
||||||
result = lng_call_type_and_duration(
|
result = tr::lng_call_type_and_duration(
|
||||||
|
tr::now,
|
||||||
lt_type,
|
lt_type,
|
||||||
result,
|
result,
|
||||||
lt_duration,
|
lt_duration,
|
||||||
|
@ -1133,7 +1136,7 @@ GameData *MediaGame::game() const {
|
||||||
|
|
||||||
QString MediaGame::pinnedTextSubstring() const {
|
QString MediaGame::pinnedTextSubstring() const {
|
||||||
const auto title = _game->title;
|
const auto title = _game->title;
|
||||||
return lng_action_pinned_media_game(lt_game, title);
|
return tr::lng_action_pinned_media_game(tr::now, lt_game, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextForMimeData MediaGame::clipboardText() const {
|
TextForMimeData MediaGame::clipboardText() const {
|
||||||
|
|
|
@ -299,23 +299,23 @@ QString OnlineText(TimeId online, TimeId now) {
|
||||||
if (!minutes) {
|
if (!minutes) {
|
||||||
return tr::lng_status_lastseen_now(tr::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 tr::lng_status_lastseen_minutes(tr::now, lt_count, minutes);
|
||||||
}
|
}
|
||||||
const auto hours = (now - online) / 3600;
|
const auto hours = (now - online) / 3600;
|
||||||
if (hours < 12) {
|
if (hours < 12) {
|
||||||
return lng_status_lastseen_hours(lt_count, hours);
|
return tr::lng_status_lastseen_hours(tr::now, lt_count, hours);
|
||||||
}
|
}
|
||||||
const auto onlineFull = ParseDateTime(online);
|
const auto onlineFull = ParseDateTime(online);
|
||||||
const auto nowFull = ParseDateTime(now);
|
const auto nowFull = ParseDateTime(now);
|
||||||
if (onlineFull.date() == nowFull.date()) {
|
if (onlineFull.date() == nowFull.date()) {
|
||||||
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
||||||
return lng_status_lastseen_today(lt_time, onlineTime);
|
return tr::lng_status_lastseen_today(tr::now, lt_time, onlineTime);
|
||||||
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
||||||
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
||||||
return lng_status_lastseen_yesterday(lt_time, onlineTime);
|
return tr::lng_status_lastseen_yesterday(tr::now, lt_time, onlineTime);
|
||||||
}
|
}
|
||||||
const auto date = onlineFull.date().toString(qsl("dd.MM.yy"));
|
const auto date = onlineFull.date().toString(qsl("dd.MM.yy"));
|
||||||
return lng_status_lastseen_date(lt_date, date);
|
return tr::lng_status_lastseen_date(tr::now, lt_date, date);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString OnlineText(not_null<UserData*> user, TimeId now) {
|
QString OnlineText(not_null<UserData*> user, TimeId now) {
|
||||||
|
@ -335,14 +335,14 @@ QString OnlineTextFull(not_null<UserData*> user, TimeId now) {
|
||||||
const auto nowFull = ParseDateTime(now);
|
const auto nowFull = ParseDateTime(now);
|
||||||
if (onlineFull.date() == nowFull.date()) {
|
if (onlineFull.date() == nowFull.date()) {
|
||||||
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
||||||
return lng_status_lastseen_today(lt_time, onlineTime);
|
return tr::lng_status_lastseen_today(tr::now, lt_time, onlineTime);
|
||||||
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
} else if (onlineFull.date().addDays(1) == nowFull.date()) {
|
||||||
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
const auto onlineTime = onlineFull.time().toString(cTimeFormat());
|
||||||
return lng_status_lastseen_yesterday(lt_time, onlineTime);
|
return tr::lng_status_lastseen_yesterday(tr::now, lt_time, onlineTime);
|
||||||
}
|
}
|
||||||
const auto date = onlineFull.date().toString(qsl("dd.MM.yy"));
|
const auto date = onlineFull.date().toString(qsl("dd.MM.yy"));
|
||||||
const auto time = onlineFull.time().toString(cTimeFormat());
|
const auto time = onlineFull.time().toString(cTimeFormat());
|
||||||
return lng_status_lastseen_date_time(lt_date, date, lt_time, time);
|
return tr::lng_status_lastseen_date_time(tr::now, lt_date, date, lt_time, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnlineTextActive(TimeId online, TimeId now) {
|
bool OnlineTextActive(TimeId online, TimeId now) {
|
||||||
|
|
|
@ -113,7 +113,7 @@ void UserData::setName(const QString &newFirstName, const QString &newLastName,
|
||||||
firstName = newFirstName;
|
firstName = newFirstName;
|
||||||
lastName = newLastName;
|
lastName = newLastName;
|
||||||
}
|
}
|
||||||
newFullName = lastName.isEmpty() ? firstName : lng_full_name(lt_first_name, firstName, lt_last_name, lastName);
|
newFullName = lastName.isEmpty() ? firstName : tr::lng_full_name(tr::now, lt_first_name, firstName, lt_last_name, lastName);
|
||||||
}
|
}
|
||||||
updateNameDelayed(newFullName, newPhoneName, newUsername);
|
updateNameDelayed(newFullName, newPhoneName, newUsername);
|
||||||
}
|
}
|
||||||
|
|
|
@ -614,7 +614,8 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||||
? tr::lng_search_no_results(tr::now)
|
? tr::lng_search_no_results(tr::now)
|
||||||
: showUnreadInSearchResults
|
: showUnreadInSearchResults
|
||||||
? qsl("Search results")
|
? qsl("Search results")
|
||||||
: lng_search_found_results(
|
: tr::lng_search_found_results(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
_searchedMigratedCount + _searchedCount);
|
_searchedMigratedCount + _searchedCount);
|
||||||
p.fillRect(0, 0, fullWidth, st::searchedBarHeight, st::searchedBarBg);
|
p.fillRect(0, 0, fullWidth, st::searchedBarHeight, st::searchedBarBg);
|
||||||
|
@ -2251,7 +2252,8 @@ void InnerWidget::refreshSearchInChatLabel() {
|
||||||
return QString();
|
return QString();
|
||||||
}();
|
}();
|
||||||
if (!from.isEmpty()) {
|
if (!from.isEmpty()) {
|
||||||
const auto fromUserText = lng_dlg_search_from(
|
const auto fromUserText = tr::lng_dlg_search_from(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
textcmdLink(1, from));
|
textcmdLink(1, from));
|
||||||
_searchFromUserText.setText(
|
_searchFromUserText.setText(
|
||||||
|
|
|
@ -329,10 +329,10 @@ 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, tr::lng_from_draft(tr::now)));
|
auto draftWrapped = textcmdLink(1, tr::lng_dialogs_text_from_wrapped(tr::now, 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));
|
: tr::lng_dialogs_text_with_from(tr::now, lt_from_part, draftWrapped, lt_message, TextUtilities::Clean(draft->textWithTags.text));
|
||||||
history->cloudDraftTextCache.setText(st::dialogsTextStyle, draftText, Ui::DialogTextOptions());
|
history->cloudDraftTextCache.setText(st::dialogsTextStyle, draftText, Ui::DialogTextOptions());
|
||||||
}
|
}
|
||||||
p.setPen(active ? st::dialogsTextFgActive : (selected ? st::dialogsTextFgOver : st::dialogsTextFg));
|
p.setPen(active ? st::dialogsTextFgActive : (selected ? st::dialogsTextFgOver : st::dialogsTextFg));
|
||||||
|
|
|
@ -52,7 +52,8 @@ QString ComposeFolderListEntryText(not_null<Data::Folder*> folder) {
|
||||||
auto i = peers.begin();
|
auto i = peers.begin();
|
||||||
auto result = wrapName(*i);
|
auto result = wrapName(*i);
|
||||||
for (++i; i != peers.end(); ++i) {
|
for (++i; i != peers.end(); ++i) {
|
||||||
result = lng_archived_last_list(
|
result = tr::lng_archived_last_list(
|
||||||
|
tr::now,
|
||||||
lt_accumulated,
|
lt_accumulated,
|
||||||
result,
|
result,
|
||||||
lt_chat,
|
lt_chat,
|
||||||
|
@ -61,7 +62,7 @@ QString ComposeFolderListEntryText(not_null<Data::Folder*> folder) {
|
||||||
return result;
|
return result;
|
||||||
}();
|
}();
|
||||||
return (shown < count)
|
return (shown < count)
|
||||||
? lng_archived_last(lt_count, (count - shown), lt_chats, accumulated)
|
? tr::lng_archived_last(tr::now, lt_count, (count - shown), lt_chats, accumulated)
|
||||||
: accumulated;
|
: accumulated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,9 +199,10 @@ void PanelController::showError(const ApiErrorState &error) {
|
||||||
if (hours <= 0) {
|
if (hours <= 0) {
|
||||||
return tr::lng_export_delay_less_than_hour(tr::now);
|
return tr::lng_export_delay_less_than_hour(tr::now);
|
||||||
}
|
}
|
||||||
return lng_export_delay_hours(lt_count, hours);
|
return tr::lng_export_delay_hours(tr::now, lt_count, hours);
|
||||||
}();
|
}();
|
||||||
showError(lng_export_delay(
|
showError(tr::lng_export_delay(
|
||||||
|
tr::now,
|
||||||
lt_hours,
|
lt_hours,
|
||||||
hoursText,
|
hoursText,
|
||||||
lt_date,
|
lt_date,
|
||||||
|
|
|
@ -611,7 +611,7 @@ void SettingsWidget::addSizeSlider(
|
||||||
}) | rpl::start_with_next([=](int sizeLimit) {
|
}) | rpl::start_with_next([=](int sizeLimit) {
|
||||||
const auto limit = sizeLimit / kMegabyte;
|
const auto limit = sizeLimit / kMegabyte;
|
||||||
const auto size = QString::number(limit) + " MB";
|
const auto size = QString::number(limit) + " MB";
|
||||||
const auto text = lng_export_option_size_limit(lt_size, size);
|
const auto text = tr::lng_export_option_size_limit(tr::now, lt_size, size);
|
||||||
label->setText(text);
|
label->setText(text);
|
||||||
}, slider->lifetime());
|
}, slider->lifetime());
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,14 @@ void GenerateItems(
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createChangeTitle = [&](const MTPDchannelAdminLogEventActionChangeTitle &action) {
|
auto createChangeTitle = [&](const MTPDchannelAdminLogEventActionChangeTitle &action) {
|
||||||
auto text = (channel->isMegagroup() ? lng_action_changed_title : lng_admin_log_changed_title_channel)(lt_from, fromLinkText, lt_title, qs(action.vnew_value));
|
auto text = (channel->isMegagroup()
|
||||||
|
? tr::lng_action_changed_title
|
||||||
|
: tr::lng_admin_log_changed_title_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
fromLinkText,
|
||||||
|
lt_title,
|
||||||
|
qs(action.vnew_value));
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -392,9 +399,13 @@ void GenerateItems(
|
||||||
auto newValue = qs(action.vnew_value);
|
auto newValue = qs(action.vnew_value);
|
||||||
auto oldValue = qs(action.vprev_value);
|
auto oldValue = qs(action.vprev_value);
|
||||||
auto text = (channel->isMegagroup()
|
auto text = (channel->isMegagroup()
|
||||||
? (newValue.isEmpty() ? lng_admin_log_removed_description_group : lng_admin_log_changed_description_group)
|
? (newValue.isEmpty()
|
||||||
: (newValue.isEmpty() ? lng_admin_log_removed_description_channel : lng_admin_log_changed_description_channel)
|
? tr::lng_admin_log_removed_description_group
|
||||||
)(lt_from, fromLinkText);
|
: tr::lng_admin_log_changed_description_group)
|
||||||
|
: (newValue.isEmpty()
|
||||||
|
? tr::lng_admin_log_removed_description_channel
|
||||||
|
: tr::lng_admin_log_changed_description_channel)
|
||||||
|
)(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto bodyFlags = Flag::f_entities | Flag::f_from_id;
|
auto bodyFlags = Flag::f_entities | Flag::f_from_id;
|
||||||
|
@ -413,9 +424,13 @@ void GenerateItems(
|
||||||
auto newValue = qs(action.vnew_value);
|
auto newValue = qs(action.vnew_value);
|
||||||
auto oldValue = qs(action.vprev_value);
|
auto oldValue = qs(action.vprev_value);
|
||||||
auto text = (channel->isMegagroup()
|
auto text = (channel->isMegagroup()
|
||||||
? (newValue.isEmpty() ? lng_admin_log_removed_link_group : lng_admin_log_changed_link_group)
|
? (newValue.isEmpty()
|
||||||
: (newValue.isEmpty() ? lng_admin_log_removed_link_channel : lng_admin_log_changed_link_channel)
|
? tr::lng_admin_log_removed_link_group
|
||||||
)(lt_from, fromLinkText);
|
: tr::lng_admin_log_changed_link_group)
|
||||||
|
: (newValue.isEmpty()
|
||||||
|
? tr::lng_admin_log_removed_link_channel
|
||||||
|
: tr::lng_admin_log_changed_link_channel)
|
||||||
|
)(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto bodyFlags = Flag::f_entities | Flag::f_from_id;
|
auto bodyFlags = Flag::f_entities | Flag::f_from_id;
|
||||||
|
@ -433,10 +448,20 @@ void GenerateItems(
|
||||||
auto createChangePhoto = [&](const MTPDchannelAdminLogEventActionChangePhoto &action) {
|
auto createChangePhoto = [&](const MTPDchannelAdminLogEventActionChangePhoto &action) {
|
||||||
action.vnew_photo.match([&](const MTPDphoto &data) {
|
action.vnew_photo.match([&](const MTPDphoto &data) {
|
||||||
auto photo = Auth().data().processPhoto(data);
|
auto photo = Auth().data().processPhoto(data);
|
||||||
auto text = (channel->isMegagroup() ? lng_admin_log_changed_photo_group : lng_admin_log_changed_photo_channel)(lt_from, fromLinkText);
|
auto text = (channel->isMegagroup()
|
||||||
|
? tr::lng_admin_log_changed_photo_group
|
||||||
|
: tr::lng_admin_log_changed_photo_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
fromLinkText);
|
||||||
addSimpleServiceMessage(text, photo);
|
addSimpleServiceMessage(text, photo);
|
||||||
}, [&](const MTPDphotoEmpty &data) {
|
}, [&](const MTPDphotoEmpty &data) {
|
||||||
auto text = (channel->isMegagroup() ? lng_admin_log_removed_photo_group : lng_admin_log_removed_photo_channel)(lt_from, fromLinkText);
|
auto text = (channel->isMegagroup()
|
||||||
|
? tr::lng_admin_log_removed_photo_group
|
||||||
|
: tr::lng_admin_log_removed_photo_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -444,25 +469,25 @@ void GenerateItems(
|
||||||
auto createToggleInvites = [&](const MTPDchannelAdminLogEventActionToggleInvites &action) {
|
auto createToggleInvites = [&](const MTPDchannelAdminLogEventActionToggleInvites &action) {
|
||||||
auto enabled = (action.vnew_value.type() == mtpc_boolTrue);
|
auto enabled = (action.vnew_value.type() == mtpc_boolTrue);
|
||||||
auto text = (enabled
|
auto text = (enabled
|
||||||
? lng_admin_log_invites_enabled
|
? tr::lng_admin_log_invites_enabled
|
||||||
: lng_admin_log_invites_disabled);
|
: tr::lng_admin_log_invites_disabled);
|
||||||
addSimpleServiceMessage(text(lt_from, fromLinkText));
|
addSimpleServiceMessage(text(tr::now, lt_from, fromLinkText));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createToggleSignatures = [&](const MTPDchannelAdminLogEventActionToggleSignatures &action) {
|
auto createToggleSignatures = [&](const MTPDchannelAdminLogEventActionToggleSignatures &action) {
|
||||||
auto enabled = (action.vnew_value.type() == mtpc_boolTrue);
|
auto enabled = (action.vnew_value.type() == mtpc_boolTrue);
|
||||||
auto text = (enabled
|
auto text = (enabled
|
||||||
? lng_admin_log_signatures_enabled
|
? tr::lng_admin_log_signatures_enabled
|
||||||
: lng_admin_log_signatures_disabled);
|
: tr::lng_admin_log_signatures_disabled);
|
||||||
addSimpleServiceMessage(text(lt_from, fromLinkText));
|
addSimpleServiceMessage(text(tr::now, lt_from, fromLinkText));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createUpdatePinned = [&](const MTPDchannelAdminLogEventActionUpdatePinned &action) {
|
auto createUpdatePinned = [&](const MTPDchannelAdminLogEventActionUpdatePinned &action) {
|
||||||
if (action.vmessage.type() == mtpc_messageEmpty) {
|
if (action.vmessage.type() == mtpc_messageEmpty) {
|
||||||
auto text = lng_admin_log_unpinned_message(lt_from, fromLinkText);
|
auto text = tr::lng_admin_log_unpinned_message(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
} else {
|
} else {
|
||||||
auto text = lng_admin_log_pinned_message(lt_from, fromLinkText);
|
auto text = tr::lng_admin_log_pinned_message(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto detachExistingItem = false;
|
auto detachExistingItem = false;
|
||||||
|
@ -478,10 +503,14 @@ void GenerateItems(
|
||||||
auto createEditMessage = [&](const MTPDchannelAdminLogEventActionEditMessage &action) {
|
auto createEditMessage = [&](const MTPDchannelAdminLogEventActionEditMessage &action) {
|
||||||
auto newValue = ExtractEditedText(action.vnew_message);
|
auto newValue = ExtractEditedText(action.vnew_message);
|
||||||
auto canHaveCaption = MediaCanHaveCaption(action.vnew_message);
|
auto canHaveCaption = MediaCanHaveCaption(action.vnew_message);
|
||||||
auto text = (canHaveCaption
|
auto text = (!canHaveCaption
|
||||||
? (newValue.text.isEmpty() ? lng_admin_log_removed_caption : lng_admin_log_edited_caption)
|
? tr::lng_admin_log_edited_message
|
||||||
: lng_admin_log_edited_message
|
: newValue.text.isEmpty()
|
||||||
)(lt_from, fromLinkText);
|
? tr::lng_admin_log_removed_caption
|
||||||
|
: tr::lng_admin_log_edited_caption)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto oldValue = ExtractEditedText(action.vprev_message);
|
auto oldValue = ExtractEditedText(action.vprev_message);
|
||||||
|
@ -506,7 +535,7 @@ void GenerateItems(
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createDeleteMessage = [&](const MTPDchannelAdminLogEventActionDeleteMessage &action) {
|
auto createDeleteMessage = [&](const MTPDchannelAdminLogEventActionDeleteMessage &action) {
|
||||||
auto text = lng_admin_log_deleted_message(lt_from, fromLinkText);
|
auto text = tr::lng_admin_log_deleted_message(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto detachExistingItem = false;
|
auto detachExistingItem = false;
|
||||||
|
@ -517,16 +546,16 @@ void GenerateItems(
|
||||||
|
|
||||||
auto createParticipantJoin = [&]() {
|
auto createParticipantJoin = [&]() {
|
||||||
auto text = (channel->isMegagroup()
|
auto text = (channel->isMegagroup()
|
||||||
? lng_admin_log_participant_joined
|
? tr::lng_admin_log_participant_joined
|
||||||
: lng_admin_log_participant_joined_channel);
|
: tr::lng_admin_log_participant_joined_channel);
|
||||||
addSimpleServiceMessage(text(lt_from, fromLinkText));
|
addSimpleServiceMessage(text(tr::now, lt_from, fromLinkText));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createParticipantLeave = [&]() {
|
auto createParticipantLeave = [&]() {
|
||||||
auto text = (channel->isMegagroup()
|
auto text = (channel->isMegagroup()
|
||||||
? lng_admin_log_participant_left
|
? tr::lng_admin_log_participant_left
|
||||||
: lng_admin_log_participant_left_channel);
|
: tr::lng_admin_log_participant_left_channel);
|
||||||
addSimpleServiceMessage(text(lt_from, fromLinkText));
|
addSimpleServiceMessage(text(tr::now, lt_from, fromLinkText));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createParticipantInvite = [&](const MTPDchannelAdminLogEventActionParticipantInvite &action) {
|
auto createParticipantInvite = [&](const MTPDchannelAdminLogEventActionParticipantInvite &action) {
|
||||||
|
@ -557,10 +586,11 @@ void GenerateItems(
|
||||||
auto set = action.vnew_stickerset;
|
auto set = action.vnew_stickerset;
|
||||||
auto removed = (set.type() == mtpc_inputStickerSetEmpty);
|
auto removed = (set.type() == mtpc_inputStickerSetEmpty);
|
||||||
if (removed) {
|
if (removed) {
|
||||||
auto text = lng_admin_log_removed_stickers_group(lt_from, fromLinkText);
|
auto text = tr::lng_admin_log_removed_stickers_group(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
} else {
|
} else {
|
||||||
auto text = lng_admin_log_changed_stickers_group(
|
auto text = tr::lng_admin_log_changed_stickers_group(
|
||||||
|
tr::now,
|
||||||
lt_from,
|
lt_from,
|
||||||
fromLinkText,
|
fromLinkText,
|
||||||
lt_sticker_set,
|
lt_sticker_set,
|
||||||
|
@ -578,9 +608,9 @@ void GenerateItems(
|
||||||
auto createTogglePreHistoryHidden = [&](const MTPDchannelAdminLogEventActionTogglePreHistoryHidden &action) {
|
auto createTogglePreHistoryHidden = [&](const MTPDchannelAdminLogEventActionTogglePreHistoryHidden &action) {
|
||||||
auto hidden = (action.vnew_value.type() == mtpc_boolTrue);
|
auto hidden = (action.vnew_value.type() == mtpc_boolTrue);
|
||||||
auto text = (hidden
|
auto text = (hidden
|
||||||
? lng_admin_log_history_made_hidden
|
? tr::lng_admin_log_history_made_hidden
|
||||||
: lng_admin_log_history_made_visible);
|
: tr::lng_admin_log_history_made_visible);
|
||||||
addSimpleServiceMessage(text(lt_from, fromLinkText));
|
addSimpleServiceMessage(text(tr::now, lt_from, fromLinkText));
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createDefaultBannedRights = [&](const MTPDchannelAdminLogEventActionDefaultBannedRights &action) {
|
auto createDefaultBannedRights = [&](const MTPDchannelAdminLogEventActionDefaultBannedRights &action) {
|
||||||
|
@ -592,7 +622,7 @@ void GenerateItems(
|
||||||
};
|
};
|
||||||
|
|
||||||
auto createStopPoll = [&](const MTPDchannelAdminLogEventActionStopPoll &action) {
|
auto createStopPoll = [&](const MTPDchannelAdminLogEventActionStopPoll &action) {
|
||||||
auto text = lng_admin_log_stopped_poll(lt_from, fromLinkText);
|
auto text = tr::lng_admin_log_stopped_poll(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
|
|
||||||
auto detachExistingItem = false;
|
auto detachExistingItem = false;
|
||||||
|
@ -606,14 +636,22 @@ void GenerateItems(
|
||||||
const auto was = history->owner().channelLoaded(action.vprev_value.v);
|
const auto was = history->owner().channelLoaded(action.vprev_value.v);
|
||||||
const auto now = history->owner().channelLoaded(action.vnew_value.v);
|
const auto now = history->owner().channelLoaded(action.vnew_value.v);
|
||||||
if (!now) {
|
if (!now) {
|
||||||
auto text = (broadcast ? lng_admin_log_removed_linked_chat : lng_admin_log_removed_linked_channel)(lt_from, fromLinkText);
|
auto text = (broadcast
|
||||||
|
? tr::lng_admin_log_removed_linked_chat
|
||||||
|
: tr::lng_admin_log_removed_linked_channel)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
} else {
|
} else {
|
||||||
auto text = (broadcast ? lng_admin_log_changed_linked_chat : lng_admin_log_changed_linked_channel)(
|
auto text = (broadcast
|
||||||
lt_from,
|
? tr::lng_admin_log_changed_linked_chat
|
||||||
fromLinkText,
|
: tr::lng_admin_log_changed_linked_channel)(
|
||||||
lt_chat,
|
tr::now,
|
||||||
textcmdLink(2, now->name));
|
lt_from,
|
||||||
|
fromLinkText,
|
||||||
|
lt_chat,
|
||||||
|
textcmdLink(2, now->name));
|
||||||
auto chatLink = std::make_shared<LambdaClickHandler>([=] {
|
auto chatLink = std::make_shared<LambdaClickHandler>([=] {
|
||||||
Ui::showPeerHistory(now, ShowAtUnreadMsgId);
|
Ui::showPeerHistory(now, ShowAtUnreadMsgId);
|
||||||
});
|
});
|
||||||
|
@ -634,14 +672,15 @@ void GenerateItems(
|
||||||
}, [&](const MTPDgeoPointEmpty &) {
|
}, [&](const MTPDgeoPointEmpty &) {
|
||||||
return address;
|
return address;
|
||||||
});
|
});
|
||||||
const auto text = lng_admin_log_changed_location_chat(
|
const auto text = tr::lng_admin_log_changed_location_chat(
|
||||||
|
tr::now,
|
||||||
lt_from,
|
lt_from,
|
||||||
fromLinkText,
|
fromLinkText,
|
||||||
lt_address,
|
lt_address,
|
||||||
link);
|
link);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
}, [&](const MTPDchannelLocationEmpty &) {
|
}, [&](const MTPDchannelLocationEmpty &) {
|
||||||
const auto text = lng_admin_log_removed_location_chat(lt_from, fromLinkText);
|
const auto text = tr::lng_admin_log_removed_location_chat(tr::now, lt_from, fromLinkText);
|
||||||
addSimpleServiceMessage(text);
|
addSimpleServiceMessage(text);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -479,9 +479,10 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
QString newTypingString;
|
QString newTypingString;
|
||||||
auto typingCount = _typing.size();
|
auto typingCount = _typing.size();
|
||||||
if (typingCount > 2) {
|
if (typingCount > 2) {
|
||||||
newTypingString = lng_many_typing(lt_count, typingCount);
|
newTypingString = tr::lng_many_typing(tr::now, lt_count, typingCount);
|
||||||
} else if (typingCount > 1) {
|
} else if (typingCount > 1) {
|
||||||
newTypingString = lng_users_typing(
|
newTypingString = tr::lng_users_typing(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_typing)->first->firstName,
|
begin(_typing)->first->firstName,
|
||||||
lt_second_user,
|
lt_second_user,
|
||||||
|
@ -489,7 +490,8 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
} else if (typingCount) {
|
} else if (typingCount) {
|
||||||
newTypingString = peer->isUser()
|
newTypingString = peer->isUser()
|
||||||
? tr::lng_typing(tr::now)
|
? tr::lng_typing(tr::now)
|
||||||
: lng_user_typing(
|
: tr::lng_user_typing(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_typing)->first->firstName);
|
begin(_typing)->first->firstName);
|
||||||
} else if (!_sendActions.empty()) {
|
} else if (!_sendActions.empty()) {
|
||||||
|
@ -497,16 +499,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() ? tr::lng_send_action_record_video(tr::now) : lng_user_action_record_video(lt_user, name);
|
case Type::RecordVideo: return name.isEmpty() ? tr::lng_send_action_record_video(tr::now) : tr::lng_user_action_record_video(tr::now, 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::UploadVideo: return name.isEmpty() ? tr::lng_send_action_upload_video(tr::now) : tr::lng_user_action_upload_video(tr::now, 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::RecordVoice: return name.isEmpty() ? tr::lng_send_action_record_audio(tr::now) : tr::lng_user_action_record_audio(tr::now, 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::UploadVoice: return name.isEmpty() ? tr::lng_send_action_upload_audio(tr::now) : tr::lng_user_action_upload_audio(tr::now, 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::RecordRound: return name.isEmpty() ? tr::lng_send_action_record_round(tr::now) : tr::lng_user_action_record_round(tr::now, 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::UploadRound: return name.isEmpty() ? tr::lng_send_action_upload_round(tr::now) : tr::lng_user_action_upload_round(tr::now, 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::UploadPhoto: return name.isEmpty() ? tr::lng_send_action_upload_photo(tr::now) : tr::lng_user_action_upload_photo(tr::now, 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::UploadFile: return name.isEmpty() ? tr::lng_send_action_upload_file(tr::now) : tr::lng_user_action_upload_file(tr::now, lt_user, name);
|
||||||
case Type::ChooseLocation:
|
case Type::ChooseLocation:
|
||||||
case Type::ChooseContact: return name.isEmpty() ? tr::lng_typing(tr::now) : lng_user_typing(lt_user, name);
|
case Type::ChooseContact: return name.isEmpty() ? tr::lng_typing(tr::now) : tr::lng_user_typing(tr::now, lt_user, name);
|
||||||
default: break;
|
default: break;
|
||||||
};
|
};
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -525,11 +527,13 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
if (newTypingString.isEmpty()) {
|
if (newTypingString.isEmpty()) {
|
||||||
int playingCount = _sendActions.size();
|
int playingCount = _sendActions.size();
|
||||||
if (playingCount > 2) {
|
if (playingCount > 2) {
|
||||||
newTypingString = lng_many_playing_game(
|
newTypingString = tr::lng_many_playing_game(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
playingCount);
|
playingCount);
|
||||||
} else if (playingCount > 1) {
|
} else if (playingCount > 1) {
|
||||||
newTypingString = lng_users_playing_game(
|
newTypingString = tr::lng_users_playing_game(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_sendActions)->first->firstName,
|
begin(_sendActions)->first->firstName,
|
||||||
lt_second_user,
|
lt_second_user,
|
||||||
|
@ -537,7 +541,8 @@ bool History::updateSendActionNeedsAnimating(crl::time now, bool force) {
|
||||||
} else {
|
} else {
|
||||||
newTypingString = peer->isUser()
|
newTypingString = peer->isUser()
|
||||||
? tr::lng_playing_game(tr::now)
|
? tr::lng_playing_game(tr::now)
|
||||||
: lng_user_playing_game(
|
: tr::lng_user_playing_game(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
begin(_sendActions)->first->firstName);
|
begin(_sendActions)->first->firstName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3100,21 +3100,24 @@ QString HistoryInner::tooltipText() const {
|
||||||
auto dateText = view->dateTime().toString(
|
auto dateText = view->dateTime().toString(
|
||||||
QLocale::system().dateTimeFormat(QLocale::LongFormat));
|
QLocale::system().dateTimeFormat(QLocale::LongFormat));
|
||||||
if (const auto editedDate = view->displayedEditDate()) {
|
if (const auto editedDate = view->displayedEditDate()) {
|
||||||
dateText += '\n' + lng_edited_date(
|
dateText += '\n' + tr::lng_edited_date(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
ParseDateTime(editedDate).toString(
|
ParseDateTime(editedDate).toString(
|
||||||
QLocale::system().dateTimeFormat(
|
QLocale::system().dateTimeFormat(
|
||||||
QLocale::LongFormat)));
|
QLocale::LongFormat)));
|
||||||
}
|
}
|
||||||
if (const auto forwarded = view->data()->Get<HistoryMessageForwarded>()) {
|
if (const auto forwarded = view->data()->Get<HistoryMessageForwarded>()) {
|
||||||
dateText += '\n' + lng_forwarded_date(
|
dateText += '\n' + tr::lng_forwarded_date(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
ParseDateTime(forwarded->originalDate).toString(
|
ParseDateTime(forwarded->originalDate).toString(
|
||||||
QLocale::system().dateTimeFormat(
|
QLocale::system().dateTimeFormat(
|
||||||
QLocale::LongFormat)));
|
QLocale::LongFormat)));
|
||||||
if (const auto media = view->media()) {
|
if (const auto media = view->media()) {
|
||||||
if (media->hidesForwardedInfo()) {
|
if (media->hidesForwardedInfo()) {
|
||||||
dateText += "\n" + lng_forwarded(
|
dateText += "\n" + tr::lng_forwarded(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
(forwarded->originalSender
|
(forwarded->originalSender
|
||||||
? forwarded->originalSender->shortName()
|
? forwarded->originalSender->shortName()
|
||||||
|
@ -3124,7 +3127,7 @@ QString HistoryInner::tooltipText() const {
|
||||||
}
|
}
|
||||||
if (const auto msgsigned = view->data()->Get<HistoryMessageSigned>()) {
|
if (const auto msgsigned = view->data()->Get<HistoryMessageSigned>()) {
|
||||||
if (msgsigned->isElided) {
|
if (msgsigned->isElided) {
|
||||||
dateText += '\n' + lng_signed_author(lt_user, msgsigned->author);
|
dateText += '\n' + tr::lng_signed_author(tr::now, lt_user, msgsigned->author);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dateText;
|
return dateText;
|
||||||
|
|
|
@ -62,7 +62,7 @@ not_null<HistoryItem*> CreateUnsupportedMessage(
|
||||||
UserId from) {
|
UserId from) {
|
||||||
const auto siteLink = qsl("https://desktop.telegram.org");
|
const auto siteLink = qsl("https://desktop.telegram.org");
|
||||||
auto text = TextWithEntities{
|
auto text = TextWithEntities{
|
||||||
lng_message_unsupported(lt_link, siteLink)
|
tr::lng_message_unsupported(tr::now, lt_link, siteLink)
|
||||||
};
|
};
|
||||||
TextUtilities::ParseEntities(text, Ui::ItemTextNoMonoOptions().flags);
|
TextUtilities::ParseEntities(text, Ui::ItemTextNoMonoOptions().flags);
|
||||||
text.entities.push_front(
|
text.entities.push_front(
|
||||||
|
@ -748,8 +748,8 @@ QString HistoryItem::inDialogsText(DrawInDialog way) const {
|
||||||
}();
|
}();
|
||||||
if (sender) {
|
if (sender) {
|
||||||
auto fromText = sender->isSelf() ? tr::lng_from_you(tr::now) : 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, tr::lng_dialogs_text_from_wrapped(tr::now, lt_from, TextUtilities::Clean(fromText)));
|
||||||
return lng_dialogs_text_with_from(lt_from_part, fromWrapped, lt_message, plainText);
|
return tr::lng_dialogs_text_with_from(tr::now, lt_from_part, fromWrapped, lt_message, plainText);
|
||||||
}
|
}
|
||||||
return plainText;
|
return plainText;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
void HistoryMessageVia::create(UserId userId) {
|
void HistoryMessageVia::create(UserId userId) {
|
||||||
bot = Auth().data().user(userId);
|
bot = Auth().data().user(userId);
|
||||||
maxWidth = st::msgServiceNameFont->width(
|
maxWidth = st::msgServiceNameFont->width(
|
||||||
lng_inline_bot_via(lt_inline_bot, '@' + bot->username));
|
tr::lng_inline_bot_via(tr::now, lt_inline_bot, '@' + bot->username));
|
||||||
link = std::make_shared<LambdaClickHandler>([bot = this->bot] {
|
link = std::make_shared<LambdaClickHandler>([bot = this->bot] {
|
||||||
App::insertBotCommand('@' + bot->username);
|
App::insertBotCommand('@' + bot->username);
|
||||||
});
|
});
|
||||||
|
@ -40,7 +40,7 @@ void HistoryMessageVia::resize(int32 availw) const {
|
||||||
text = QString();
|
text = QString();
|
||||||
width = 0;
|
width = 0;
|
||||||
} else {
|
} else {
|
||||||
text = lng_inline_bot_via(lt_inline_bot, '@' + bot->username);
|
text = tr::lng_inline_bot_via(tr::now, lt_inline_bot, '@' + bot->username);
|
||||||
if (availw < maxWidth) {
|
if (availw < maxWidth) {
|
||||||
text = st::msgServiceNameFont->elided(text, availw);
|
text = st::msgServiceNameFont->elided(text, availw);
|
||||||
width = st::msgServiceNameFont->width(text);
|
width = st::msgServiceNameFont->width(text);
|
||||||
|
@ -102,7 +102,8 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
? App::peerName(originalSender)
|
? App::peerName(originalSender)
|
||||||
: hiddenSenderInfo->name;
|
: hiddenSenderInfo->name;
|
||||||
if (!originalAuthor.isEmpty()) {
|
if (!originalAuthor.isEmpty()) {
|
||||||
phrase = lng_forwarded_signed(
|
phrase = tr::lng_forwarded_signed(
|
||||||
|
tr::now,
|
||||||
lt_channel,
|
lt_channel,
|
||||||
name,
|
name,
|
||||||
lt_user,
|
lt_user,
|
||||||
|
@ -112,13 +113,15 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
}
|
}
|
||||||
if (via) {
|
if (via) {
|
||||||
if (fromChannel) {
|
if (fromChannel) {
|
||||||
phrase = lng_forwarded_channel_via(
|
phrase = tr::lng_forwarded_channel_via(
|
||||||
|
tr::now,
|
||||||
lt_channel,
|
lt_channel,
|
||||||
textcmdLink(1, phrase),
|
textcmdLink(1, phrase),
|
||||||
lt_inline_bot,
|
lt_inline_bot,
|
||||||
textcmdLink(2, '@' + via->bot->username));
|
textcmdLink(2, '@' + via->bot->username));
|
||||||
} else {
|
} else {
|
||||||
phrase = lng_forwarded_via(
|
phrase = tr::lng_forwarded_via(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
textcmdLink(1, phrase),
|
textcmdLink(1, phrase),
|
||||||
lt_inline_bot,
|
lt_inline_bot,
|
||||||
|
@ -126,11 +129,13 @@ void HistoryMessageForwarded::create(const HistoryMessageVia *via) const {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (fromChannel) {
|
if (fromChannel) {
|
||||||
phrase = lng_forwarded_channel(
|
phrase = tr::lng_forwarded_channel(
|
||||||
|
tr::now,
|
||||||
lt_channel,
|
lt_channel,
|
||||||
textcmdLink(1, phrase));
|
textcmdLink(1, phrase));
|
||||||
} else {
|
} else {
|
||||||
phrase = lng_forwarded(
|
phrase = tr::lng_forwarded(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
textcmdLink(1, phrase));
|
textcmdLink(1, phrase));
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,15 +42,15 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto u = history()->owner().user(users[0].v);
|
auto u = history()->owner().user(users[0].v);
|
||||||
if (u == _from) {
|
if (u == _from) {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_user_joined(lt_from, fromLinkText());
|
result.text = tr::lng_action_user_joined(tr::now, lt_from, fromLinkText());
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.links.push_back(u->createOpenLink());
|
result.links.push_back(u->createOpenLink());
|
||||||
result.text = lng_action_add_user(lt_from, fromLinkText(), lt_user, textcmdLink(2, u->name));
|
result.text = tr::lng_action_add_user(tr::now, lt_from, fromLinkText(), lt_user, textcmdLink(2, u->name));
|
||||||
}
|
}
|
||||||
} else if (users.isEmpty()) {
|
} else if (users.isEmpty()) {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_add_user(lt_from, fromLinkText(), lt_user, "somebody");
|
result.text = tr::lng_action_add_user(tr::now, lt_from, fromLinkText(), lt_user, qsl("somebody"));
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
for (auto i = 0, l = users.size(); i != l; ++i) {
|
for (auto i = 0, l = users.size(); i != l; ++i) {
|
||||||
|
@ -61,12 +61,12 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
result.text = linkText;
|
result.text = linkText;
|
||||||
} else if (i + 1 == l) {
|
} else if (i + 1 == l) {
|
||||||
result.text = lng_action_add_users_and_last(lt_accumulated, result.text, lt_user, linkText);
|
result.text = tr::lng_action_add_users_and_last(tr::now, lt_accumulated, result.text, lt_user, linkText);
|
||||||
} else {
|
} else {
|
||||||
result.text = lng_action_add_users_and_one(lt_accumulated, result.text, lt_user, linkText);
|
result.text = tr::lng_action_add_users_and_one(tr::now, lt_accumulated, result.text, lt_user, linkText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.text = lng_action_add_users_many(lt_from, fromLinkText(), lt_users, result.text);
|
result.text = tr::lng_action_add_users_many(tr::now, lt_from, fromLinkText(), lt_users, result.text);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -74,14 +74,14 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareChatJoinedByLink = [this](const MTPDmessageActionChatJoinedByLink &action) {
|
auto prepareChatJoinedByLink = [this](const MTPDmessageActionChatJoinedByLink &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_user_joined_by_link(lt_from, fromLinkText());
|
result.text = tr::lng_action_user_joined_by_link(tr::now, lt_from, fromLinkText());
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto prepareChatCreate = [this](const MTPDmessageActionChatCreate &action) {
|
auto prepareChatCreate = [this](const MTPDmessageActionChatCreate &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
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 = tr::lng_action_created_chat(tr::now, lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
result.text = tr::lng_action_created_channel(tr::now);
|
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 = tr::lng_action_created_chat(tr::now, lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -102,7 +102,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
result.text = tr::lng_action_removed_photo_channel(tr::now);
|
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 = tr::lng_action_removed_photo(tr::now, lt_from, fromLinkText());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -111,12 +111,12 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
if (peerFromUser(action.vuser_id) == _from->id) {
|
if (peerFromUser(action.vuser_id) == _from->id) {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_user_left(lt_from, fromLinkText());
|
result.text = tr::lng_action_user_left(tr::now, lt_from, fromLinkText());
|
||||||
} else {
|
} else {
|
||||||
auto user = history()->owner().user(action.vuser_id.v);
|
auto user = history()->owner().user(action.vuser_id.v);
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.links.push_back(user->createOpenLink());
|
result.links.push_back(user->createOpenLink());
|
||||||
result.text = lng_action_kick_user(lt_from, fromLinkText(), lt_user, textcmdLink(2, user->name));
|
result.text = tr::lng_action_kick_user(tr::now, lt_from, fromLinkText(), lt_user, textcmdLink(2, user->name));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -127,7 +127,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
result.text = tr::lng_action_changed_photo_channel(tr::now);
|
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 = tr::lng_action_changed_photo(tr::now, lt_from, fromLinkText());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -135,10 +135,10 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareChatEditTitle = [this](const MTPDmessageActionChatEditTitle &action) {
|
auto prepareChatEditTitle = [this](const MTPDmessageActionChatEditTitle &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
if (isPost()) {
|
if (isPost()) {
|
||||||
result.text = lng_action_changed_title_channel(lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
result.text = tr::lng_action_changed_title_channel(tr::now, lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
||||||
} else {
|
} else {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_changed_title(lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
result.text = tr::lng_action_changed_title(tr::now, lt_from, fromLinkText(), lt_title, TextUtilities::Clean(qs(action.vtitle)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -149,7 +149,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
result.text = tr::lng_action_you_took_screenshot(tr::now);
|
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 = tr::lng_action_took_screenshot(tr::now, lt_from, fromLinkText());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
@ -163,7 +163,8 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareBotAllowed = [&](const MTPDmessageActionBotAllowed &action) {
|
auto prepareBotAllowed = [&](const MTPDmessageActionBotAllowed &action) {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
const auto domain = qs(action.vdomain);
|
const auto domain = qs(action.vdomain);
|
||||||
result.text = lng_action_bot_allowed_from_domain(
|
result.text = tr::lng_action_bot_allowed_from_domain(
|
||||||
|
tr::now,
|
||||||
lt_domain,
|
lt_domain,
|
||||||
textcmdLink(qstr("http://") + domain, domain));
|
textcmdLink(qstr("http://") + domain, domain));
|
||||||
return result;
|
return result;
|
||||||
|
@ -199,7 +200,8 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
}());
|
}());
|
||||||
};
|
};
|
||||||
result.links.push_back(history()->peer->createOpenLink());
|
result.links.push_back(history()->peer->createOpenLink());
|
||||||
result.text = lng_action_secure_values_sent(
|
result.text = tr::lng_action_secure_values_sent(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
textcmdLink(1, App::peerName(history()->peer)),
|
textcmdLink(1, App::peerName(history()->peer)),
|
||||||
lt_documents,
|
lt_documents,
|
||||||
|
@ -210,7 +212,7 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
||||||
auto prepareContactSignUp = [this] {
|
auto prepareContactSignUp = [this] {
|
||||||
auto result = PreparedText{};
|
auto result = PreparedText{};
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_action_user_registered(lt_from, fromLinkText());
|
result.text = tr::lng_action_user_registered(tr::now, lt_from, fromLinkText());
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -386,17 +388,17 @@ HistoryService::PreparedText HistoryService::preparePinnedText() {
|
||||||
if (!limit && cutAt + 5 < size) {
|
if (!limit && cutAt + 5 < size) {
|
||||||
original = original.mid(0, cutAt) + qstr("...");
|
original = original.mid(0, cutAt) + qstr("...");
|
||||||
}
|
}
|
||||||
result.text = lng_action_pinned_message(lt_from, fromLinkText(), lt_text, textcmdLink(2, original));
|
result.text = tr::lng_action_pinned_message(tr::now, lt_from, fromLinkText(), lt_text, textcmdLink(2, original));
|
||||||
} else {
|
} else {
|
||||||
result.text = lng_action_pinned_media(lt_from, fromLinkText(), lt_media, textcmdLink(2, mediaText));
|
result.text = tr::lng_action_pinned_media(tr::now, lt_from, fromLinkText(), lt_media, textcmdLink(2, mediaText));
|
||||||
}
|
}
|
||||||
} 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, tr::lng_contacts_loading(tr::now)));
|
result.text = tr::lng_action_pinned_media(tr::now, 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, tr::lng_deleted_message(tr::now));
|
result.text = tr::lng_action_pinned_media(tr::now, lt_from, fromLinkText(), lt_media, tr::lng_deleted_message(tr::now));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -431,11 +433,13 @@ HistoryService::PreparedText HistoryService::prepareGameScoreText() {
|
||||||
if (_from->isSelf()) {
|
if (_from->isSelf()) {
|
||||||
auto gameTitle = computeGameTitle();
|
auto gameTitle = computeGameTitle();
|
||||||
if (gameTitle.isEmpty()) {
|
if (gameTitle.isEmpty()) {
|
||||||
result.text = lng_action_game_you_scored_no_game(
|
result.text = tr::lng_action_game_you_scored_no_game(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
scoreNumber);
|
scoreNumber);
|
||||||
} else {
|
} else {
|
||||||
result.text = lng_action_game_you_scored(
|
result.text = tr::lng_action_game_you_scored(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
scoreNumber,
|
scoreNumber,
|
||||||
lt_game,
|
lt_game,
|
||||||
|
@ -445,13 +449,15 @@ HistoryService::PreparedText HistoryService::prepareGameScoreText() {
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
auto gameTitle = computeGameTitle();
|
auto gameTitle = computeGameTitle();
|
||||||
if (gameTitle.isEmpty()) {
|
if (gameTitle.isEmpty()) {
|
||||||
result.text = lng_action_game_score_no_game(
|
result.text = tr::lng_action_game_score_no_game(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
scoreNumber,
|
scoreNumber,
|
||||||
lt_from,
|
lt_from,
|
||||||
fromLinkText());
|
fromLinkText());
|
||||||
} else {
|
} else {
|
||||||
result.text = lng_action_game_score(
|
result.text = tr::lng_action_game_score(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
scoreNumber,
|
scoreNumber,
|
||||||
lt_from,
|
lt_from,
|
||||||
|
@ -482,9 +488,9 @@ HistoryService::PreparedText HistoryService::preparePaymentSentText() {
|
||||||
}();
|
}();
|
||||||
|
|
||||||
if (invoiceTitle.isEmpty()) {
|
if (invoiceTitle.isEmpty()) {
|
||||||
result.text = lng_action_payment_done(lt_amount, payment->amount, lt_user, history()->peer->name);
|
result.text = tr::lng_action_payment_done(tr::now, lt_amount, payment->amount, lt_user, history()->peer->name);
|
||||||
} else {
|
} else {
|
||||||
result.text = lng_action_payment_done_for(lt_amount, payment->amount, lt_user, history()->peer->name, lt_invoice, invoiceTitle);
|
result.text = tr::lng_action_payment_done_for(tr::now, lt_amount, payment->amount, lt_user, history()->peer->name, lt_invoice, invoiceTitle);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -619,7 +625,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
} else {
|
} else {
|
||||||
auto result = PreparedText();
|
auto result = PreparedText();
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_ttl_photo_received(lt_from, fromLinkText());
|
result.text = tr::lng_ttl_photo_received(tr::now, lt_from, fromLinkText());
|
||||||
setServiceText(std::move(result));
|
setServiceText(std::move(result));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -636,7 +642,7 @@ void HistoryService::createFromMtp(const MTPDmessage &message) {
|
||||||
} else {
|
} else {
|
||||||
auto result = PreparedText();
|
auto result = PreparedText();
|
||||||
result.links.push_back(fromLink());
|
result.links.push_back(fromLink());
|
||||||
result.text = lng_ttl_video_received(lt_from, fromLinkText());
|
result.text = tr::lng_ttl_video_received(tr::now, lt_from, fromLinkText());
|
||||||
setServiceText(std::move(result));
|
setServiceText(std::move(result));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -755,14 +761,18 @@ HistoryService::PreparedText GenerateJoinedText(
|
||||||
auto result = HistoryService::PreparedText{};
|
auto result = HistoryService::PreparedText{};
|
||||||
result.links.push_back(inviter->createOpenLink());
|
result.links.push_back(inviter->createOpenLink());
|
||||||
result.text = (history->isMegagroup()
|
result.text = (history->isMegagroup()
|
||||||
? lng_action_add_you_group
|
? tr::lng_action_add_you_group
|
||||||
: lng_action_add_you)(lt_from, textcmdLink(1, inviter->name));
|
: tr::lng_action_add_you)(
|
||||||
|
tr::now,
|
||||||
|
lt_from,
|
||||||
|
textcmdLink(1, inviter->name));
|
||||||
return result;
|
return result;
|
||||||
} else if (history->isMegagroup()) {
|
} else if (history->isMegagroup()) {
|
||||||
auto self = history->session().user();
|
auto self = history->session().user();
|
||||||
auto result = HistoryService::PreparedText{};
|
auto result = HistoryService::PreparedText{};
|
||||||
result.links.push_back(self->createOpenLink());
|
result.links.push_back(self->createOpenLink());
|
||||||
result.text = lng_action_user_joined(
|
result.text = tr::lng_action_user_joined(
|
||||||
|
tr::now,
|
||||||
lt_from,
|
lt_from,
|
||||||
textcmdLink(1, self->name));
|
textcmdLink(1, self->name));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -3936,10 +3936,12 @@ bool HistoryWidget::showSendingFilesError(
|
||||||
case Error::None: return QString();
|
case Error::None: return QString();
|
||||||
case Error::EmptyFile:
|
case Error::EmptyFile:
|
||||||
case Error::Directory:
|
case Error::Directory:
|
||||||
case Error::NonLocalUrl: return lng_send_image_empty(
|
case Error::NonLocalUrl: return tr::lng_send_image_empty(
|
||||||
|
tr::now,
|
||||||
lt_name,
|
lt_name,
|
||||||
list.errorData);
|
list.errorData);
|
||||||
case Error::TooLargeFile: return lng_send_image_too_large(
|
case Error::TooLargeFile: return tr::lng_send_image_too_large(
|
||||||
|
tr::now,
|
||||||
lt_name,
|
lt_name,
|
||||||
list.errorData);
|
list.errorData);
|
||||||
}
|
}
|
||||||
|
@ -6252,17 +6254,17 @@ void HistoryWidget::updateForwardingTexts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (names.size() > 2) {
|
if (names.size() > 2) {
|
||||||
from = lng_forwarding_from(lt_count, names.size() - 1, lt_user, names[0]);
|
from = tr::lng_forwarding_from(tr::now, lt_count, names.size() - 1, lt_user, names[0]);
|
||||||
} else if (names.size() < 2) {
|
} else if (names.size() < 2) {
|
||||||
from = fullname;
|
from = fullname;
|
||||||
} else {
|
} else {
|
||||||
from = lng_forwarding_from_two(lt_user, names[0], lt_second_user, names[1]);
|
from = tr::lng_forwarding_from_two(tr::now, lt_user, names[0], lt_second_user, names[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count < 2) {
|
if (count < 2) {
|
||||||
text = _toForward.front()->inReplyText();
|
text = _toForward.front()->inReplyText();
|
||||||
} else {
|
} else {
|
||||||
text = textcmdLink(1, lng_forward_messages(lt_count, count));
|
text = textcmdLink(1, tr::lng_forward_messages(tr::now, lt_count, count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_toForwardFrom.setText(st::msgNameStyle, from, Ui::NameTextOptions());
|
_toForwardFrom.setText(st::msgNameStyle, from, Ui::NameTextOptions());
|
||||||
|
|
|
@ -36,7 +36,8 @@ HistoryCall::HistoryCall(
|
||||||
if (_duration) {
|
if (_duration) {
|
||||||
if (_reason != FinishReason::Missed
|
if (_reason != FinishReason::Missed
|
||||||
&& _reason != FinishReason::Busy) {
|
&& _reason != FinishReason::Busy) {
|
||||||
_status = lng_call_duration_info(
|
_status = tr::lng_call_duration_info(
|
||||||
|
tr::now,
|
||||||
lt_time,
|
lt_time,
|
||||||
_status,
|
_status,
|
||||||
lt_duration,
|
lt_duration,
|
||||||
|
|
|
@ -73,7 +73,7 @@ HistoryContact::HistoryContact(
|
||||||
|
|
||||||
_name.setText(
|
_name.setText(
|
||||||
st::semiboldTextStyle,
|
st::semiboldTextStyle,
|
||||||
lng_full_name(lt_first_name, first, lt_last_name, last).trimmed(),
|
tr::lng_full_name(tr::now, lt_first_name, first, lt_last_name, last).trimmed(),
|
||||||
Ui::NameTextOptions());
|
Ui::NameTextOptions());
|
||||||
_phonew = st::normalFont->width(_phone);
|
_phonew = st::normalFont->width(_phone);
|
||||||
}
|
}
|
||||||
|
|
|
@ -810,7 +810,7 @@ TextState HistoryPoll::textState(QPoint point, StateRequest request) const {
|
||||||
using Flag = Ui::Text::StateRequest::Flag;
|
using Flag = Ui::Text::StateRequest::Flag;
|
||||||
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)
|
? tr::lng_polls_votes_count(tr::now, lt_count_decimal, answer.votes)
|
||||||
: tr::lng_polls_votes_none(tr::now);
|
: tr::lng_polls_votes_none(tr::now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ void ContactStatus::Bar::showState(State state) {
|
||||||
_share->setVisible(state == State::SharePhoneNumber);
|
_share->setVisible(state == State::SharePhoneNumber);
|
||||||
_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()
|
? tr::lng_new_contact_add_name(tr::now, lt_user, _name).toUpper()
|
||||||
: tr::lng_new_contact_add(tr::now).toUpper());
|
: tr::lng_new_contact_add(tr::now).toUpper());
|
||||||
updateButtonsGeometry();
|
updateButtonsGeometry();
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ void ContactStatus::setupShareHandler(not_null<UserData*> user) {
|
||||||
user->session().api().applyUpdates(result);
|
user->session().api().applyUpdates(result);
|
||||||
|
|
||||||
Ui::Toast::Show(
|
Ui::Toast::Show(
|
||||||
lng_new_contact_share_done(lt_user, user->shortName()));
|
tr::lng_new_contact_share_done(tr::now, lt_user, user->shortName()));
|
||||||
}).send();
|
}).send();
|
||||||
}, _bar.lifetime());
|
}, _bar.lifetime());
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ void UnreadBar::init(int newCount) {
|
||||||
count = newCount;
|
count = newCount;
|
||||||
text = /*(count == kCountUnknown) // #feed
|
text = /*(count == kCountUnknown) // #feed
|
||||||
? tr::lng_unread_bar_some(tr::now)
|
? tr::lng_unread_bar_some(tr::now)
|
||||||
: */lng_unread_bar(lt_count, count);
|
: */tr::lng_unread_bar(tr::now, lt_count, count);
|
||||||
width = st::semiboldFont->width(text);
|
width = st::semiboldFont->width(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -771,7 +771,7 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
} else if (chat->count <= 0) {
|
} else if (chat->count <= 0) {
|
||||||
text = tr::lng_group_status(tr::now);
|
text = tr::lng_group_status(tr::now);
|
||||||
} else {
|
} else {
|
||||||
text = lng_chat_status_members(lt_count_decimal, chat->count);
|
text = tr::lng_chat_status_members(tr::now, lt_count_decimal, chat->count);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto self = Auth().user();
|
const auto self = Auth().user();
|
||||||
|
@ -784,11 +784,11 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (online > 0 && !onlyMe) {
|
if (online > 0 && !onlyMe) {
|
||||||
auto membersCount = lng_chat_status_members(lt_count_decimal, chat->participants.size());
|
auto membersCount = tr::lng_chat_status_members(tr::now, lt_count_decimal, chat->participants.size());
|
||||||
auto onlineCount = lng_chat_status_online(lt_count, online);
|
auto onlineCount = tr::lng_chat_status_online(tr::now, lt_count, online);
|
||||||
text = lng_chat_status_members_online(lt_members_count, membersCount, lt_online_count, onlineCount);
|
text = tr::lng_chat_status_members_online(tr::now, lt_members_count, membersCount, lt_online_count, onlineCount);
|
||||||
} else if (chat->participants.size() > 0) {
|
} else if (chat->participants.size() > 0) {
|
||||||
text = lng_chat_status_members(lt_count_decimal, chat->participants.size());
|
text = tr::lng_chat_status_members(tr::now, lt_count_decimal, chat->participants.size());
|
||||||
} else {
|
} else {
|
||||||
text = tr::lng_group_status(tr::now);
|
text = tr::lng_group_status(tr::now);
|
||||||
}
|
}
|
||||||
|
@ -810,16 +810,16 @@ void TopBarWidget::updateOnlineDisplay() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (online && !onlyMe) {
|
if (online && !onlyMe) {
|
||||||
auto membersCount = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
auto membersCount = tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount());
|
||||||
auto onlineCount = lng_chat_status_online(lt_count, online);
|
auto onlineCount = tr::lng_chat_status_online(tr::now, lt_count, online);
|
||||||
text = lng_chat_status_members_online(lt_members_count, membersCount, lt_online_count, onlineCount);
|
text = tr::lng_chat_status_members_online(tr::now, lt_members_count, membersCount, lt_online_count, onlineCount);
|
||||||
} else if (channel->membersCount() > 0) {
|
} else if (channel->membersCount() > 0) {
|
||||||
text = lng_chat_status_members(lt_count_decimal, channel->membersCount());
|
text = tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount());
|
||||||
} else {
|
} else {
|
||||||
text = tr::lng_group_status(tr::now);
|
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 = tr::lng_chat_status_members(tr::now, lt_count_decimal, channel->membersCount());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now);
|
text = channel->isMegagroup() ? tr::lng_group_status(tr::now) : tr::lng_channel_status(tr::now);
|
||||||
|
|
|
@ -27,21 +27,21 @@ namespace Media {
|
||||||
|
|
||||||
using Type = Storage::SharedMediaType;
|
using Type = Storage::SharedMediaType;
|
||||||
|
|
||||||
inline auto MediaTextPhrase(Type type) {
|
inline tr::phrase<lngtag_count> MediaTextPhrase(Type type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Photo: return lng_profile_photos;
|
case Type::Photo: return tr::lng_profile_photos;
|
||||||
case Type::Video: return lng_profile_videos;
|
case Type::Video: return tr::lng_profile_videos;
|
||||||
case Type::File: return lng_profile_files;
|
case Type::File: return tr::lng_profile_files;
|
||||||
case Type::MusicFile: return lng_profile_songs;
|
case Type::MusicFile: return tr::lng_profile_songs;
|
||||||
case Type::Link: return lng_profile_shared_links;
|
case Type::Link: return tr::lng_profile_shared_links;
|
||||||
case Type::RoundVoiceFile: return lng_profile_audios;
|
case Type::RoundVoiceFile: return tr::lng_profile_audios;
|
||||||
}
|
}
|
||||||
Unexpected("Type in MediaTextPhrase()");
|
Unexpected("Type in MediaTextPhrase()");
|
||||||
};
|
};
|
||||||
|
|
||||||
inline auto MediaText(Type type) {
|
inline auto MediaText(Type type) {
|
||||||
return [phrase = MediaTextPhrase(type)](int count) {
|
return [phrase = MediaTextPhrase(type)](int count) {
|
||||||
return phrase(lt_count, count);
|
return phrase(tr::now, lt_count, count);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ inline auto AddCommonGroupsButton(
|
||||||
parent,
|
parent,
|
||||||
Profile::CommonGroupsCountValue(user),
|
Profile::CommonGroupsCountValue(user),
|
||||||
[](int count) {
|
[](int count) {
|
||||||
return lng_profile_common_groups(lt_count, count);
|
return tr::lng_profile_common_groups(tr::now, lt_count, count);
|
||||||
},
|
},
|
||||||
tracker)->entity();
|
tracker)->entity();
|
||||||
result->addClickHandler([=] {
|
result->addClickHandler([=] {
|
||||||
|
|
|
@ -812,12 +812,10 @@ object_ptr<Ui::RpWidget> SetupChannelMembers(
|
||||||
channel,
|
channel,
|
||||||
MTPDchannelFull::Flag::f_can_view_participants),
|
MTPDchannelFull::Flag::f_can_view_participants),
|
||||||
(_1 > 0) && _2);
|
(_1 > 0) && _2);
|
||||||
auto membersText = MembersCountValue(
|
auto membersText = tr::lng_chat_status_members(
|
||||||
channel
|
lt_count_decimal,
|
||||||
) | rpl::map([](int count) {
|
MembersCountValue(channel) | tr::to_count());
|
||||||
return lng_chat_status_members(lt_count_decimal, count);
|
auto membersCallback = [=] {
|
||||||
});
|
|
||||||
auto membersCallback = [controller, channel] {
|
|
||||||
controller->showSection(Info::Memento(
|
controller->showSection(Info::Memento(
|
||||||
channel->id,
|
channel->id,
|
||||||
Section::Type::Members));
|
Section::Type::Members));
|
||||||
|
|
|
@ -127,11 +127,11 @@ bool SectionToggle::checkRippleStartPosition(QPoint position) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto MembersStatusText(int count) {
|
auto MembersStatusText(int count) {
|
||||||
return lng_chat_status_members(lt_count_decimal, count);
|
return tr::lng_chat_status_members(tr::now, lt_count_decimal, count);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto OnlineStatusText(int count) {
|
auto OnlineStatusText(int count) {
|
||||||
return lng_chat_status_online(lt_count_decimal, count);
|
return tr::lng_chat_status_online(tr::now, lt_count_decimal, count);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto ChatStatusText(int fullCount, int onlineCount, bool isGroup) {
|
auto ChatStatusText(int fullCount, int onlineCount, bool isGroup) {
|
||||||
|
|
|
@ -164,11 +164,11 @@ void Members::setupHeader() {
|
||||||
object_ptr<Ui::FlatLabel> Members::setupTitle() {
|
object_ptr<Ui::FlatLabel> Members::setupTitle() {
|
||||||
auto result = object_ptr<Ui::FlatLabel>(
|
auto result = object_ptr<Ui::FlatLabel>(
|
||||||
_titleWrap,
|
_titleWrap,
|
||||||
MembersCountValue(
|
tr::lng_chat_status_members(
|
||||||
_peer
|
lt_count_decimal,
|
||||||
) | rpl::map([](int count) {
|
MembersCountValue(_peer) | tr::to_count(),
|
||||||
return lng_chat_status_members(lt_count_decimal, count);
|
Ui::Text::Upper
|
||||||
}) | Ui::Text::ToUpper(),
|
),
|
||||||
st::infoBlockHeaderLabel);
|
st::infoBlockHeaderLabel);
|
||||||
result->setAttribute(Qt::WA_TransparentForMouseEvents);
|
result->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -128,13 +128,27 @@ void CodeWidget::updateCallText() {
|
||||||
switch (_callStatus) {
|
switch (_callStatus) {
|
||||||
case Widget::Data::CallStatus::Waiting: {
|
case Widget::Data::CallStatus::Waiting: {
|
||||||
if (_callTimeout >= 3600) {
|
if (_callTimeout >= 3600) {
|
||||||
return lng_code_call(lt_minutes, qsl("%1:%2").arg(_callTimeout / 3600).arg((_callTimeout / 60) % 60, 2, 10, QChar('0')), lt_seconds, qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
return tr::lng_code_call(
|
||||||
|
tr::now,
|
||||||
|
lt_minutes,
|
||||||
|
qsl("%1:%2"
|
||||||
|
).arg(_callTimeout / 3600
|
||||||
|
).arg((_callTimeout / 60) % 60, 2, 10, QChar('0')),
|
||||||
|
lt_seconds,
|
||||||
|
qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||||
} else {
|
} else {
|
||||||
return lng_code_call(lt_minutes, QString::number(_callTimeout / 60), lt_seconds, qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
return tr::lng_code_call(
|
||||||
|
tr::now,
|
||||||
|
lt_minutes,
|
||||||
|
QString::number(_callTimeout / 60),
|
||||||
|
lt_seconds,
|
||||||
|
qsl("%1").arg(_callTimeout % 60, 2, 10, QChar('0')));
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case Widget::Data::CallStatus::Calling: return tr::lng_code_calling(tr::now);
|
case Widget::Data::CallStatus::Calling:
|
||||||
case Widget::Data::CallStatus::Called: return tr::lng_code_called(tr::now);
|
return tr::lng_code_calling(tr::now);
|
||||||
|
case Widget::Data::CallStatus::Called:
|
||||||
|
return tr::lng_code_called(tr::now);
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -52,7 +52,8 @@ PwdCheckWidget::PwdCheckWidget(
|
||||||
if (_hint.isEmpty()) {
|
if (_hint.isEmpty()) {
|
||||||
_pwdHint->hide();
|
_pwdHint->hide();
|
||||||
} else {
|
} else {
|
||||||
_pwdHint->setText(lng_signin_hint(lt_password_hint, _hint));
|
_pwdHint->setText(
|
||||||
|
tr::lng_signin_hint(tr::now, lt_password_hint, _hint));
|
||||||
}
|
}
|
||||||
_codeField->hide();
|
_codeField->hide();
|
||||||
_toPassword->hide();
|
_toPassword->hide();
|
||||||
|
@ -61,10 +62,16 @@ PwdCheckWidget::PwdCheckWidget(
|
||||||
}
|
}
|
||||||
|
|
||||||
void PwdCheckWidget::refreshLang() {
|
void PwdCheckWidget::refreshLang() {
|
||||||
if (_toRecover) _toRecover->setText(tr::lng_signin_recover(tr::now));
|
if (_toRecover) {
|
||||||
if (_toPassword) _toPassword->setText(tr::lng_signin_try_password(tr::now));
|
_toRecover->setText(tr::lng_signin_recover(tr::now));
|
||||||
|
}
|
||||||
|
if (_toPassword) {
|
||||||
|
_toPassword->setText(
|
||||||
|
tr::lng_signin_try_password(tr::now));
|
||||||
|
}
|
||||||
if (!_hint.isEmpty()) {
|
if (!_hint.isEmpty()) {
|
||||||
_pwdHint->setText(lng_signin_hint(lt_password_hint, _hint));
|
_pwdHint->setText(
|
||||||
|
tr::lng_signin_hint(tr::now, lt_password_hint, _hint));
|
||||||
}
|
}
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,22 +373,52 @@ void Widget::resetAccount() {
|
||||||
|
|
||||||
auto type = error.type();
|
auto type = error.type();
|
||||||
if (type.startsWith(qstr("2FA_CONFIRM_WAIT_"))) {
|
if (type.startsWith(qstr("2FA_CONFIRM_WAIT_"))) {
|
||||||
auto seconds = type.mid(qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
const auto seconds = type.mid(qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
||||||
auto days = (seconds + 59) / 86400;
|
const auto days = (seconds + 59) / 86400;
|
||||||
auto hours = ((seconds + 59) % 86400) / 3600;
|
const auto hours = ((seconds + 59) % 86400) / 3600;
|
||||||
auto minutes = ((seconds + 59) % 3600) / 60;
|
const auto minutes = ((seconds + 59) % 3600) / 60;
|
||||||
auto when = lng_signin_reset_minutes(lt_count, minutes);
|
auto when = tr::lng_signin_reset_minutes(
|
||||||
|
tr::now,
|
||||||
|
lt_count,
|
||||||
|
minutes);
|
||||||
if (days > 0) {
|
if (days > 0) {
|
||||||
auto daysCount = lng_signin_reset_days(lt_count, days);
|
const auto daysCount = tr::lng_signin_reset_days(
|
||||||
auto hoursCount = lng_signin_reset_hours(lt_count, hours);
|
tr::now,
|
||||||
when = lng_signin_reset_in_days(lt_days_count, daysCount, lt_hours_count, hoursCount, lt_minutes_count, when);
|
lt_count,
|
||||||
|
days);
|
||||||
|
const auto hoursCount = tr::lng_signin_reset_hours(
|
||||||
|
tr::now,
|
||||||
|
lt_count,
|
||||||
|
hours);
|
||||||
|
when = tr::lng_signin_reset_in_days(
|
||||||
|
tr::now,
|
||||||
|
lt_days_count,
|
||||||
|
daysCount,
|
||||||
|
lt_hours_count,
|
||||||
|
hoursCount,
|
||||||
|
lt_minutes_count,
|
||||||
|
when);
|
||||||
} else if (hours > 0) {
|
} else if (hours > 0) {
|
||||||
auto hoursCount = lng_signin_reset_hours(lt_count, hours);
|
const auto hoursCount = tr::lng_signin_reset_hours(
|
||||||
when = lng_signin_reset_in_hours(lt_hours_count, hoursCount, lt_minutes_count, when);
|
tr::now,
|
||||||
|
lt_count,
|
||||||
|
hours);
|
||||||
|
when = tr::lng_signin_reset_in_hours(
|
||||||
|
tr::now,
|
||||||
|
lt_hours_count,
|
||||||
|
hoursCount,
|
||||||
|
lt_minutes_count,
|
||||||
|
when);
|
||||||
}
|
}
|
||||||
Ui::show(Box<InformBox>(lng_signin_reset_wait(lt_phone_number, App::formatPhone(getData()->phone), lt_when, when)));
|
Ui::show(Box<InformBox>(tr::lng_signin_reset_wait(
|
||||||
|
tr::now,
|
||||||
|
lt_phone_number,
|
||||||
|
App::formatPhone(getData()->phone),
|
||||||
|
lt_when,
|
||||||
|
when)));
|
||||||
} else if (type == qstr("2FA_RECENT_CONFIRM")) {
|
} else if (type == qstr("2FA_RECENT_CONFIRM")) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_signin_reset_cancelled(tr::now)));
|
Ui::show(Box<InformBox>(
|
||||||
|
tr::lng_signin_reset_cancelled(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
getStep()->showError(rpl::single(Lang::Hard::ServerError()));
|
getStep()->showError(rpl::single(Lang::Hard::ServerError()));
|
||||||
|
|
|
@ -12,20 +12,27 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template <typename WithYear, typename WithoutYear>
|
template <typename WithYear, typename WithoutYear>
|
||||||
inline QString langDateMaybeWithYear(QDate date, WithYear withYear, WithoutYear withoutYear) {
|
inline QString langDateMaybeWithYear(
|
||||||
auto month = date.month();
|
QDate date,
|
||||||
|
WithYear withYear,
|
||||||
|
WithoutYear withoutYear) {
|
||||||
|
const auto month = date.month();
|
||||||
if (month <= 0 || month > 12) {
|
if (month <= 0 || month > 12) {
|
||||||
return qsl("MONTH_ERR");
|
return qsl("MONTH_ERR");
|
||||||
};
|
};
|
||||||
auto year = date.year();
|
const auto year = date.year();
|
||||||
auto current = QDate::currentDate();
|
const auto current = QDate::currentDate();
|
||||||
auto currentYear = current.year();
|
const auto currentYear = current.year();
|
||||||
auto currentMonth = current.month();
|
const auto currentMonth = current.month();
|
||||||
if (year != currentYear) {
|
if (year != currentYear) {
|
||||||
auto yearIsMuchGreater = [](int year, int otherYear) {
|
const auto yearIsMuchGreater = [](int year, int otherYear) {
|
||||||
return (year > otherYear + 1);
|
return (year > otherYear + 1);
|
||||||
};
|
};
|
||||||
auto monthIsMuchGreater = [](int year, int month, int otherYear, int otherMonth) {
|
const auto monthIsMuchGreater = [](
|
||||||
|
int year,
|
||||||
|
int month,
|
||||||
|
int otherYear,
|
||||||
|
int otherMonth) {
|
||||||
return (year == otherYear + 1) && (month + 12 > otherMonth + 3);
|
return (year == otherYear + 1) && (month + 12 > otherMonth + 3);
|
||||||
};
|
};
|
||||||
if (false
|
if (false
|
||||||
|
@ -123,23 +130,54 @@ bool langFirstNameGoesSecond() {
|
||||||
QString langDayOfMonth(const QDate &date) {
|
QString langDayOfMonth(const QDate &date) {
|
||||||
auto day = date.day();
|
auto day = date.day();
|
||||||
return langDateMaybeWithYear(date, [&](int month, int year) {
|
return langDateMaybeWithYear(date, [&](int month, int year) {
|
||||||
return lng_month_day_year(lt_month, MonthSmall(month)(tr::now), lt_day, QString::number(day), lt_year, QString::number(year));
|
return tr::lng_month_day_year(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
MonthSmall(month)(tr::now),
|
||||||
|
lt_day,
|
||||||
|
QString::number(day),
|
||||||
|
lt_year,
|
||||||
|
QString::number(year));
|
||||||
}, [day](int month, int year) {
|
}, [day](int month, int year) {
|
||||||
return lng_month_day(lt_month, MonthSmall(month)(tr::now), lt_day, QString::number(day));
|
return tr::lng_month_day(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
MonthSmall(month)(tr::now),
|
||||||
|
lt_day,
|
||||||
|
QString::number(day));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString langDayOfMonthFull(const QDate &date) {
|
QString langDayOfMonthFull(const QDate &date) {
|
||||||
auto day = date.day();
|
auto day = date.day();
|
||||||
return langDateMaybeWithYear(date, [day](int month, int year) {
|
return langDateMaybeWithYear(date, [day](int month, int year) {
|
||||||
return lng_month_day_year(lt_month, MonthDay(month)(tr::now), lt_day, QString::number(day), lt_year, QString::number(year));
|
return tr::lng_month_day_year(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
MonthDay(month)(tr::now),
|
||||||
|
lt_day,
|
||||||
|
QString::number(day),
|
||||||
|
lt_year,
|
||||||
|
QString::number(year));
|
||||||
}, [day](int month, int year) {
|
}, [day](int month, int year) {
|
||||||
return lng_month_day(lt_month, MonthDay(month)(tr::now), lt_day, QString::number(day));
|
return tr::lng_month_day(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
MonthDay(month)(tr::now),
|
||||||
|
lt_day,
|
||||||
|
QString::number(day));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString langMonthOfYear(int month, int year) {
|
QString langMonthOfYear(int month, int year) {
|
||||||
return (month > 0 && month <= 12) ? lng_month_year(lt_month, MonthSmall(month)(tr::now), lt_year, QString::number(year)) : qsl("MONTH_ERR");
|
return (month > 0 && month <= 12)
|
||||||
|
? tr::lng_month_year(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
MonthSmall(month)(tr::now),
|
||||||
|
lt_year,
|
||||||
|
QString::number(year))
|
||||||
|
: qsl("MONTH_ERR");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString langMonth(const QDate &date) {
|
QString langMonth(const QDate &date) {
|
||||||
|
@ -151,7 +189,14 @@ QString langMonth(const QDate &date) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString langMonthOfYearFull(int month, int year) {
|
QString langMonthOfYearFull(int month, int year) {
|
||||||
return (month > 0 && month <= 12) ? lng_month_year(lt_month, Month(month)(tr::now), lt_year, QString::number(year)) : qsl("MONTH_ERR");
|
return (month > 0 && month <= 12)
|
||||||
|
? tr::lng_month_year(
|
||||||
|
tr::now,
|
||||||
|
lt_month,
|
||||||
|
Month(month)(tr::now),
|
||||||
|
lt_year,
|
||||||
|
QString::number(year))
|
||||||
|
: qsl("MONTH_ERR");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString langMonthFull(const QDate &date) {
|
QString langMonthFull(const QDate &date) {
|
||||||
|
|
|
@ -23,11 +23,21 @@ inline QString langDayOfWeek(const QDate &date) {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QString langDateTime(const QDateTime &date) {
|
inline QString langDateTime(const QDateTime &date) {
|
||||||
return lng_mediaview_date_time(lt_date, langDayOfMonth(date.date()), lt_time, date.time().toString(cTimeFormat()));
|
return tr::lng_mediaview_date_time(
|
||||||
|
tr::now,
|
||||||
|
lt_date,
|
||||||
|
langDayOfMonth(date.date()),
|
||||||
|
lt_time,
|
||||||
|
date.time().toString(cTimeFormat()));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QString langDateTimeFull(const QDateTime &date) {
|
inline QString langDateTimeFull(const QDateTime &date) {
|
||||||
return lng_mediaview_date_time(lt_date, langDayOfMonthFull(date.date()), lt_time, date.time().toString(cTimeFormat()));
|
return tr::lng_mediaview_date_time(
|
||||||
|
tr::now,
|
||||||
|
lt_date,
|
||||||
|
langDayOfMonthFull(date.date()),
|
||||||
|
lt_time,
|
||||||
|
date.time().toString(cTimeFormat()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool langFirstNameGoesSecond();
|
bool langFirstNameGoesSecond();
|
||||||
|
|
|
@ -48,7 +48,7 @@ QString formatDownloadText(qint64 ready, qint64 total) {
|
||||||
totalStr = QString::number(total);
|
totalStr = QString::number(total);
|
||||||
mb = qsl("B");
|
mb = qsl("B");
|
||||||
}
|
}
|
||||||
return lng_save_downloaded(lt_ready, readyStr, lt_total, totalStr, lt_mb, mb);
|
return tr::lng_save_downloaded(tr::now, lt_ready, readyStr, lt_total, totalStr, lt_mb, mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString formatDurationText(qint64 duration) {
|
QString formatDurationText(qint64 duration) {
|
||||||
|
@ -59,24 +59,24 @@ QString formatDurationText(qint64 duration) {
|
||||||
QString formatDurationWords(qint64 duration) {
|
QString formatDurationWords(qint64 duration) {
|
||||||
if (duration > 59) {
|
if (duration > 59) {
|
||||||
auto minutes = (duration / 60);
|
auto minutes = (duration / 60);
|
||||||
auto minutesCount = lng_duration_minsec_minutes(lt_count, minutes);
|
auto minutesCount = tr::lng_duration_minsec_minutes(tr::now, lt_count, minutes);
|
||||||
auto seconds = (duration % 60);
|
auto seconds = (duration % 60);
|
||||||
auto secondsCount = lng_duration_minsec_seconds(lt_count, seconds);
|
auto secondsCount = tr::lng_duration_minsec_seconds(tr::now, lt_count, seconds);
|
||||||
return lng_duration_minutes_seconds(lt_minutes_count, minutesCount, lt_seconds_count, secondsCount);
|
return tr::lng_duration_minutes_seconds(tr::now, lt_minutes_count, minutesCount, lt_seconds_count, secondsCount);
|
||||||
}
|
}
|
||||||
return lng_duration_seconds(lt_count, duration);
|
return tr::lng_duration_seconds(tr::now, lt_count, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString formatDurationAndSizeText(qint64 duration, qint64 size) {
|
QString formatDurationAndSizeText(qint64 duration, qint64 size) {
|
||||||
return lng_duration_and_size(lt_duration, formatDurationText(duration), lt_size, formatSizeText(size));
|
return tr::lng_duration_and_size(tr::now, lt_duration, formatDurationText(duration), lt_size, formatSizeText(size));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString formatGifAndSizeText(qint64 size) {
|
QString formatGifAndSizeText(qint64 size) {
|
||||||
return lng_duration_and_size(lt_duration, qsl("GIF"), lt_size, formatSizeText(size));
|
return tr::lng_duration_and_size(tr::now, lt_duration, qsl("GIF"), lt_size, formatSizeText(size));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString formatPlayedText(qint64 played, qint64 duration) {
|
QString formatPlayedText(qint64 played, qint64 duration) {
|
||||||
return lng_duration_played(lt_played, formatDurationText(played), lt_duration, formatDurationText(duration));
|
return tr::lng_duration_played(tr::now, lt_played, formatDurationText(played), lt_duration, formatDurationText(duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 documentColorIndex(DocumentData *document, QString &ext) {
|
int32 documentColorIndex(DocumentData *document, QString &ext) {
|
||||||
|
|
|
@ -920,7 +920,7 @@ bool MainWidget::sendMessageFail(const RPCError &error) {
|
||||||
const auto link = textcmdLink(
|
const auto link = textcmdLink(
|
||||||
Core::App().createInternalLinkFull(qsl("spambot")),
|
Core::App().createInternalLinkFull(qsl("spambot")),
|
||||||
tr::lng_cant_more_info(tr::now));
|
tr::lng_cant_more_info(tr::now));
|
||||||
const auto text = lng_error_public_groups_denied(lt_more_info, link);
|
const auto text = tr::lng_error_public_groups_denied(tr::now, lt_more_info, link);
|
||||||
Ui::show(Box<InformBox>(text));
|
Ui::show(Box<InformBox>(text));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -934,7 +934,7 @@ void MainWidget::cacheBackground() {
|
||||||
auto &bg = Window::Theme::Background()->pixmapForTiled();
|
auto &bg = Window::Theme::Background()->pixmapForTiled();
|
||||||
|
|
||||||
auto result = QImage(_willCacheFor.width() * cIntRetinaFactor(), _willCacheFor.height() * cIntRetinaFactor(), QImage::Format_RGB32);
|
auto result = QImage(_willCacheFor.width() * cIntRetinaFactor(), _willCacheFor.height() * cIntRetinaFactor(), QImage::Format_RGB32);
|
||||||
result.setDevicePixelRatio(cRetinaFactor());
|
result.setDevicePixelRatio(cRetinaFactor());
|
||||||
{
|
{
|
||||||
QPainter p(&result);
|
QPainter p(&result);
|
||||||
auto left = 0;
|
auto left = 0;
|
||||||
|
@ -3353,7 +3353,7 @@ bool MainWidget::usernameResolveFail(QString name, const RPCError &error) {
|
||||||
if (MTP::isDefaultHandledError(error)) return false;
|
if (MTP::isDefaultHandledError(error)) return false;
|
||||||
|
|
||||||
if (error.code() == 400) {
|
if (error.code() == 400) {
|
||||||
Ui::show(Box<InformBox>(lng_username_not_found(lt_user, name)));
|
Ui::show(Box<InformBox>(tr::lng_username_not_found(tr::now, lt_user, name)));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -522,11 +522,18 @@ void Widget::handleSongChange() {
|
||||||
const auto time = parsed.time().toString(cTimeFormat());
|
const auto time = parsed.time().toString(cTimeFormat());
|
||||||
const auto today = QDateTime::currentDateTime().date();
|
const auto today = QDateTime::currentDateTime().date();
|
||||||
if (date == today) {
|
if (date == today) {
|
||||||
return lng_player_message_today(lt_time, time);
|
return tr::lng_player_message_today(
|
||||||
|
tr::now,
|
||||||
|
lt_time,
|
||||||
|
time);
|
||||||
} else if (date.addDays(1) == today) {
|
} else if (date.addDays(1) == today) {
|
||||||
return lng_player_message_yesterday(lt_time, time);
|
return tr::lng_player_message_yesterday(
|
||||||
|
tr::now,
|
||||||
|
lt_time,
|
||||||
|
time);
|
||||||
}
|
}
|
||||||
return lng_player_message_date(
|
return tr::lng_player_message_date(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
langDayOfMonthFull(date),
|
langDayOfMonthFull(date),
|
||||||
lt_time,
|
lt_time,
|
||||||
|
|
|
@ -499,7 +499,7 @@ void OverlayWidget::updateDocSize() {
|
||||||
totalStr = QString::number(total);
|
totalStr = QString::number(total);
|
||||||
mb = qsl("B");
|
mb = qsl("B");
|
||||||
}
|
}
|
||||||
_docSize = lng_media_save_progress(lt_ready, readyStr, lt_total, totalStr, lt_mb, mb);
|
_docSize = tr::lng_media_save_progress(tr::now, lt_ready, readyStr, lt_total, totalStr, lt_mb, mb);
|
||||||
} else {
|
} else {
|
||||||
_docSize = formatSizeText(_doc->size);
|
_docSize = formatSizeText(_doc->size);
|
||||||
}
|
}
|
||||||
|
@ -579,11 +579,11 @@ void OverlayWidget::updateControls() {
|
||||||
return dNow;
|
return dNow;
|
||||||
}();
|
}();
|
||||||
if (d.date() == dNow.date()) {
|
if (d.date() == dNow.date()) {
|
||||||
_dateText = lng_mediaview_today(lt_time, d.time().toString(cTimeFormat()));
|
_dateText = tr::lng_mediaview_today(tr::now, lt_time, d.time().toString(cTimeFormat()));
|
||||||
} else if (d.date().addDays(1) == dNow.date()) {
|
} else if (d.date().addDays(1) == dNow.date()) {
|
||||||
_dateText = lng_mediaview_yesterday(lt_time, d.time().toString(cTimeFormat()));
|
_dateText = tr::lng_mediaview_yesterday(tr::now, lt_time, d.time().toString(cTimeFormat()));
|
||||||
} else {
|
} else {
|
||||||
_dateText = lng_mediaview_date_time(lt_date, d.date().toString(qsl("dd.MM.yy")), lt_time, d.time().toString(cTimeFormat()));
|
_dateText = tr::lng_mediaview_date_time(tr::now, lt_date, d.date().toString(qsl("dd.MM.yy")), lt_time, d.time().toString(cTimeFormat()));
|
||||||
}
|
}
|
||||||
if (!_fromName.isEmpty()) {
|
if (!_fromName.isEmpty()) {
|
||||||
_fromNameLabel.setText(st::mediaviewTextStyle, _fromName, Ui::NameTextOptions());
|
_fromNameLabel.setText(st::mediaviewTextStyle, _fromName, Ui::NameTextOptions());
|
||||||
|
|
|
@ -186,7 +186,8 @@ void PlaybackControls::setLoadingProgress(int ready, int total) {
|
||||||
const auto percent = int(std::round(progress * 100));
|
const auto percent = int(std::round(progress * 100));
|
||||||
if (_loadingPercent != percent) {
|
if (_loadingPercent != percent) {
|
||||||
_loadingPercent = percent;
|
_loadingPercent = percent;
|
||||||
_downloadProgress->setText(lng_mediaview_video_loading(
|
_downloadProgress->setText(tr::lng_mediaview_video_loading(
|
||||||
|
tr::now,
|
||||||
lt_percent,
|
lt_percent,
|
||||||
QString::number(percent) + '%'));
|
QString::number(percent) + '%'));
|
||||||
if (_playbackSlider->width() > _downloadProgress->width()) {
|
if (_playbackSlider->width() > _downloadProgress->width()) {
|
||||||
|
|
|
@ -595,7 +595,8 @@ Voice::Voice(
|
||||||
TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto };
|
TextParseOptions opts = { TextParseRichText, 0, 0, Qt::LayoutDirectionAuto };
|
||||||
_details.setText(
|
_details.setText(
|
||||||
st::defaultTextStyle,
|
st::defaultTextStyle,
|
||||||
lng_date_and_duration(
|
tr::lng_date_and_duration(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
dateText,
|
dateText,
|
||||||
lt_duration,
|
lt_duration,
|
||||||
|
@ -821,9 +822,9 @@ void Voice::updateName() {
|
||||||
auto version = 0;
|
auto version = 0;
|
||||||
if (const auto forwarded = parent()->Get<HistoryMessageForwarded>()) {
|
if (const auto forwarded = parent()->Get<HistoryMessageForwarded>()) {
|
||||||
if (parent()->fromOriginal()->isChannel()) {
|
if (parent()->fromOriginal()->isChannel()) {
|
||||||
_name.setText(st::semiboldTextStyle, lng_forwarded_channel(lt_channel, App::peerName(parent()->fromOriginal())), Ui::NameTextOptions());
|
_name.setText(st::semiboldTextStyle, tr::lng_forwarded_channel(tr::now, lt_channel, App::peerName(parent()->fromOriginal())), Ui::NameTextOptions());
|
||||||
} else {
|
} else {
|
||||||
_name.setText(st::semiboldTextStyle, lng_forwarded(lt_user, App::peerName(parent()->fromOriginal())), Ui::NameTextOptions());
|
_name.setText(st::semiboldTextStyle, tr::lng_forwarded(tr::now, lt_user, App::peerName(parent()->fromOriginal())), Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_name.setText(st::semiboldTextStyle, App::peerName(parent()->from()), Ui::NameTextOptions());
|
_name.setText(st::semiboldTextStyle, App::peerName(parent()->from()), Ui::NameTextOptions());
|
||||||
|
|
|
@ -310,7 +310,8 @@ ScopeRow DocumentsOneOfRow(
|
||||||
const auto type1 = documents.front()->type;
|
const auto type1 = documents.front()->type;
|
||||||
const auto type2 = documents.back()->type;
|
const auto type2 = documents.back()->type;
|
||||||
return {
|
return {
|
||||||
lng_passport_or_title(
|
tr::lng_passport_or_title(
|
||||||
|
tr::now,
|
||||||
lt_document,
|
lt_document,
|
||||||
DocumentName(type1),
|
DocumentName(type1),
|
||||||
lt_second_document,
|
lt_second_document,
|
||||||
|
|
|
@ -44,7 +44,8 @@ ScanInfo CollectScanInfo(const EditFile &file) {
|
||||||
file.fields.downloadOffset,
|
file.fields.downloadOffset,
|
||||||
file.fields.size);
|
file.fields.size);
|
||||||
} else {
|
} else {
|
||||||
return lng_passport_scan_uploaded(
|
return tr::lng_passport_scan_uploaded(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
langDateTimeFull(ParseDateTime(file.fields.date)));
|
langDateTimeFull(ParseDateTime(file.fields.date)));
|
||||||
}
|
}
|
||||||
|
@ -56,7 +57,8 @@ ScanInfo CollectScanInfo(const EditFile &file) {
|
||||||
file.uploadData->offset,
|
file.uploadData->offset,
|
||||||
file.uploadData->bytes.size());
|
file.uploadData->bytes.size());
|
||||||
} else {
|
} else {
|
||||||
return lng_passport_scan_uploaded(
|
return tr::lng_passport_scan_uploaded(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
langDateTimeFull(ParseDateTime(file.fields.date)));
|
langDateTimeFull(ParseDateTime(file.fields.date)));
|
||||||
}
|
}
|
||||||
|
@ -301,7 +303,8 @@ EditDocumentScheme GetDocumentScheme(
|
||||||
const auto language = languageValue(countryCode);
|
const auto language = languageValue(countryCode);
|
||||||
return language.isEmpty()
|
return language.isEmpty()
|
||||||
? tr::lng_passport_native_name_title(tr::now)
|
? tr::lng_passport_native_name_title(tr::now)
|
||||||
: lng_passport_native_name_language(
|
: tr::lng_passport_native_name_language(
|
||||||
|
tr::now,
|
||||||
lt_language,
|
lt_language,
|
||||||
language);
|
language);
|
||||||
};
|
};
|
||||||
|
@ -312,7 +315,8 @@ EditDocumentScheme GetDocumentScheme(
|
||||||
}
|
}
|
||||||
const auto name = CountrySelectBox::NameByISO(countryCode);
|
const auto name = CountrySelectBox::NameByISO(countryCode);
|
||||||
Assert(!name.isEmpty());
|
Assert(!name.isEmpty());
|
||||||
return lng_passport_native_name_about(
|
return tr::lng_passport_native_name_about(
|
||||||
|
tr::now,
|
||||||
lt_country,
|
lt_country,
|
||||||
name);
|
name);
|
||||||
};
|
};
|
||||||
|
|
|
@ -392,7 +392,10 @@ object_ptr<BoxContent> VerifyPhoneBox(
|
||||||
rpl::producer<QString> error) {
|
rpl::producer<QString> error) {
|
||||||
return Box<VerifyBox>(
|
return Box<VerifyBox>(
|
||||||
tr::lng_passport_phone_title(),
|
tr::lng_passport_phone_title(),
|
||||||
lng_passport_confirm_phone(lt_phone, App::formatPhone(phone)),
|
tr::lng_passport_confirm_phone(
|
||||||
|
tr::now,
|
||||||
|
lt_phone,
|
||||||
|
App::formatPhone(phone)),
|
||||||
codeLength,
|
codeLength,
|
||||||
submit,
|
submit,
|
||||||
nullptr,
|
nullptr,
|
||||||
|
@ -410,7 +413,7 @@ object_ptr<BoxContent> VerifyEmailBox(
|
||||||
rpl::producer<QString> resent) {
|
rpl::producer<QString> resent) {
|
||||||
return Box<VerifyBox>(
|
return Box<VerifyBox>(
|
||||||
tr::lng_passport_email_title(),
|
tr::lng_passport_email_title(),
|
||||||
lng_passport_confirm_email(lt_email, email),
|
tr::lng_passport_confirm_email(tr::now, lt_email, email),
|
||||||
codeLength,
|
codeLength,
|
||||||
submit,
|
submit,
|
||||||
resend,
|
resend,
|
||||||
|
|
|
@ -272,7 +272,7 @@ void EditScans::List::pushScan(const ScanInfo &info) {
|
||||||
rows.push_back(CreateScan(
|
rows.push_back(CreateScan(
|
||||||
wrap,
|
wrap,
|
||||||
info,
|
info,
|
||||||
lng_passport_scan_index(lt_index, QString::number(index + 1))));
|
tr::lng_passport_scan_index(tr::now, lt_index, QString::number(index + 1))));
|
||||||
rows.back()->hide(anim::type::instant);
|
rows.back()->hide(anim::type::instant);
|
||||||
|
|
||||||
const auto scan = rows.back()->entity();
|
const auto scan = rows.back()->entity();
|
||||||
|
|
|
@ -232,7 +232,7 @@ not_null<Ui::RpWidget*> PanelForm::setupContent() {
|
||||||
inner,
|
inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
inner,
|
inner,
|
||||||
lng_passport_request1(lt_bot, App::peerName(bot)),
|
tr::lng_passport_request1(tr::now, lt_bot, App::peerName(bot)),
|
||||||
st::passportPasswordLabelBold)),
|
st::passportPasswordLabelBold)),
|
||||||
st::passportFormAbout1Padding)->entity();
|
st::passportFormAbout1Padding)->entity();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,10 @@ PanelAskPassword::PanelAskPassword(
|
||||||
st::passportPasswordUserpic)
|
st::passportPasswordUserpic)
|
||||||
, _about1(
|
, _about1(
|
||||||
this,
|
this,
|
||||||
lng_passport_request1(lt_bot, App::peerName(_controller->bot())),
|
tr::lng_passport_request1(
|
||||||
|
tr::now,
|
||||||
|
lt_bot,
|
||||||
|
App::peerName(_controller->bot())),
|
||||||
st::passportPasswordLabelBold)
|
st::passportPasswordLabelBold)
|
||||||
, _about2(
|
, _about2(
|
||||||
this,
|
this,
|
||||||
|
@ -173,7 +176,8 @@ void PanelNoPassword::setupContent() {
|
||||||
_inner,
|
_inner,
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
_inner,
|
_inner,
|
||||||
lng_passport_request1(
|
tr::lng_passport_request1(
|
||||||
|
tr::now,
|
||||||
lt_bot,
|
lt_bot,
|
||||||
App::peerName(_controller->bot())),
|
App::peerName(_controller->bot())),
|
||||||
st::passportPasswordLabelBold)),
|
st::passportPasswordLabelBold)),
|
||||||
|
@ -221,7 +225,7 @@ void PanelNoPassword::refreshBottom() {
|
||||||
_inner,
|
_inner,
|
||||||
(pattern.isEmpty()
|
(pattern.isEmpty()
|
||||||
? tr::lng_passport_about_password(tr::now)
|
? tr::lng_passport_about_password(tr::now)
|
||||||
: lng_passport_code_sent(lt_email, pattern)),
|
: tr::lng_passport_code_sent(tr::now, lt_email, pattern)),
|
||||||
st::passportPasswordSetupLabel)),
|
st::passportPasswordSetupLabel)),
|
||||||
st::passportFormAbout2Padding)->entity());
|
st::passportFormAbout2Padding)->entity());
|
||||||
if (pattern.isEmpty()) {
|
if (pattern.isEmpty()) {
|
||||||
|
|
|
@ -469,7 +469,7 @@ bool UnsafeShowOpenWith(const QString &filepath) {
|
||||||
[button setHidden:YES];
|
[button setHidden:YES];
|
||||||
#endif // OS_MAC_STORE
|
#endif // OS_MAC_STORE
|
||||||
NSTextField *goodLabel = [[NSTextField alloc] init];
|
NSTextField *goodLabel = [[NSTextField alloc] init];
|
||||||
[goodLabel setStringValue:Q2NSString(lng_mac_this_app_can_open(lt_file, NS2QString(name)))];
|
[goodLabel setStringValue:Q2NSString(tr::lng_mac_this_app_can_open(tr::now, lt_file, NS2QString(name)))];
|
||||||
[goodLabel setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
|
[goodLabel setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
|
||||||
[goodLabel setBezeled:NO];
|
[goodLabel setBezeled:NO];
|
||||||
[goodLabel setDrawsBackground:NO];
|
[goodLabel setDrawsBackground:NO];
|
||||||
|
@ -482,7 +482,7 @@ bool UnsafeShowOpenWith(const QString &filepath) {
|
||||||
[goodLabel setFrame:goodFrame];
|
[goodLabel setFrame:goodFrame];
|
||||||
|
|
||||||
NSTextField *badLabel = [[NSTextField alloc] init];
|
NSTextField *badLabel = [[NSTextField alloc] init];
|
||||||
[badLabel setStringValue:Q2NSString(lng_mac_not_known_app(lt_file, NS2QString(name)))];
|
[badLabel setStringValue:Q2NSString(tr::lng_mac_not_known_app(tr::now, lt_file, NS2QString(name)))];
|
||||||
[badLabel setFont:[goodLabel font]];
|
[badLabel setFont:[goodLabel font]];
|
||||||
[badLabel setBezeled:NO];
|
[badLabel setBezeled:NO];
|
||||||
[badLabel setDrawsBackground:NO];
|
[badLabel setDrawsBackground:NO];
|
||||||
|
|
|
@ -639,7 +639,7 @@ void MainWindow::psFirstShow() {
|
||||||
|
|
||||||
void MainWindow::createGlobalMenu() {
|
void MainWindow::createGlobalMenu() {
|
||||||
auto main = psMainMenu.addMenu(qsl("Telegram"));
|
auto main = psMainMenu.addMenu(qsl("Telegram"));
|
||||||
auto about = main->addAction(lng_mac_menu_about_telegram(lt_telegram, qsl("Telegram")));
|
auto about = main->addAction(tr::lng_mac_menu_about_telegram(tr::now, lt_telegram, qsl("Telegram")));
|
||||||
connect(about, &QAction::triggered, about, [] {
|
connect(about, &QAction::triggered, about, [] {
|
||||||
if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
|
if (App::wnd() && App::wnd()->isHidden()) App::wnd()->showFromTray();
|
||||||
Ui::show(Box<AboutBox>());
|
Ui::show(Box<AboutBox>());
|
||||||
|
|
|
@ -772,7 +772,7 @@ void MainWindow::updateIconCounters() {
|
||||||
iconOverlay.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(-32, counter, bg, fg, false)));
|
iconOverlay.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(-32, counter, bg, fg, false)));
|
||||||
ps_iconOverlay = createHIconFromQIcon(iconOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
|
ps_iconOverlay = createHIconFromQIcon(iconOverlay, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
|
||||||
}
|
}
|
||||||
auto description = (counter > 0) ? lng_unread_bar(lt_count, counter) : QString();
|
auto description = (counter > 0) ? tr::lng_unread_bar(tr::now, lt_count, counter) : QString();
|
||||||
taskbarList->SetOverlayIcon(ps_hWnd, ps_iconOverlay, description.toStdWString().c_str());
|
taskbarList->SetOverlayIcon(ps_hWnd, ps_iconOverlay, description.toStdWString().c_str());
|
||||||
}
|
}
|
||||||
SetWindowPos(ps_hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
SetWindowPos(ps_hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||||
|
|
|
@ -72,7 +72,7 @@ void GroupMembersWidget::removePeer(PeerData *selectedPeer) {
|
||||||
auto user = selectedPeer->asUser();
|
auto user = selectedPeer->asUser();
|
||||||
Assert(user != nullptr);
|
Assert(user != nullptr);
|
||||||
|
|
||||||
auto text = lng_profile_sure_kick(lt_user, user->firstName);
|
auto text = tr::lng_profile_sure_kick(tr::now, lt_user, user->firstName);
|
||||||
auto currentRestrictedRights = [&]() -> MTPChatBannedRights {
|
auto currentRestrictedRights = [&]() -> MTPChatBannedRights {
|
||||||
if (auto channel = peer()->asMegagroup()) {
|
if (auto channel = peer()->asMegagroup()) {
|
||||||
auto it = channel->mgInfo->lastRestricted.find(user);
|
auto it = channel->mgInfo->lastRestricted.find(user);
|
||||||
|
|
|
@ -48,11 +48,11 @@ void SetupConnectionType(not_null<Ui::VerticalLayout*> container) {
|
||||||
if (Global::ProxySettings() != ProxyData::Settings::Enabled) {
|
if (Global::ProxySettings() != ProxyData::Settings::Enabled) {
|
||||||
return transport.isEmpty()
|
return transport.isEmpty()
|
||||||
? tr::lng_connection_auto_connecting(tr::now)
|
? tr::lng_connection_auto_connecting(tr::now)
|
||||||
: lng_connection_auto(lt_transport, transport);
|
: tr::lng_connection_auto(tr::now, lt_transport, transport);
|
||||||
} else {
|
} else {
|
||||||
return transport.isEmpty()
|
return transport.isEmpty()
|
||||||
? tr::lng_connection_proxy_connecting(tr::now)
|
? tr::lng_connection_proxy_connecting(tr::now)
|
||||||
: lng_connection_proxy(lt_transport, transport);
|
: tr::lng_connection_proxy(tr::now, lt_transport, transport);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const auto button = AddButtonWithLabel(
|
const auto button = AddButtonWithLabel(
|
||||||
|
@ -83,7 +83,8 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
container.get());
|
container.get());
|
||||||
const auto downloading = Ui::CreateChild<rpl::event_stream<bool>>(
|
const auto downloading = Ui::CreateChild<rpl::event_stream<bool>>(
|
||||||
container.get());
|
container.get());
|
||||||
const auto version = lng_settings_current_version(
|
const auto version = tr::lng_settings_current_version(
|
||||||
|
tr::now,
|
||||||
lt_version,
|
lt_version,
|
||||||
currentVersionText());
|
currentVersionText());
|
||||||
const auto toggle = AddButton(
|
const auto toggle = AddButton(
|
||||||
|
@ -130,7 +131,8 @@ void SetupUpdate(not_null<Ui::VerticalLayout*> container) {
|
||||||
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
label->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
|
||||||
const auto showDownloadProgress = [=](int64 ready, int64 total) {
|
const auto showDownloadProgress = [=](int64 ready, int64 total) {
|
||||||
texts->fire(lng_settings_downloading_update(
|
texts->fire(tr::lng_settings_downloading_update(
|
||||||
|
tr::now,
|
||||||
lt_progress,
|
lt_progress,
|
||||||
formatDownloadText(ready, total)));
|
formatDownloadText(ready, total)));
|
||||||
downloading->fire(true);
|
downloading->fire(true);
|
||||||
|
|
|
@ -150,7 +150,7 @@ void Calls::setupContent() {
|
||||||
const auto updateOutputLabel = [=](int value) {
|
const auto updateOutputLabel = [=](int value) {
|
||||||
const auto percent = QString::number(value);
|
const auto percent = QString::number(value);
|
||||||
outputLabel->setText(
|
outputLabel->setText(
|
||||||
lng_settings_call_output_volume(lt_percent, percent));
|
tr::lng_settings_call_output_volume(tr::now, lt_percent, percent));
|
||||||
};
|
};
|
||||||
const auto updateOutputVolume = [=](int value) {
|
const auto updateOutputVolume = [=](int value) {
|
||||||
_needWriteSettings = true;
|
_needWriteSettings = true;
|
||||||
|
@ -228,7 +228,7 @@ void Calls::setupContent() {
|
||||||
const auto updateInputLabel = [=](int value) {
|
const auto updateInputLabel = [=](int value) {
|
||||||
const auto percent = QString::number(value);
|
const auto percent = QString::number(value);
|
||||||
inputLabel->setText(
|
inputLabel->setText(
|
||||||
lng_settings_call_input_volume(lt_percent, percent));
|
tr::lng_settings_call_input_volume(tr::now, lt_percent, percent));
|
||||||
};
|
};
|
||||||
const auto updateInputVolume = [=](int value) {
|
const auto updateInputVolume = [=](int value) {
|
||||||
_needWriteSettings = true;
|
_needWriteSettings = true;
|
||||||
|
|
|
@ -675,7 +675,8 @@ void ForwardsPrivacyController::PaintForwardedTooltip(
|
||||||
const auto innerWidth = bubbleWidth
|
const auto innerWidth = bubbleWidth
|
||||||
- st::msgPadding.left()
|
- st::msgPadding.left()
|
||||||
- st::msgPadding.right();
|
- st::msgPadding.right();
|
||||||
const auto phrase = lng_forwarded(
|
const auto phrase = tr::lng_forwarded(
|
||||||
|
tr::now,
|
||||||
lt_user,
|
lt_user,
|
||||||
App::peerName(view->data()->history()->session().user()));
|
App::peerName(view->data()->history()->session().user()));
|
||||||
const auto kReplacementPosition = QChar(0x0001);
|
const auto kReplacementPosition = QChar(0x0001);
|
||||||
|
|
|
@ -218,8 +218,8 @@ void SetupLocalPasscode(not_null<Ui::VerticalLayout*> container) {
|
||||||
) | rpl::map([] {
|
) | rpl::map([] {
|
||||||
const auto autolock = Global::AutoLock();
|
const auto autolock = Global::AutoLock();
|
||||||
return (autolock % 3600)
|
return (autolock % 3600)
|
||||||
? lng_passcode_autolock_minutes(lt_count, autolock / 60)
|
? tr::lng_passcode_autolock_minutes(tr::now, lt_count, autolock / 60)
|
||||||
: lng_passcode_autolock_hours(lt_count, autolock / 3600);
|
: tr::lng_passcode_autolock_hours(tr::now, lt_count, autolock / 3600);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButtonWithLabel(
|
AddButtonWithLabel(
|
||||||
|
@ -263,7 +263,7 @@ void SetupCloudPassword(not_null<Ui::VerticalLayout*> container) {
|
||||||
) | rpl::filter([](const QString &pattern) {
|
) | rpl::filter([](const QString &pattern) {
|
||||||
return !pattern.isEmpty();
|
return !pattern.isEmpty();
|
||||||
}) | rpl::map([](const QString &pattern) {
|
}) | rpl::map([](const QString &pattern) {
|
||||||
return lng_cloud_password_waiting_code(lt_email, pattern);
|
return tr::lng_cloud_password_waiting_code(tr::now, lt_email, pattern);
|
||||||
}));
|
}));
|
||||||
auto unconfirmed = rpl::duplicate(
|
auto unconfirmed = rpl::duplicate(
|
||||||
pattern
|
pattern
|
||||||
|
|
|
@ -997,13 +997,14 @@ void FileLoadTask::process() {
|
||||||
void FileLoadTask::finish() {
|
void FileLoadTask::finish() {
|
||||||
if (!_result || !_result->filesize || _result->filesize < 0) {
|
if (!_result || !_result->filesize || _result->filesize < 0) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(lng_send_image_empty(lt_name, _filepath)),
|
Box<InformBox>(
|
||||||
|
tr::lng_send_image_empty(tr::now, lt_name, _filepath)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
removeFromAlbum();
|
removeFromAlbum();
|
||||||
} else if (_result->filesize > App::kFileSizeLimit) {
|
} else if (_result->filesize > App::kFileSizeLimit) {
|
||||||
Ui::show(
|
Ui::show(
|
||||||
Box<InformBox>(
|
Box<InformBox>(
|
||||||
lng_send_image_too_large(lt_name, _filepath)),
|
tr::lng_send_image_too_large(tr::now, lt_name, _filepath)),
|
||||||
LayerOption::KeepOther);
|
LayerOption::KeepOther);
|
||||||
removeFromAlbum();
|
removeFromAlbum();
|
||||||
} else if (App::main()) {
|
} else if (App::main()) {
|
||||||
|
|
|
@ -121,15 +121,18 @@ QString FormatDateTime(TimeId value) {
|
||||||
const auto now = QDateTime::currentDateTime();
|
const auto now = QDateTime::currentDateTime();
|
||||||
const auto date = ParseDateTime(value);
|
const auto date = ParseDateTime(value);
|
||||||
if (date.date() == now.date()) {
|
if (date.date() == now.date()) {
|
||||||
return lng_mediaview_today(
|
return tr::lng_mediaview_today(
|
||||||
|
tr::now,
|
||||||
lt_time,
|
lt_time,
|
||||||
date.time().toString(cTimeFormat()));
|
date.time().toString(cTimeFormat()));
|
||||||
} else if (date.date().addDays(1) == now.date()) {
|
} else if (date.date().addDays(1) == now.date()) {
|
||||||
return lng_mediaview_yesterday(
|
return tr::lng_mediaview_yesterday(
|
||||||
|
tr::now,
|
||||||
lt_time,
|
lt_time,
|
||||||
date.time().toString(cTimeFormat()));
|
date.time().toString(cTimeFormat()));
|
||||||
} else {
|
} else {
|
||||||
return lng_mediaview_date_time(
|
return tr::lng_mediaview_date_time(
|
||||||
|
tr::now,
|
||||||
lt_date,
|
lt_date,
|
||||||
date.date().toString(qsl("dd.MM.yy")),
|
date.date().toString(qsl("dd.MM.yy")),
|
||||||
lt_time,
|
lt_time,
|
||||||
|
|
|
@ -9,13 +9,20 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace Text {
|
namespace Text {
|
||||||
|
namespace details {
|
||||||
|
|
||||||
inline auto ToUpper() {
|
struct ToUpperType {
|
||||||
return rpl::map([](QString &&text) {
|
inline QString operator()(const QString &text) const {
|
||||||
|
return text.toUpper();
|
||||||
|
}
|
||||||
|
inline QString operator()(QString &&text) const {
|
||||||
return std::move(text).toUpper();
|
return std::move(text).toUpper();
|
||||||
});
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
|
||||||
|
inline constexpr auto Upper = details::ToUpperType{};
|
||||||
TextWithEntities Bold(const QString &text);
|
TextWithEntities Bold(const QString &text);
|
||||||
TextWithEntities Link(
|
TextWithEntities Link(
|
||||||
const QString &text,
|
const QString &text,
|
||||||
|
@ -25,6 +32,10 @@ inline TextWithEntities WithEntities(const QString &text) {
|
||||||
return { text };
|
return { text };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline auto ToUpper() {
|
||||||
|
return rpl::map(Upper);
|
||||||
|
}
|
||||||
|
|
||||||
inline auto ToBold() {
|
inline auto ToBold() {
|
||||||
return rpl::map(Bold);
|
return rpl::map(Bold);
|
||||||
}
|
}
|
||||||
|
|
|
@ -521,7 +521,7 @@ void NativeManager::doShowNotification(HistoryItem *item, int forwardedCount) {
|
||||||
? tr::lng_notification_preview(tr::now)
|
? tr::lng_notification_preview(tr::now)
|
||||||
: (forwardedCount < 2
|
: (forwardedCount < 2
|
||||||
? (item->groupId() ? tr::lng_in_dlg_album(tr::now) : item->notificationText())
|
? (item->groupId() ? tr::lng_in_dlg_album(tr::now) : item->notificationText())
|
||||||
: lng_forward_messages(lt_count, forwardedCount));
|
: tr::lng_forward_messages(tr::now, lt_count, forwardedCount));
|
||||||
|
|
||||||
doShowNativeNotification(
|
doShowNativeNotification(
|
||||||
item->history()->peer,
|
item->history()->peer,
|
||||||
|
|
|
@ -705,7 +705,7 @@ void Notification::updateNotifyDisplay() {
|
||||||
r.setTop(r.top() + st::dialogsTextFont->height);
|
r.setTop(r.top() + st::dialogsTextFont->height);
|
||||||
}
|
}
|
||||||
p.setPen(st::dialogsTextFg);
|
p.setPen(st::dialogsTextFg);
|
||||||
p.drawText(r.left(), r.top() + st::dialogsTextFont->ascent, lng_forward_messages(lt_count, _forwardedCount));
|
p.drawText(r.left(), r.top() + st::dialogsTextFont->ascent, tr::lng_forward_messages(tr::now, lt_count, _forwardedCount));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
static QString notifyText = st::dialogsTextFont->elided(tr::lng_notification_preview(tr::now), itemWidth);
|
static QString notifyText = st::dialogsTextFont->elided(tr::lng_notification_preview(tr::now), itemWidth);
|
||||||
|
|
|
@ -563,7 +563,7 @@ ThemeExportBox::ThemeExportBox(QWidget*, const QByteArray &paletteContent, const
|
||||||
, _backgroundContent(backgroundContent)
|
, _backgroundContent(backgroundContent)
|
||||||
, _chooseFromFile(this, tr::lng_settings_bg_from_file(tr::now), st::boxLinkButton)
|
, _chooseFromFile(this, tr::lng_settings_bg_from_file(tr::now), st::boxLinkButton)
|
||||||
, _tileBackground(this, tr::lng_settings_bg_tile(tr::now), tileBackground, st::defaultBoxCheckbox) {
|
, _tileBackground(this, tr::lng_settings_bg_tile(tr::now), tileBackground, st::defaultBoxCheckbox) {
|
||||||
_imageText = lng_theme_editor_saved_to_jpg(lt_size, formatSizeText(_backgroundContent.size()));
|
_imageText = tr::lng_theme_editor_saved_to_jpg(tr::now, lt_size, formatSizeText(_backgroundContent.size()));
|
||||||
_chooseFromFile->setClickedCallback([this] { chooseBackgroundFromFile(); });
|
_chooseFromFile->setClickedCallback([this] { chooseBackgroundFromFile(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ void ThemeExportBox::chooseBackgroundFromFile() {
|
||||||
_backgroundContent = content;
|
_backgroundContent = content;
|
||||||
_isPng = (format == "png");
|
_isPng = (format == "png");
|
||||||
auto sizeText = formatSizeText(_backgroundContent.size());
|
auto sizeText = formatSizeText(_backgroundContent.size());
|
||||||
_imageText = _isPng ? lng_theme_editor_read_from_png(lt_size, sizeText) : lng_theme_editor_read_from_jpg(lt_size, sizeText);
|
_imageText = _isPng ? tr::lng_theme_editor_read_from_png(tr::now, lt_size, sizeText) : tr::lng_theme_editor_read_from_jpg(tr::now, lt_size, sizeText);
|
||||||
_tileBackground->setChecked(false);
|
_tileBackground->setChecked(false);
|
||||||
updateThumbnail();
|
updateThumbnail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ void WarningWidget::setSecondsLeft(int secondsLeft) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WarningWidget::updateText() {
|
void WarningWidget::updateText() {
|
||||||
_text = lng_theme_reverting(lt_count, _secondsLeft);
|
_text = tr::lng_theme_reverting(tr::now, lt_count, _secondsLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WarningWidget::showAnimated() {
|
void WarningWidget::showAnimated() {
|
||||||
|
|
|
@ -404,12 +404,12 @@ auto ConnectionState::computeLayout(const State &state) const -> Layout {
|
||||||
|
|
||||||
case State::Type::Waiting:
|
case State::Type::Waiting:
|
||||||
Assert(state.waitTillRetry > 0);
|
Assert(state.waitTillRetry > 0);
|
||||||
result.text = lng_reconnecting(lt_count, state.waitTillRetry);
|
result.text = tr::lng_reconnecting(tr::now, lt_count, state.waitTillRetry);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result.textWidth = st::normalFont->width(result.text);
|
result.textWidth = st::normalFont->width(result.text);
|
||||||
const auto maxTextWidth = (state.type == State::Type::Waiting)
|
const auto maxTextWidth = (state.type == State::Type::Waiting)
|
||||||
? st::normalFont->width(lng_reconnecting(lt_count, 88))
|
? st::normalFont->width(tr::lng_reconnecting(tr::now, lt_count, 88))
|
||||||
: result.textWidth;
|
: result.textWidth;
|
||||||
result.contentWidth = (result.textWidth > 0)
|
result.contentWidth = (result.textWidth > 0)
|
||||||
? (st::connectingTextPadding.left()
|
? (st::connectingTextPadding.left()
|
||||||
|
|
|
@ -224,7 +224,7 @@ void TermsBox::prepare() {
|
||||||
this,
|
this,
|
||||||
object_ptr<Ui::Checkbox>(
|
object_ptr<Ui::Checkbox>(
|
||||||
this,
|
this,
|
||||||
lng_terms_age(lt_count, *_data.minAge),
|
tr::lng_terms_age(tr::now, lt_count, *_data.minAge),
|
||||||
st::defaultCheckbox,
|
st::defaultCheckbox,
|
||||||
std::move(check)),
|
std::move(check)),
|
||||||
st::termsAgePadding)
|
st::termsAgePadding)
|
||||||
|
@ -251,7 +251,7 @@ void TermsBox::prepare() {
|
||||||
: QString();
|
: QString();
|
||||||
if (TextUtilities::RegExpMention().match(link).hasMatch()) {
|
if (TextUtilities::RegExpMention().match(link).hasMatch()) {
|
||||||
_lastClickedMention = link;
|
_lastClickedMention = link;
|
||||||
Ui::Toast::Show(lng_terms_agree_to_proceed(lt_bot, link));
|
Ui::Toast::Show(tr::lng_terms_agree_to_proceed(tr::now, lt_bot, link));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -197,7 +197,7 @@ MainMenu::MainMenu(
|
||||||
qsl("Telegram Desktop"),
|
qsl("Telegram Desktop"),
|
||||||
qsl("https://desktop.telegram.org")));
|
qsl("https://desktop.telegram.org")));
|
||||||
_telegram->setLinksTrusted();
|
_telegram->setLinksTrusted();
|
||||||
_version->setRichText(textcmdLink(1, lng_settings_current_version(lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, tr::lng_menu_about(tr::now)));
|
_version->setRichText(textcmdLink(1, tr::lng_settings_current_version(tr::now, lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, tr::lng_menu_about(tr::now)));
|
||||||
_version->setLink(1, std::make_shared<UrlClickHandler>(qsl("https://desktop.telegram.org/changelog")));
|
_version->setLink(1, std::make_shared<UrlClickHandler>(qsl("https://desktop.telegram.org/changelog")));
|
||||||
_version->setLink(2, std::make_shared<LambdaClickHandler>([] { Ui::show(Box<AboutBox>()); }));
|
_version->setLink(2, std::make_shared<LambdaClickHandler>([] { Ui::show(Box<AboutBox>()); }));
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ Bar::Bar(not_null<QWidget*> parent, QDate date)
|
||||||
_title->setTryMakeSimilarLines(true);
|
_title->setTryMakeSimilarLines(true);
|
||||||
_details->setTryMakeSimilarLines(true);
|
_details->setTryMakeSimilarLines(true);
|
||||||
_details->setText(_soon
|
_details->setText(_soon
|
||||||
? lng_outdated_soon(lt_date, langDayOfMonthFull(date))
|
? tr::lng_outdated_soon(tr::now, lt_date, langDayOfMonthFull(date))
|
||||||
: tr::lng_outdated_now(tr::now));
|
: tr::lng_outdated_now(tr::now));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,8 @@ bool PinnedLimitReached(Dialogs::Key key) {
|
||||||
Auth().data().setChatPinned(key, true);
|
Auth().data().setChatPinned(key, true);
|
||||||
Auth().api().savePinnedOrder(folder);
|
Auth().api().savePinnedOrder(folder);
|
||||||
} else {
|
} else {
|
||||||
auto errorText = lng_error_pinned_max(
|
auto errorText = tr::lng_error_pinned_max(
|
||||||
|
tr::now,
|
||||||
lt_count,
|
lt_count,
|
||||||
pinnedMax);
|
pinnedMax);
|
||||||
Ui::show(Box<InformBox>(errorText));
|
Ui::show(Box<InformBox>(errorText));
|
||||||
|
@ -624,7 +625,8 @@ void PeerMenuExportChat(not_null<PeerData*> peer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerMenuDeleteContact(not_null<UserData*> user) {
|
void PeerMenuDeleteContact(not_null<UserData*> user) {
|
||||||
const auto text = lng_sure_delete_contact(
|
const auto text = tr::lng_sure_delete_contact(
|
||||||
|
tr::now,
|
||||||
lt_contact,
|
lt_contact,
|
||||||
App::peerName(user));
|
App::peerName(user));
|
||||||
const auto deleteSure = [=] {
|
const auto deleteSure = [=] {
|
||||||
|
@ -662,7 +664,7 @@ void PeerMenuShareContactBox(not_null<UserData*> user) {
|
||||||
? peer->name
|
? peer->name
|
||||||
: '\xAB' + peer->name + '\xBB';
|
: '\xAB' + peer->name + '\xBB';
|
||||||
Ui::show(Box<ConfirmBox>(
|
Ui::show(Box<ConfirmBox>(
|
||||||
lng_forward_share_contact(lt_recipient, recipient),
|
tr::lng_forward_share_contact(tr::now, lt_recipient, recipient),
|
||||||
tr::lng_forward_send(tr::now),
|
tr::lng_forward_send(tr::now),
|
||||||
[peer, user] {
|
[peer, user] {
|
||||||
const auto history = peer->owner().history(peer);
|
const auto history = peer->owner().history(peer);
|
||||||
|
@ -768,7 +770,7 @@ void PeerMenuBlockUserBox(
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::Toast::Show(
|
Ui::Toast::Show(
|
||||||
lng_new_contact_block_done(lt_user, user->shortName()));
|
tr::lng_new_contact_block_done(tr::now, lt_user, user->shortName()));
|
||||||
}, st::attentionBoxButton);
|
}, st::attentionBoxButton);
|
||||||
|
|
||||||
box->addButton(tr::lng_cancel(), [=] {
|
box->addButton(tr::lng_cancel(), [=] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue